mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
WindowServer: Don't automatically focus desktop window when added
Normally we focus any window that's added to the window stack. However, for WindowType::Desktop this gets annoying since if the desktop manager comes up after other GUI processes have already started, it steals the focus from them. Solve this by only auto-focusing desktop windows if they are the very first window added.
This commit is contained in:
parent
2a9e29fbb8
commit
453b678346
1 changed files with 5 additions and 1 deletions
|
@ -169,6 +169,8 @@ Gfx::Size WindowManager::resolution() const
|
||||||
|
|
||||||
void WindowManager::add_window(Window& window)
|
void WindowManager::add_window(Window& window)
|
||||||
{
|
{
|
||||||
|
bool is_first_window = m_windows_in_order.is_empty();
|
||||||
|
|
||||||
m_windows_in_order.append(&window);
|
m_windows_in_order.append(&window);
|
||||||
|
|
||||||
if (window.is_fullscreen()) {
|
if (window.is_fullscreen()) {
|
||||||
|
@ -176,7 +178,9 @@ void WindowManager::add_window(Window& window)
|
||||||
window.set_rect(Screen::the().rect());
|
window.set_rect(Screen::the().rect());
|
||||||
}
|
}
|
||||||
|
|
||||||
set_active_window(&window);
|
if (window.type() != WindowType::Desktop || is_first_window)
|
||||||
|
set_active_window(&window);
|
||||||
|
|
||||||
if (m_switcher.is_visible() && window.type() != WindowType::WindowSwitcher)
|
if (m_switcher.is_visible() && window.type() != WindowType::WindowSwitcher)
|
||||||
m_switcher.refresh();
|
m_switcher.refresh();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue