summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx/x11/gfx_x11.pas24
-rw-r--r--prototypes/newmultihandle/gui_button.inc4
2 files changed, 18 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;
diff --git a/prototypes/newmultihandle/gui_button.inc b/prototypes/newmultihandle/gui_button.inc
index e79b8748..b12bbf8a 100644
--- a/prototypes/newmultihandle/gui_button.inc
+++ b/prototypes/newmultihandle/gui_button.inc
@@ -80,6 +80,8 @@ end;
procedure TFButton.EvMousePressed(AButton: TMouseButton; const AMousePos: TPoint
);
begin
+ WriteLn('Mouse Pressed');
+
FIsPressed := True;
Invalidate;
@@ -90,6 +92,8 @@ end;
procedure TFButton.EvMouseReleased(AButton: TMouseButton;
const AMousePos: TPoint);
begin
+ WriteLn('Mouse Released');
+
FIsPressed := False;
Invalidate;