adm Find login register

gtk win32 & multiple-monitor support


joined: 2007-08-09
posted: 11469
promoted: 617
bookmarked: 187
新竹, 台灣
1subject: gtk win32 & multiple-monitor supportPromote 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
adm Find login register