From 4682283fbdc7ccdabe67b2770bea780b2fd6e924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 9 Oct 2008 10:03:43 +0000 Subject: [PATCH] * The BView archived the view's event mask - if the auto-raise feature was enabled when the view got archived, the replicant inherited the event mask of the view. We now make sure the event mask is always set to 0. * This fixes bug #2566. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27940 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/workspaces/Workspaces.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp index 294f9fab9c..719a8834a9 100644 --- a/src/apps/workspaces/Workspaces.cpp +++ b/src/apps/workspaces/Workspaces.cpp @@ -303,6 +303,10 @@ WorkspacesView::WorkspacesView(BRect frame) WorkspacesView::WorkspacesView(BMessage* archive) : BView(archive) { + // Make sure the auto-raise feature didn't leave any artifacts - this is + // not a good idea to keep enabled for a replicant. + if (EventMask() != 0) + SetEventMask(0); } @@ -379,19 +383,20 @@ void WorkspacesView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage) { - if (dynamic_cast(Window()) == NULL || EventMask() == 0) + WorkspacesWindow* window = dynamic_cast(Window()); + if (window == NULL || !window->IsAutoRaising()) return; // Auto-Raise where = ConvertToScreen(where); - BScreen screen(Window()); + BScreen screen(window); BRect frame = screen.Frame(); if (where.x == frame.left || where.x == frame.right || where.y == frame.top || where.y == frame.bottom) { // cursor is on screen edge - if (Window()->Frame().Contains(where)) - Window()->Activate(); + if (window->Frame().Contains(where)) + window->Activate(); } }