diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-02 11:39:29 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-02 11:39:29 (GMT) |
commit | bfeee5bf082e7cac82ff8616fe11502e97f2ed3c (patch) | |
tree | c12fa65a444645b8f89feba3bddeef8e4b31542b /generic | |
parent | e9f82758411ef773b62638334f16b794cf990f5b (diff) | |
parent | 16d1be046a47a326a015e8bf3086ecd36c0b6e6d (diff) | |
download | tk-bfeee5bf082e7cac82ff8616fe11502e97f2ed3c.zip tk-bfeee5bf082e7cac82ff8616fe11502e97f2ed3c.tar.gz tk-bfeee5bf082e7cac82ff8616fe11502e97f2ed3c.tar.bz2 |
[Bug 533519]: Window placement with multiple screens
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkBind.c | 20 | ||||
-rw-r--r-- | generic/tkFocus.c | 8 | ||||
-rw-r--r-- | generic/tkMenuDraw.c | 28 | ||||
-rw-r--r-- | generic/tkStubInit.c | 6 |
4 files changed, 18 insertions, 44 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index abdee59..21bfb5c 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2581,33 +2581,13 @@ ExpandPercents( } case 'X': if (flags & KEY_BUTTON_MOTION_CROSSING) { - Tk_Window tkwin; - int x, y; - int width, height; - number = eventPtr->xkey.x_root; - tkwin = Tk_IdToWindow(eventPtr->xany.display, - eventPtr->xany.window); - if (tkwin != NULL) { - Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height); - number -= x; - } goto doNumber; } goto doString; case 'Y': if (flags & KEY_BUTTON_MOTION_CROSSING) { - Tk_Window tkwin; - int x, y; - int width, height; - number = eventPtr->xkey.y_root; - tkwin = Tk_IdToWindow(eventPtr->xany.display, - eventPtr->xany.window); - if (tkwin != NULL) { - Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height); - number -= y; - } goto doNumber; } goto doString; diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 42d8be3..4814c17 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -725,7 +725,7 @@ TkFocusKeyEvent( { DisplayFocusInfo *displayFocusPtr; TkWindow *focusWinPtr; - int focusX, focusY, vRootX, vRootY, vRootWidth, vRootHeight; + int focusX, focusY; displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr); focusWinPtr = displayFocusPtr->focusWinPtr; @@ -758,11 +758,9 @@ TkFocusKeyEvent( eventPtr->xkey.x = -1; eventPtr->xkey.y = -1; } else { - Tk_GetVRootGeometry((Tk_Window) focusWinPtr, &vRootX, &vRootY, - &vRootWidth, &vRootHeight); Tk_GetRootCoords((Tk_Window) focusWinPtr, &focusX, &focusY); - eventPtr->xkey.x = eventPtr->xkey.x_root - vRootX - focusX; - eventPtr->xkey.y = eventPtr->xkey.y_root - vRootY - focusY; + eventPtr->xkey.x = eventPtr->xkey.x_root - focusX; + eventPtr->xkey.y = eventPtr->xkey.y_root - focusY; } eventPtr->xkey.window = focusWinPtr->window; return focusWinPtr; diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index d2a66d3..65aa591 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -844,7 +844,7 @@ TkPostTearoffMenu( * posting */ { int vRootX, vRootY, vRootWidth, vRootHeight; - int tmp, result; + int result; TkActivateMenuEntry(menuPtr, -1); TkRecomputeMenu(menuPtr); @@ -877,31 +877,21 @@ TkPostTearoffMenu( * 2. The menu may not have been mapped yet, so its current size might be * the default 1x1. To compute how much space it needs, use its * requested size, not its actual size. - * - * Note that this code assumes square screen regions and all positive - * coordinates. This does not work on a Mac with multiple monitors. But - * then again, Tk has other problems with this. */ Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY, &vRootWidth, &vRootHeight); - x += vRootX; - y += vRootY; - tmp = WidthOfScreen(Tk_Screen(menuPtr->tkwin)) - - Tk_ReqWidth(menuPtr->tkwin); - if (x > tmp) { - x = tmp; + if (x > vRootX + vRootWidth) { + x = vRootX + vRootWidth; } - if (x < 0) { - x = 0; + if (x < vRootX) { + x = vRootX; } - tmp = HeightOfScreen(Tk_Screen(menuPtr->tkwin)) - - Tk_ReqHeight(menuPtr->tkwin); - if (y > tmp) { - y = tmp; + if (y > vRootY + vRootHeight) { + y = vRootY + vRootHeight; } - if (y < 0) { - y = 0; + if (y < vRootY) { + y = vRootY; } Tk_MoveToplevelWindow(menuPtr->tkwin, x, y); if (!Tk_IsMapped(menuPtr->tkwin)) { diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 6af8946..02038a8 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -94,6 +94,12 @@ static void *Tk_GetHINSTANCE() (const char *) &tkIntStubs, &hInstance); return hInstance; } + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 # else /* !__CYGWIN__ */ # define TkPutImage 0 |