* Fix for 7892 by Paul Ishenin

git-svn-id: trunk@10682 -
This commit is contained in:
marc 2007-02-25 16:53:37 +00:00
parent 8e235a6696
commit 231cfe8497

View File

@ -4607,11 +4607,29 @@ end;
procedure ReleaseMouseCapture;
var
OldMouseCaptureWidget: PGtkWidget;
Info: PWidgetInfo;
begin
{$IFDEF VerboseMouseCapture}
DebugLn('ReleaseMouseCapture ',dbgs(ord(MouseCaptureType)),' MouseCaptureWidget=[',GetWidgetDebugReport(MouseCaptureWidget),']');
{$ENDIF}
if MouseCaptureType=mctGTK then exit;
if MouseCaptureType=mctGTK then
begin
Info := GetWidgetInfo(gtk_grab_get_current, false);
if (Info <> nil) and (Info^.CoreWidget <> nil) then
begin
if GtkWidgetIsA(Info^.CoreWidget, gtk_list_get_type) then
begin
// Paul Ishenin:
// listbox grabs pointer and other control for itself, when we click on lisebox item
// aslo it change its state to drag_selection
// this is not expected in LCL and as result cause bugs, such as 7892
// so we need end drag selection manually
OldMouseCaptureWidget := Info^.CoreWidget;
gtk_list_end_drag_selection(PGtkList(OldMouseCaptureWidget));
end;
end;
exit;
end;
OldMouseCaptureWidget:=MouseCaptureWidget;
MouseCaptureWidget:=nil;
MouseCaptureType:=mctGTK;