mirror of
https://github.com/labwc/labwc.git
synced 2026-02-20 01:40:22 -05:00
ToggleKeybinds per window
This commit is contained in:
parent
b6dfffc782
commit
235a8ad9bc
12 changed files with 84 additions and 5 deletions
35
src/view.c
35
src/view.c
|
|
@ -1088,6 +1088,36 @@ view_reload_ssd(struct view *view)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
inhibit_keybinds(struct view *view, bool inhibit)
|
||||
{
|
||||
assert(view->inhibits_keybinds != inhibit);
|
||||
|
||||
view->inhibits_keybinds = inhibit;
|
||||
if (inhibit) {
|
||||
view->server->seat.nr_inhibited_keybind_views++;
|
||||
} else {
|
||||
view->server->seat.nr_inhibited_keybind_views--;
|
||||
}
|
||||
|
||||
if (view->ssd_enabled) {
|
||||
ssd_enable_keybind_inhibit_indicator(view->ssd, inhibit);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
view_inhibits_keybinds(struct view *view)
|
||||
{
|
||||
return view && view->inhibits_keybinds;
|
||||
}
|
||||
|
||||
void
|
||||
view_toggle_keybinds(struct view *view)
|
||||
{
|
||||
assert(view);
|
||||
inhibit_keybinds(view, !view->inhibits_keybinds);
|
||||
}
|
||||
|
||||
void
|
||||
view_destroy(struct view *view)
|
||||
{
|
||||
|
|
@ -1130,6 +1160,11 @@ view_destroy(struct view *view)
|
|||
zfree(view->tiled_region_evacuate);
|
||||
}
|
||||
|
||||
if (view->inhibits_keybinds) {
|
||||
view->inhibits_keybinds = false;
|
||||
server->seat.nr_inhibited_keybind_views--;
|
||||
}
|
||||
|
||||
osd_on_view_destroy(view);
|
||||
undecorate(view);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue