summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-13 22:09:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-13 22:09:12 (GMT)
commit89329e662613c6d98b35969a07111c2d74e759b5 (patch)
tree9ac07da68cae29f8a6551d49acc7bae75ded2226 /win
parentbeb2fa12050651e1be1a182fd1a7c814aa8e283c (diff)
downloadtk-bug_533519_alt.zip
tk-bug_533519_alt.tar.gz
tk-bug_533519_alt.tar.bz2
alternative bug fix, keeping coordinates relative to the screenbug_533519_alt
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index e4c9c34..d606a80 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -6401,20 +6401,24 @@ Tk_GetVRootGeometry(
int *widthPtr, int *heightPtr)
/* Store dimensions of virtual root here. */
{
- TkWindow *winPtr = (TkWindow *) tkwin;
+ register TkWindow *winPtr = (TkWindow *) tkwin;
+ POINT point;
+
+ point.x = GetSystemMetrics(SM_XVIRTUALSCREEN);
+ point.y = GetSystemMetrics(SM_YVIRTUALSCREEN);
/*
- * XXX: This is not correct for multiple monitors. There may be many
- * changes required to get this right, and it may effect existing
- * applications that don't consider possible <0 vroot. See
- * http://msdn.microsoft.com/library/en-us/gdi/monitor_3lrn.asp for more
- * info.
+ * If the window is mapped, let Windows figure out the translation.
*/
- *xPtr = 0;
- *yPtr = 0;
- *widthPtr = DisplayWidth(winPtr->display, winPtr->screenNum);
- *heightPtr = DisplayHeight(winPtr->display, winPtr->screenNum);
+ if (winPtr->window != None) {
+ HWND hwnd = Tk_GetHWND(winPtr->window);
+ ClientToScreen(hwnd, &point);
+ }
+ *xPtr = point.x;
+ *yPtr = point.y;
+ *widthPtr = GetSystemMetrics(SM_CXVIRTUALSCREEN);
+ *heightPtr = GetSystemMetrics(SM_CYVIRTUALSCREEN);
}
/*