diff options
author | das <das> | 2006-04-28 06:02:57 (GMT) |
---|---|---|
committer | das <das> | 2006-04-28 06:02:57 (GMT) |
commit | a5b92093185c667fa3159a2ee58b5682290af6b1 (patch) | |
tree | 5b3992c68a12ca95ff81a211d111286d7c82c2e0 /macosx/tkMacOSXKeyEvent.c | |
parent | 29fd0ac98c568926da12b00ea63d88c6d98985f7 (diff) | |
download | tk-a5b92093185c667fa3159a2ee58b5682290af6b1.zip tk-a5b92093185c667fa3159a2ee58b5682290af6b1.tar.gz tk-a5b92093185c667fa3159a2ee58b5682290af6b1.tar.bz2 |
* macosx/tkMacOSXWm.c (TkWmMapWindow, InitialWindowBounds): fix use of
potentially stale window position in initial configure event on first
map of a window. [Bug 1476443]
(TkMacOSXWindowOffset): use modern GetWindowStructureWidths API.
* macosx/tkMacOSXInt.h:
* macosx/tkMacOSXMouseEvent.c (TkGenerateButtonEventForXPointer): new
internal function to generate button events for current pointer
directly, without requiring prior call to XQueryPointer().
* macosx/tkMacOSXMouseEvent.c (XQueryPointer): implement return of
window-local pointer position.
* macosx/tkMacOSXInt.h: use improvements above to avoid calls to
* macosx/tkMacOSXKeyEvent.c: GlobalToLocal() when the current port might
* macosx/tkMacOSXMenu.c: not be set correctly. May fix [Bug 1243318]
* macosx/tkMacOSXMenus.c:
* macosx/tkMacOSXScale.c:
* macosx/tkMacOSXScrlbr.c:
* tkAboutDlg.r: update copyright.
* macosx/tkMacOSXCarbonEvents.c: sync with HEAD
* macosx/tkMacOSXDebug.c:
* macosx/tkMacOSXDebug.h:
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXEvent.c:
* macosx/tkMacOSXEvent.h:
* macosx/tkMacOSXFont.h:
* macosx/tkMacOSXInit.c:
* macosx/tkMacOSXInt.h:
* macosx/tkMacOSXKeyEvent.c:
* macosx/tkMacOSXMenu.c:
* macosx/tkMacOSXMenubutton.c:
* macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXSend.c:
* macosx/tkMacOSXTest.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index f45da28..020206c 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -50,7 +50,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.7 2006/03/28 02:44:13 das Exp $ + * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.8 2006/04/28 06:02:59 das Exp $ */ #include "tkMacOSXInt.h" @@ -58,8 +58,8 @@ typedef struct { WindowRef whichWindow; - Point global; - Point local; + int global_x, global_y; + int local_x, local_y; unsigned int state; unsigned char ch; UInt32 keyCode; @@ -132,7 +132,7 @@ static int KeycodeToUnicodeViaKCHRResource( *---------------------------------------------------------------------- */ -int +MODULE_SCOPE int TkMacOSXProcessKeyboardEvent( TkMacOSXEvent * eventPtr, MacEventStatus * statusPtr) @@ -435,19 +435,18 @@ GenerateKeyEvent( static int InitKeyData(KeyEventData * keyEventDataPtr) { - int x, y; memset (keyEventDataPtr, 0, sizeof(*keyEventDataPtr)); keyEventDataPtr->whichWindow = ActiveNonFloatingWindow(); if (keyEventDataPtr->whichWindow == NULL) { return false; } - XQueryPointer(NULL, None, NULL, NULL, &x, &y, - NULL, NULL, &keyEventDataPtr->state); - keyEventDataPtr->global.v = x; - keyEventDataPtr->global.v = y; - keyEventDataPtr->local = keyEventDataPtr->global; - GlobalToLocal(&keyEventDataPtr->local); + XQueryPointer(NULL, None, NULL, NULL, + &keyEventDataPtr->global_x, + &keyEventDataPtr->global_y, + &keyEventDataPtr->local_x, + &keyEventDataPtr->local_y, + &keyEventDataPtr->state); return true; } @@ -534,8 +533,8 @@ InitKeyEvent( eventPtr->xkey.same_screen = true; eventPtr->xkey.subwindow = None; eventPtr->xkey.time = TkpGetMS(); - eventPtr->xkey.x_root = e->global.h; - eventPtr->xkey.y_root = e->global.v; + eventPtr->xkey.x_root = e->global_x; + eventPtr->xkey.y_root = e->global_y; eventPtr->xkey.window = Tk_WindowId(tkwin); eventPtr->xkey.display = Tk_Display(tkwin); eventPtr->xkey.root = XRootWindow(Tk_Display(tkwin), 0); @@ -543,7 +542,7 @@ InitKeyEvent( eventPtr->xkey.trans_chars[0] = 0; Tk_TopCoordsToWindow( - tkwin, e->local.h, e->local.v, + tkwin, e->local_x, e->local_y, &eventPtr->xkey.x, &eventPtr->xkey.y); eventPtr->xkey.keycode = e->ch | @@ -1109,7 +1108,7 @@ KeycodeToUnicodeViaKCHRResource( *---------------------------------------------------------------------- */ -int +MODULE_SCOPE int TkMacOSXKeycodeToUnicode( UniChar * uniChars, int maxChars, EventKind eKind, |