Gtk2: fixed mouse capture locks. fixes #15271

git-svn-id: trunk@26430 -
This commit is contained in:
zeljko 2010-07-02 21:19:26 +00:00
parent 8219a7bc0b
commit db22564763
2 changed files with 27 additions and 0 deletions

View File

@ -4639,7 +4639,9 @@ begin
or ((MouseCaptureWidget<>Widget) and (MouseCaptureWidget<>Widget^.parent))
then
exit;
{$IFDEF VerboseMouseCapture}
DebugLn('ReleaseCaptureWidget ',GetWidgetDebugReport(Widget));
{$ENDIF}
ReleaseMouseCapture;
end;

View File

@ -173,6 +173,30 @@ begin
Result := True;
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;
WinControl: TWinControl); cdecl;
var
@ -936,6 +960,7 @@ begin
// set gtk2 only callbacks
ConnectSignal(AGTKObject, 'show-help', @gtk2ShowHelpCB, ALCLObject);
ConnectSignal(AGTKObject,'grab-notify',@gtk2GrabNotify, ALCLObject);
end;
procedure TGtk2WidgetSet.SetLabelCaption(const ALabel: PGtkLabel;