From 9a9aa3e02183f53680a0e5282baee8094be9e9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 24 Aug 2009 11:02:32 +0000 Subject: [PATCH] * The Ctrl-Alt-window modifier patch was pretty broken. Also, I've disabled window moving for windows without a decorator at all, at least that's what I would assume they intend (we might want to force them to set B_NOT_MOVABLE, too, though). * This also fixes the crashing bug as described in ticket #4314. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32649 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Window.cpp | 41 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index c00376b383..e9fb97c3a9 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -782,7 +782,7 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) if (windowModifier || inBorderRegion) { // clicking Window visible area - click_type action = DEC_DRAG; + click_type action = DEC_NONE; int32 buttons = _ExtractButtons(message); if (inBorderRegion && fDecorator != NULL) @@ -790,6 +790,8 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) else { if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0) action = DEC_MOVETOBACK; + else if ((fFlags & B_NOT_MOVABLE) == 0 && fDecorator != NULL) + action = DEC_DRAG; } // ignore clicks on decorator buttons if the @@ -837,28 +839,29 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken) break; } - // redraw decorator - BRegion* visibleBorder = fRegionPool.GetRegion(); - GetBorderRegion(visibleBorder); - visibleBorder->IntersectWith(&VisibleRegion()); + if (fDecorator != NULL) { + // redraw decorator + BRegion* visibleBorder = fRegionPool.GetRegion(); + GetBorderRegion(visibleBorder); + visibleBorder->IntersectWith(&VisibleRegion()); - DrawingEngine* engine = fDecorator->GetDrawingEngine(); - engine->LockParallelAccess(); - engine->ConstrainClippingRegion(visibleBorder); + DrawingEngine* engine = fDecorator->GetDrawingEngine(); + engine->LockParallelAccess(); + engine->ConstrainClippingRegion(visibleBorder); - if (fIsZooming) { - fDecorator->SetZoom(true); - } else if (fIsClosing) { - fDecorator->SetClose(true); - } else if (fIsMinimizing) { - fDecorator->SetMinimize(true); + if (fIsZooming) { + fDecorator->SetZoom(true); + } else if (fIsClosing) { + fDecorator->SetClose(true); + } else if (fIsMinimizing) { + fDecorator->SetMinimize(true); + } + + engine->UnlockParallelAccess(); + + fRegionPool.Recycle(visibleBorder); } - engine->UnlockParallelAccess(); - - fRegionPool.Recycle(visibleBorder); - - // based on what the Decorator returned, properly place this window. if (action == DEC_MOVETOBACK) { fDesktop->SendWindowBehind(this); } else {