Skip to content

Commit

Permalink
fix handling of focus of views with null keyboard focus view (#2015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ammen99 authored Nov 16, 2023
1 parent 77c9214 commit 3f03995
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/window-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ void window_manager_t::focus_raise_view(wayfire_view view, bool allow_switch_ws)
return;
}

if (!view->get_keyboard_focus_surface())
{
LOGW("Attempting to give focus to a view without focus surface!");
return;
}

if (auto toplevel = toplevel_cast(find_topmost_parent(view)))
{
if (toplevel->minimized)
Expand Down
6 changes: 6 additions & 0 deletions src/core/wm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ bool wayfire_focus::check_focus_surface(wayfire_view view)
return false;
}

if (!view->get_keyboard_focus_surface())
{
wf::view_bring_to_front(view);
return false;
}

auto old_focus = core.seat->get_active_view();
core.default_wm->focus_raise_view(view);
return core.seat->get_active_view() != old_focus;
Expand Down

0 comments on commit 3f03995

Please sign in to comment.