Report question

Question: How to programmatically get the resolution of a window and that of the system in Linux?