From 2fc6f37e8893705bddf0979f0e3afd7143bbad7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 25 May 2010 11:26:00 +0000 Subject: [PATCH] * Window::MouseDown() no longer eats the click if the window modifiers were pressed even if there is nothing to do. This allows the Deskbar to be moved with the window modifier keys held, finally, see #6029. * Removed a superfluous (fDecorator != NULL) from the check to choose between decorator and window modifier action - _ActionFor() can safely be called with a NULL decorator, and it just made the logic look wrong (even though no harm was done). * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36935 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Window.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index 16dbd31a03..89fea734bb 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -792,25 +792,30 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) bool windowModifier = (fFlags & B_NO_SERVER_SIDE_WINDOW_MODIFIERS) == 0 && (modifiers & (B_COMMAND_KEY | B_CONTROL_KEY | B_OPTION_KEY | B_SHIFT_KEY)) == (B_COMMAND_KEY | B_CONTROL_KEY); + click_type action = CLICK_NONE; - // default action is to drag the Window if (windowModifier || inBorderRegion) { // clicking Window visible area - click_type action = CLICK_NONE; int32 buttons = _ExtractButtons(message); - if (inBorderRegion && fDecorator != NULL) + if (inBorderRegion) action = _ActionFor(message, buttons, modifiers); else { if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0) action = CLICK_MOVE_TO_BACK; else if ((fFlags & B_NOT_MOVABLE) == 0 && fDecorator != NULL) action = CLICK_DRAG; + else { + // pass click on to the application + windowModifier = false; + } } + } + if (windowModifier || inBorderRegion) { if (!desktopSettings.AcceptFirstClick()) { - // ignore clicks on decorator buttons if the + // Ignore clicks on decorator buttons if the // non-floating window doesn't have focus if (!IsFocus() && !IsFloating() && action != CLICK_MOVE_TO_BACK && action != CLICK_RESIZE && action != CLICK_SLIDE_TAB) @@ -868,13 +873,12 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) engine->LockParallelAccess(); engine->ConstrainClippingRegion(visibleBorder); - if (fIsZooming) { + if (fIsZooming) fDecorator->SetZoom(true); - } else if (fIsClosing) { + else if (fIsClosing) fDecorator->SetClose(true); - } else if (fIsMinimizing) { + else if (fIsMinimizing) fDecorator->SetMinimize(true); - } engine->UnlockParallelAccess();