mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-09 03:02:08 +02:00
Gtk2: fixed mouse capture locks. fixes #15271
git-svn-id: trunk@26430 -
This commit is contained in:
parent
8219a7bc0b
commit
db22564763
@ -4639,7 +4639,9 @@ begin
|
|||||||
or ((MouseCaptureWidget<>Widget) and (MouseCaptureWidget<>Widget^.parent))
|
or ((MouseCaptureWidget<>Widget) and (MouseCaptureWidget<>Widget^.parent))
|
||||||
then
|
then
|
||||||
exit;
|
exit;
|
||||||
|
{$IFDEF VerboseMouseCapture}
|
||||||
DebugLn('ReleaseCaptureWidget ',GetWidgetDebugReport(Widget));
|
DebugLn('ReleaseCaptureWidget ',GetWidgetDebugReport(Widget));
|
||||||
|
{$ENDIF}
|
||||||
ReleaseMouseCapture;
|
ReleaseMouseCapture;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -173,6 +173,30 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function gtk2GrabNotify(widget: PGtkWidget; grabbed: GBoolean; data: GPointer): GBoolean; cdecl;
|
||||||
|
var
|
||||||
|
W: PGtkWidget;
|
||||||
|
WidgetInfo: PWidgetInfo;
|
||||||
|
begin
|
||||||
|
Result := CallBackDefaultReturn;
|
||||||
|
if Grabbed then
|
||||||
|
begin
|
||||||
|
w := gtk_grab_get_current;
|
||||||
|
if MouseCaptureWidget <> nil then
|
||||||
|
WidgetInfo := GetWidgetInfo(MouseCaptureWidget)
|
||||||
|
else
|
||||||
|
WidgetInfo := nil;
|
||||||
|
|
||||||
|
if (WidgetInfo <> nil) and (W = MouseCaptureWidget) and (W <> Widget)
|
||||||
|
and (WidgetInfo^.ClientWidget = nil) then
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
ReleaseCaptureWidget(W);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure gtk_clb_toggle(cellrenderertoggle : PGtkCellRendererToggle; arg1 : PGChar;
|
procedure gtk_clb_toggle(cellrenderertoggle : PGtkCellRendererToggle; arg1 : PGChar;
|
||||||
WinControl: TWinControl); cdecl;
|
WinControl: TWinControl); cdecl;
|
||||||
var
|
var
|
||||||
@ -936,6 +960,7 @@ begin
|
|||||||
|
|
||||||
// set gtk2 only callbacks
|
// set gtk2 only callbacks
|
||||||
ConnectSignal(AGTKObject, 'show-help', @gtk2ShowHelpCB, ALCLObject);
|
ConnectSignal(AGTKObject, 'show-help', @gtk2ShowHelpCB, ALCLObject);
|
||||||
|
ConnectSignal(AGTKObject,'grab-notify',@gtk2GrabNotify, ALCLObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGtk2WidgetSet.SetLabelCaption(const ALabel: PGtkLabel;
|
procedure TGtk2WidgetSet.SetLabelCaption(const ALabel: PGtkLabel;
|
||||||
|
Loading…
Reference in New Issue
Block a user