From 59acee8c4bd680d8d4886e9b70aea57279d8ea59 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 14 Nov 2011 10:54:15 +0000 Subject: [PATCH] 2011-11-14 11:54 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/gtxwc/gtxwc.c * minor code cleanup --- harbour/ChangeLog | 4 +++ harbour/src/rtl/gtxwc/gtxwc.c | 46 +++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d0c7226484..8c7f4992e5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-11-14 11:54 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/gtxwc/gtxwc.c + * minor code cleanup + 2011-11-13 11:42 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - contrib/hbclipsm * contrib/hbplist diff --git a/harbour/src/rtl/gtxwc/gtxwc.c b/harbour/src/rtl/gtxwc/gtxwc.c index e0a03f91e0..12464e86ec 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.c +++ b/harbour/src/rtl/gtxwc/gtxwc.c @@ -2898,6 +2898,13 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) { KeySym out; +#ifdef XWC_DEBUG + if( wnd->window != evt->xany.window ) + { + printf( "Event: #%d window=%ld (wnd->window=%ld)\r\n", evt->type, evt->xany.window, wnd->window ); fflush(stdout); + } +#endif + switch( evt->type ) { case Expose: @@ -2905,9 +2912,9 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) printf( "Event: Expose\r\n" ); fflush(stdout); #endif hb_gt_xwc_InvalidatePts( wnd, - evt->xexpose.x , evt->xexpose.y, - evt->xexpose.x + evt->xexpose.width, - evt->xexpose.y + evt->xexpose.height ); + evt->xexpose.x , evt->xexpose.y, + evt->xexpose.x + evt->xexpose.width, + evt->xexpose.y + evt->xexpose.height ); break; case NoExpose: @@ -2934,22 +2941,25 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) out = XLookupKeysym( &evt->xkey, 0 ); switch( out ) { - /* First of all, let's scan for special codes */ - case XK_Shift_L: case XK_Shift_R: + case XK_Shift_L: + case XK_Shift_R: wnd->keyModifiers.bShift = HB_FALSE; - return; + break; - case XK_Control_L: case XK_Control_R: + case XK_Control_L: + case XK_Control_R: wnd->keyModifiers.bCtrl = HB_FALSE; - return; + break; - case XK_Meta_L: case XK_Alt_L: + case XK_Meta_L: + case XK_Alt_L: wnd->keyModifiers.bAlt = HB_FALSE; - return; + break; - case XK_Meta_R: case XK_Alt_R: + case XK_Meta_R: + case XK_Alt_R: wnd->keyModifiers.bAltGr = HB_FALSE; - return; + break; } break; @@ -3920,18 +3930,22 @@ static void hb_gt_xwc_ProcessMessages( PXWND_DEF wnd ) #else { HB_BOOL fRepeat; + XEvent evt; + + while( XCheckWindowEvent( wnd->dpy, wnd->window, XWC_STD_MASK, &evt ) ) + hb_gt_xwc_WndProc( wnd, &evt ); + do { - XEvent evt; + hb_gt_xwc_UpdateSize( wnd ); + hb_gt_xwc_UpdatePts( wnd ); + hb_gt_xwc_UpdateCursor( wnd ); fRepeat = HB_FALSE; while( XCheckWindowEvent( wnd->dpy, wnd->window, XWC_STD_MASK, &evt ) ) { hb_gt_xwc_WndProc( wnd, &evt ); fRepeat = HB_TRUE; } - hb_gt_xwc_UpdateSize( wnd ); - hb_gt_xwc_UpdatePts( wnd ); - hb_gt_xwc_UpdateCursor( wnd ); } while( fRepeat ); }