app_server: don't focus the window on mouse down if it accepts first click
* matches BeOS behaviour. Fixes #15544. Change-Id: I2a3636024753b53ba9ad6446c187e6a4479c31b6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2020 Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
+16
-16
@@ -900,26 +900,26 @@ Window::MouseDown(BMessage* message, BPoint where,
|
|||||||
if (!IsFocus()) {
|
if (!IsFocus()) {
|
||||||
bool acceptFirstClick
|
bool acceptFirstClick
|
||||||
= (Flags() & B_WILL_ACCEPT_FIRST_CLICK) != 0;
|
= (Flags() & B_WILL_ACCEPT_FIRST_CLICK) != 0;
|
||||||
bool avoidFocus = (Flags() & B_AVOID_FOCUS) != 0;
|
|
||||||
|
|
||||||
// Activate or focus the window in case it doesn't accept first
|
// Activate or focus the window in case it doesn't accept first
|
||||||
// click, depending on the mouse mode
|
// click, depending on the mouse mode
|
||||||
DesktopSettings desktopSettings(fDesktop);
|
if (!acceptFirstClick) {
|
||||||
if (desktopSettings.MouseMode() == B_NORMAL_MOUSE
|
bool avoidFocus = (Flags() & B_AVOID_FOCUS) != 0;
|
||||||
&& !acceptFirstClick)
|
DesktopSettings desktopSettings(fDesktop);
|
||||||
fDesktop->ActivateWindow(this);
|
if (desktopSettings.MouseMode() == B_NORMAL_MOUSE)
|
||||||
else if (!avoidFocus)
|
fDesktop->ActivateWindow(this);
|
||||||
fDesktop->SetFocusWindow(this);
|
else if (!avoidFocus)
|
||||||
|
fDesktop->SetFocusWindow(this);
|
||||||
|
|
||||||
// Eat the click if we don't accept first click
|
// Eat the click if we don't accept first click
|
||||||
// (B_AVOID_FOCUS never gets the focus, so they always accept
|
// (B_AVOID_FOCUS never gets the focus, so they always accept
|
||||||
// the first click)
|
// the first click)
|
||||||
// TODO: the latter is unlike BeOS - if we really wanted to
|
// TODO: the latter is unlike BeOS - if we really wanted to
|
||||||
// imitate this behaviour, we would need to check if we're
|
// imitate this behaviour, we would need to check if we're
|
||||||
// the front window instead of the focus window
|
// the front window instead of the focus window
|
||||||
if (!acceptFirstClick && !desktopSettings.AcceptFirstClick()
|
if (!desktopSettings.AcceptFirstClick() && !avoidFocus)
|
||||||
&& !avoidFocus)
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill out view token for the view under the mouse
|
// fill out view token for the view under the mouse
|
||||||
|
|||||||
Reference in New Issue
Block a user