diff options
author | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-12 07:15:02 +0000 |
---|---|---|
committer | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-12 07:15:02 +0000 |
commit | 69e6c6fc970d14602875f290f9fcb3cfff2911bb (patch) | |
tree | 8bb3fd33ad0dbeab2791eccbf48772dc04c13e56 /gfx | |
parent | 0b1c5f7ce659f63f00f3b7c408871bd35e6f7456 (diff) | |
download | fpGUI-69e6c6fc970d14602875f290f9fcb3cfff2911bb.tar.xz |
Implemented a better Invalidate for X11 and fixed mouse release on X11
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/x11/gfx_x11.pas | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index 7f677ffb..2d5d6c41 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -1049,12 +1049,10 @@ begin // According to a comment in X.h, the valid event types start with 2! if XEvent._type >= 2 then begin -// WriteLn('=== Received X event "', GetXEventName(XEvent._type), '"'); WindowEntry := FindWindowByXID(XEvent.XAny.Window); if not Assigned(WindowEntry) then begin -// writeln(Format('==unknown== Window ID = %d', [XEvent.XAny.Window])); WriteLn('fpGFX/X11: Received X event "', GetXEventName(XEvent._type), '" for unknown window'); continue; end; @@ -1103,11 +1101,15 @@ begin end; X.ButtonRelease: begin - XButtonToMouseButton(XEvent.xbutton.button, MouseButton); + { Release events are only for mouse buttons, and not mouse wheel moviments } + if (XEvent.xbutton.button >= 1) and (XEvent.xbutton.button <= 3) then + begin + XButtonToMouseButton(XEvent.xbutton.button, MouseButton); - WindowEntry.EvMouseReleased( - MouseButton, - Point(XEvent.xbutton.x, XEvent.xbutton.y)); + WindowEntry.EvMouseReleased( + MouseButton, + Point(XEvent.xbutton.x, XEvent.xbutton.y)); + end; end; X.EnterNotify: begin @@ -1522,15 +1524,17 @@ begin end; procedure TX11Window.Invalidate; -var - ARect: TRect; +{var + ARect: TRect;} begin - ARect.Left := Left; +{ ARect.Left := Left; ARect.Top := Top; ARect.Right := Left + Width; ARect.Bottom := Top + Height; - GFApplication.DirtyList.AddRect(Self, ARect); + GFApplication.DirtyList.AddRect(Self, ARect); } + + EvPaint(); end; procedure TX11Window.PaintInvalidRegion; |