cht電腦資訊LanguageC/C++
adm Find login register

gtk win32 & multiple-monitor support

eliu
1 gtk win32 & multiple-monitor support
Promote 0 Bookmark 02012-05-25quote  

Some display cards especially laptop/notebook support multiple monitors.

For Windows/win32, the left/top boundary of the virtual screen is:

dpy_x_ofs = GetSystemMetrics(SM_XVIRTUALSCREEN);
dpy_y_ofs = GetSystemMetrics(SM_YVIRTUALSCREEN);

If the desktop monitor(with taskbar & desktop icon)  is configured at the right of the blank montor, dpy_x_ofs can be negative.  In gtk/win32, the left/top corner of the virtual screen is always (0,0). The coordinate is shifted.

In other words, to convert a windows point (wx, wy) to gtk (gx, gy), you have to

gx = wx - dpy_x_ofs;
gy = wy - dpy_y_ofs;

edited: 3

CC: Windows
cht電腦資訊LanguageC/C++
adm Find login register
views:4495