Skip to content

Commit

Permalink
Compact if condition in MinimalWindowManager::handle_window_ready
Browse files Browse the repository at this point in the history
  • Loading branch information
tarek-y-ismail committed Dec 5, 2024
1 parent d5a1cb8 commit 896ef1d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/miral/minimal_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,10 @@ void miral::MinimalWindowManager::handle_window_ready(WindowInfo& window_info)
{
// If focus stealing prevention isn't enabled, activate on window ready (if
// possible). Otherwise, only activate the first opened window.
if ((self->focus_stealing == FocusStealing::allow) || !tools.active_window())
if (window_info.can_be_active())
{
tools.select_active_window(window_info.window());
}
if (((self->focus_stealing == FocusStealing::allow) || !tools.active_window()) && window_info.can_be_active())
{
tools.select_active_window(window_info.window());
}
}

void miral::MinimalWindowManager::handle_modify_window(
Expand Down

0 comments on commit 896ef1d

Please sign in to comment.