From 2d0687ae9ea96b00fcac83f079b3c5530119a0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 22 Jan 2008 19:08:28 +0000 Subject: [PATCH] * B_AVOID_FOCUS windows never got mouse clicks. This fixes bug #1652. * Our behaviour differs a bit from how BeOS handles those windows, added a comment to the code which explains that, and how we could change it if we really wanted to. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23705 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/WindowLayer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index 8119627108..c3cb47b7cb 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -820,6 +820,7 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken) } } } else { + // click was inside the window contents if (ViewLayer* view = ViewAt(where)) { if (HasModal()) return; @@ -834,9 +835,14 @@ WindowLayer::MouseDown(BMessage* message, BPoint where, int32* _viewToken) && desktopSettings.MouseMode() == B_NORMAL_MOUSE) fDesktop->ActivateWindow(this); - // eat the click if we don't accept first click - if ((Flags() & B_WILL_ACCEPT_FIRST_CLICK) == 0 - || (Flags() & B_AVOID_FOCUS) != 0) + // Eat the click if we don't accept first click + // (B_AVOID_FOCUS never gets the focus, so they always accept + // the first click) + // TODO: the latter is unlike BeOS - if we really wanted to + // imitate this behaviour, we would need to check if we're + // the front window instead of the focus window + if ((Flags() & (B_WILL_ACCEPT_FIRST_CLICK + | B_AVOID_FOCUS)) == 0) return; }