On 1/30/07, Vincent Snijders <[EMAIL PROTECTED]> wrote:
Is this correct? testing for OnMouseUp, but calling OnMouseDown? See also a 
couple of lines above.

oooops =) Given enougth eyeballs all bugs are shallow =)

new patch fixes this. Also this bug propagated to X11 interface due to
CTRL+C CTRL+V =) fixed too

--
Felipe Monteiro de Carvalho
Index: components/trayicon/wsgtk2trayicon.pas
===================================================================
--- components/trayicon/wsgtk2trayicon.pas	(revision 10535)
+++ components/trayicon/wsgtk2trayicon.pas	(working copy)
@@ -217,8 +217,13 @@
     2: if Assigned(vwsTrayIcon.OnMouseUp) then
         vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
 
-    3: if Assigned(vwsTrayIcon.OnMouseUp) then
-        vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
+    3:
+    begin
+      if Assigned(vwsTrayIcon.OnMouseUp) then
+       vwsTrayIcon.OnMouseUp(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
+      if Assigned(vwsTrayIcon.PopUpMenu) then
+       vwsTrayIcon.PopUpMenu.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
+     end;
   end;
 end;
 
@@ -246,19 +251,14 @@
   else
   begin
     case event^.button of
-      1: if Assigned(vwsTrayIcon.OnMouseUp) then
+      1: if Assigned(vwsTrayIcon.OnMouseDown) then
           vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbLeft, [], Round(event^.X), Round(event^.Y));
 
-      2: if Assigned(vwsTrayIcon.OnMouseUp) then
-         vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
+      2: if Assigned(vwsTrayIcon.OnMouseDown) then
+          vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbMiddle, [], Round(event^.X), Round(event^.Y));
 
-      3:
-      begin
-        if Assigned(vwsTrayIcon.OnMouseUp) then
-         vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
-        if Assigned(vwsTrayIcon.PopUpMenu) then
-         vwsTrayIcon.PopUpMenu.PopUp(Mouse.CursorPos.X, Mouse.CursorPos.Y);
-      end;
+      3: if Assigned(vwsTrayIcon.OnMouseDown) then
+          vwsTrayIcon.OnMouseDown(vwsTrayIcon, mbRight, [], Round(event^.X), Round(event^.Y));
     end;
   end;
 end;
Index: components/trayicon/wsx11trayicon.pas
===================================================================
--- components/trayicon/wsx11trayicon.pas	(revision 10535)
+++ components/trayicon/wsx11trayicon.pas	(working copy)
@@ -356,13 +356,13 @@
       begin
         BtnPressEv := PXButtonPressedEvent(@ev);
         case BtnPressEv^.button of
-          1: if Assigned(OnMouseUp) then
+          1: if Assigned(OnMouseDown) then
              OnMouseDown(Self, mbLeft, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
 
-          2: if Assigned(OnMouseUp) then
+          2: if Assigned(OnMouseDown) then
              OnMouseDown(Self, mbMiddle, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
 
-          3: if Assigned(OnMouseUp) then
+          3: if Assigned(OnMouseDown) then
              OnMouseDown(Self, mbRight, [], Round(BtnPressEv^.X), Round(BtnPressEv^.Y));
         end;
       end;

Reply via email to