From 229f4986d283d4c4855b9ead892a15182c8cedd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 25 Sep 2007 13:15:15 +0000 Subject: [PATCH] * Added private (as of now) B_HIDE_APPLICATION message that calls do_minimize_team() (which is what the Deskbar does when you select "Hide All"). * Added keyboard shortcuts to minimize, and zoom a window, and to hide the whole application (Cmd+Ctrl+M/Z/H respectively). The former two are also present in Dano and up. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22302 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index d41974e88b..1386f2ebe2 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -47,6 +47,11 @@ # define STRACE(x) ; #endif +#define B_HIDE_APPLICATION '_AHD' + // if we ever move this to a public namespace, we should also move the + // handling of this message into BApplication + +void do_minimize_team(BRect zoomRect, team_id team, bool zoom); struct BWindow::unpack_cookie { unpack_cookie(); @@ -686,7 +691,6 @@ BWindow::MessageReceived(BMessage *msg) BMessage replyMsg(B_REPLY); bool handled = false; - BMessage specifier; int32 what; const char *prop; @@ -845,6 +849,10 @@ BWindow::DispatchMessage(BMessage *msg, BHandler *target) break; } + case B_HIDE_APPLICATION: + do_minimize_team(BRect(), be_app->Team(), false); + break; + case B_WINDOW_RESIZED: { int32 width, height; @@ -2426,6 +2434,14 @@ BWindow::_InitData(BRect frame, const char* title, window_look look, AddShortcut('V', B_COMMAND_KEY, new BMessage(B_PASTE), NULL); AddShortcut('A', B_COMMAND_KEY, new BMessage(B_SELECT_ALL), NULL); + // Window modifier keys + AddShortcut('M', B_COMMAND_KEY | B_CONTROL_KEY, + new BMessage(B_MINIMIZE), NULL); + AddShortcut('Z', B_COMMAND_KEY | B_CONTROL_KEY, + new BMessage(B_ZOOM), NULL); + AddShortcut('H', B_COMMAND_KEY | B_CONTROL_KEY, + new BMessage(B_HIDE_APPLICATION), NULL); + // We set the default pulse rate, but we don't start the pulse fPulseRate = 500000; fPulseRunner = NULL;