Skip to content

Commit

Permalink
shortcuts-inhibit: Add option to deny inhibit for views matching crit…
Browse files Browse the repository at this point in the history
…eria (#2051)
  • Loading branch information
soreau authored Dec 6, 2023
1 parent d891cf1 commit f55c32d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata/shortcuts-inhibit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<default>none</default>
</option>

<option name="ignore_views" type="string">
<_short>Ignore views</_short>
<_long>Restrict matched views from activating shortcuts inhibit.</_long>
<default>none</default>
</option>

<option name="break_grab" type="key">
<_short>Break current inhibitor</_short>
<_long>A keybinding to remove the currently active inhibitor temporary.</_long>
Expand Down
7 changes: 7 additions & 0 deletions plugins/protocols/shortcuts-inhibit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class wayfire_shortcuts_inhibit : public wf::plugin_interface_t
}

deactivate_for_surface(last_focus);

if (ignore_views.matches(focus_view))
{
return;
}

activate_for_surface(new_focus);
}

Expand All @@ -73,6 +79,7 @@ class wayfire_shortcuts_inhibit : public wf::plugin_interface_t
}

private:
wf::view_matcher_t ignore_views{"shortcuts-inhibit/ignore_views"};
wlr_keyboard_shortcuts_inhibit_manager_v1 *inhibit_manager;
wf::wl_listener_wrapper keyboard_inhibit_new;
wf::view_matcher_t inhibit_by_default{"shortcuts-inhibit/inhibit_by_default"};
Expand Down

0 comments on commit f55c32d

Please sign in to comment.