Skip to content

Commit 98ecd5f

Browse files
committed
Grab focus in browser only on dragging an item
Grab_Add prevents a canvas to get mouse release events. We move Grab_Add/Grab_Remove out of On_Button_Event to prevent eating next mouse clicks. For NB07-021 Change-Id: I2af6e3f98eaff16a1eec87d32ed471160f8aebbf
1 parent d982102 commit 98ecd5f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gtkada-canvas_view.adb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ package body Gtkada.Canvas_View is
794794
Self.In_Drag := False;
795795
Self.Dragged_Items.Clear;
796796
Self.Last_Button_Press.Allowed_Drag_Area := No_Drag_Allowed;
797+
Self.Grab_Remove;
797798
end Cancel_Drag;
798799

799800
---------------------
@@ -818,10 +819,7 @@ package body Gtkada.Canvas_View is
818819
return False;
819820
elsif Details.Event_Type = Button_Press then
820821
Cancel_Inline_Editing (Self);
821-
Self.Grab_Add;
822822
Self.Grab_Focus;
823-
elsif Details.Event_Type = Button_Release then
824-
Self.Grab_Remove;
825823
end if;
826824

827825
if Event.The_Type = Gdk.Event.Button_Release
@@ -928,6 +926,7 @@ package body Gtkada.Canvas_View is
928926
Dummy := Self.Item_Event (Details'Unchecked_Access);
929927

930928
Self.Topleft_At_Drag_Start := Self.Topleft;
929+
Self.Grab_Add;
931930

932931
-- ??? Should add all selected items
933932
if Details.Toplevel_Item /= null

0 commit comments

Comments
 (0)