问题
I wrote an application in Gtk3 using gdk_display_get_monitor_at_window
and
gdk_monitor_get_geometry
. Out of 75 gtk functions that I used, these are the only 2 that are causing problems for people trying to compile on Ubuntu because most people are not running a version of Ubuntu that has gtk3 3.22.
My application also uses X11, so I want to replace these functions with X11 equivalents. After briefly looking at X11, I have some questions:
- Is a Gtk "monitor" equal to an X11 "screen"?
- If the answer to 1. is yes, then what is a Gtk "screen" equal to in X11?
- What is a "display" in each?
A complete table comparing display/screen/monitor etc in Gtk to X11 would be good.
回答1:
A monitor is a physical device. A screen is a logical device, possibly complete with its own keyboard and pointer (mouse). A screen can span multiple monitors.
Normally there is only one screen (one keyboard, one mouse) on a personal computer, even if there are multiple monitors. Multiple screens are of limited utility for a PC as it is not possible to move windows between screens. A multi-screen setup works best for a multi-user machine where each user gets his own monitor, keyboard and mouse.
There is another variant of multi-screen setup where one can move the mouse pointers between screens (and so there is one mouse and one keyboard), but windows are still confined to their screens. This variant us thoroughly obsolete.
A display is a network server that can manage one or more screens (on a typical PC, just one screen).
来源:https://stackoverflow.com/questions/42987932/is-a-monitor-in-gtk3-the-same-as-a-screen-in-x11