From 481e2d20d70aea37ecfac3482dfb0da7abf414fb Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Sun, 29 Oct 2023 22:17:31 +0100 Subject: [PATCH] wm-actions: fix toggle always on top with no focused views (#1989) Fixes #1961 --- plugins/wm-actions/wm-actions.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/wm-actions/wm-actions.cpp b/plugins/wm-actions/wm-actions.cpp index 4ed5daa8b..5ff87cc72 100644 --- a/plugins/wm-actions/wm-actions.cpp +++ b/plugins/wm-actions/wm-actions.cpp @@ -218,8 +218,13 @@ class wayfire_wm_actions_output_t : public wf::per_output_plugin_instance_t wf::activator_callback on_toggle_above = [=] (auto ev) -> bool { auto view = choose_view(ev.source); - - return set_keep_above_state(view, !view->has_data("wm-actions-above")); + if (view) + { + return set_keep_above_state(view, !view->has_data("wm-actions-above")); + } else + { + return false; + } }; wf::activator_callback on_minimize = [=] (auto ev) -> bool