[haiku-commits] Change in haiku[master]: Deskbar: close window by middle click in expander mode

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 10 Mar 2020 09:34:48 +0000

From X512 <danger_mail@xxxxxxx>:

X512 has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2337 ;)


Change subject: Deskbar: close window by middle click in expander mode
......................................................................

Deskbar: close window by middle click in expander mode

Change-Id: Iaf201b8fe87dcc4430afd451a7ad3654178389a0
---
M src/apps/deskbar/ExpandoMenuBar.cpp
1 file changed, 18 insertions(+), 0 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/37/2337/1

diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp 
b/src/apps/deskbar/ExpandoMenuBar.cpp
index 70445d2..f9b3ecb 100644
--- a/src/apps/deskbar/ExpandoMenuBar.cpp
+++ b/src/apps/deskbar/ExpandoMenuBar.cpp
@@ -46,6 +46,7 @@
 #include <ControlLook.h>
 #include <Debug.h>
 #include <MenuPrivate.h>
+#include <MessengerPrivate.h>
 #include <NodeInfo.h>
 #include <Roster.h>
 #include <Screen.h>
@@ -263,7 +264,9 @@
        }

        int32 modifiers = 0;
+       int32 buttons = 0;
        message->FindInt32("modifiers", &modifiers);
+       message->FindInt32("buttons", &buttons);

        // check for three finger salute, a.k.a. Vulcan Death Grip
        if ((modifiers & B_COMMAND_KEY) != 0
@@ -280,6 +283,21 @@
                }
                return;
                        // absorb the message
+       } else {
+               TWindowMenuItem* wndItem = 
dynamic_cast<TWindowMenuItem*>(menuItem);
+               if (wndItem != NULL && (buttons & B_TERTIARY_MOUSE_BUTTON) != 
0) {
+                       // close window
+                       client_window_info* info;
+                       BMessenger wnd;
+                       info = get_window_info(wndItem->ID());
+                       if (info == NULL) return;
+                       BMessenger::Private(wnd).SetTo(
+                               info->team, info->client_port, 
info->client_token);
+                       free(info); info = NULL;
+                       wnd.SendMessage(B_QUIT_REQUESTED);
+                       return;
+                               // absorb the message
+               }
        }

        // control click - show all/hide all shortcut

--
To view, visit https://review.haiku-os.org/c/haiku/+/2337
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Iaf201b8fe87dcc4430afd451a7ad3654178389a0
Gerrit-Change-Number: 2337
Gerrit-PatchSet: 1
Gerrit-Owner: X512 <danger_mail@xxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: Deskbar: close window by middle click in expander mode - Gerrit