View Issue Details

IDProjectCategoryView StatusLast Update
0018966LazarusLCLpublic2012-01-06 14:37
ReporterMattias GaertnerAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0018966: Mouse down event of right click on TTreeView is sent after popup
DescriptionOn gtk2:
See attached example: TTreeView with popup menu.
Right click on treeview to open popup menu. There is no mouse down event.
Click on item to close popup menu.
Now the mouse down of the right mouse button down is sent from the gtk2 to the TTreeView.
Because TV has tvoRightClickSelect the node under the cursor is selected *after* popup. It should select before popup.

This breaks the code explorer.
This is a regression.
TagsNo tags attached.
Fixed in Revision30939, 32644
LazTarget0.99.0
WidgetsetGTK 2
Attached Files
  • gtk2treeviewpopupmousedowndelayed.zip (3,394 bytes)
  • gtk2_popup.patch (854 bytes)
    Index: interfaces/gtk2/gtk2callback.inc
    ===================================================================
    --- interfaces/gtk2/gtk2callback.inc	(revision 30005)
    +++ interfaces/gtk2/gtk2callback.inc	(working copy)
    @@ -1525,6 +1525,8 @@
       ResetDefaultIMContext;
       UpdateMouseCaptureControl;
     
    +  DeliverMouseDownMessage(Widget, Event, TWinControl(Data));
    +
       if not (csDesigning in TComponent(Data).ComponentState) then
       begin
         // fix gtklist selection first
    @@ -1577,7 +1579,6 @@
             Mess.msg := LM_SelChange;
             DeliverMessage(TWinControl(Data), Mess);
           end;
    -
         end;
       end else begin
         if (event^.Button=1) and
    @@ -1593,7 +1594,6 @@
         end;
       end;
       //debugln('[gtkMouseBtnPress] calling DeliverMouseDownMessage Result=',dbgs(Result));
    -  DeliverMouseDownMessage(Widget, Event, TWinControl(Data));
     end;
     
     
    
    gtk2_popup.patch (854 bytes)

Relationships

related to 0018956 closedZeljan Rikalo Right click/close in the source editor and the IDE crashes 
related to 0019145 closedJuha Manninen after item selection in listview, items became de-selected when using popup menu (GTK2) 

Activities

2011-03-22 14:20

 

gtk2treeviewpopupmousedowndelayed.zip (3,394 bytes)

2011-03-24 09:44

 

gtk2_popup.patch (854 bytes)
Index: interfaces/gtk2/gtk2callback.inc
===================================================================
--- interfaces/gtk2/gtk2callback.inc	(revision 30005)
+++ interfaces/gtk2/gtk2callback.inc	(working copy)
@@ -1525,6 +1525,8 @@
   ResetDefaultIMContext;
   UpdateMouseCaptureControl;
 
+  DeliverMouseDownMessage(Widget, Event, TWinControl(Data));
+
   if not (csDesigning in TComponent(Data).ComponentState) then
   begin
     // fix gtklist selection first
@@ -1577,7 +1579,6 @@
         Mess.msg := LM_SelChange;
         DeliverMessage(TWinControl(Data), Mess);
       end;
-
     end;
   end else begin
     if (event^.Button=1) and
@@ -1593,7 +1594,6 @@
     end;
   end;
   //debugln('[gtkMouseBtnPress] calling DeliverMouseDownMessage Result=',dbgs(Result));
-  DeliverMouseDownMessage(Widget, Event, TWinControl(Data));
 end;
 
 
gtk2_popup.patch (854 bytes)

Paul Ishenin

2011-03-24 09:44

manager   ~0046778

Does the attached patch solves anything?

Zeljan Rikalo

2011-04-03 16:07

developer   ~0047125

No, well it shows popup, but makes another problems.
eg. when right mouse clicked it should also select row, but it doesn't in this case, maybe it's better to delivermessage like you mentioned, but only if right button is pressed just before checking for LM_CONTEXT, and also stop current delivery if right mouse button is pressed.

Mattias Gaertner

2011-05-27 22:22

manager   ~0048661

Pauls patch works for me. I added it with -dGtk2CallMouseDownBeforeContext for others to test.

Felipe Monteiro de Carvalho

2011-10-03 08:20

developer   ~0052406

Well, lets do it then. I activated the define in rev 32644

Mattias Gaertner

2012-01-06 14:37

manager   ~0055502

Thanks

Issue History

Date Modified Username Field Change
2011-03-22 14:20 Mattias Gaertner New Issue
2011-03-22 14:20 Mattias Gaertner File Added: gtk2treeviewpopupmousedowndelayed.zip
2011-03-22 14:20 Mattias Gaertner LazTarget => -
2011-03-22 14:20 Mattias Gaertner Relationship added related to 0018956
2011-03-22 14:21 Mattias Gaertner Widgetset => GTK 2
2011-03-24 09:44 Paul Ishenin LazTarget - => 0.99.0
2011-03-24 09:44 Paul Ishenin Status new => acknowledged
2011-03-24 09:44 Paul Ishenin Target Version => 0.99.0
2011-03-24 09:44 Paul Ishenin File Added: gtk2_popup.patch
2011-03-24 09:44 Paul Ishenin Note Added: 0046778
2011-04-03 16:07 Zeljan Rikalo Note Added: 0047125
2011-04-11 16:55 Zeljan Rikalo Relationship added related to 0019145
2011-05-27 22:22 Mattias Gaertner Note Added: 0048661
2011-10-03 08:18 Felipe Monteiro de Carvalho Fixed in Revision => 30939
2011-10-03 08:20 Felipe Monteiro de Carvalho Fixed in Revision 30939 => 30939, 32644
2011-10-03 08:20 Felipe Monteiro de Carvalho Status acknowledged => resolved
2011-10-03 08:20 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2011-10-03 08:20 Felipe Monteiro de Carvalho Resolution open => fixed
2011-10-03 08:20 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2011-10-03 08:20 Felipe Monteiro de Carvalho Note Added: 0052406
2012-01-06 14:37 Mattias Gaertner Status resolved => closed
2012-01-06 14:37 Mattias Gaertner Note Added: 0055502