mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-24 16:12:41 +00:00
Compare commits
1 Commits
e23fec173a
..
0.7
| Author | SHA1 | Date | |
|---|---|---|---|
| d5bbe6d54d |
@@ -294,7 +294,7 @@ static void gpureset(struct wl_listener *listener, void *data);
|
||||
static void handlesig(int signo);
|
||||
static void incnmaster(const Arg *arg);
|
||||
static void inputdevice(struct wl_listener *listener, void *data);
|
||||
static int keybinding(uint32_t mods, xkb_keysym_t sym, bool run_func);
|
||||
static int keybinding(uint32_t mods, xkb_keysym_t sym);
|
||||
static void keypress(struct wl_listener *listener, void *data);
|
||||
static void keypressmod(struct wl_listener *listener, void *data);
|
||||
static int keyrepeat(void *data);
|
||||
@@ -716,6 +716,8 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||
wl_list_remove(&m->frame.link);
|
||||
wl_list_remove(&m->link);
|
||||
wl_list_remove(&m->request_state.link);
|
||||
if (m->lock_surface)
|
||||
destroylocksurface(&m->destroy_lock_surface, NULL);
|
||||
m->wlr_output->data = NULL;
|
||||
wlr_output_layout_remove(output_layout, m->wlr_output);
|
||||
wlr_scene_output_destroy(m->scene_output);
|
||||
@@ -1556,7 +1558,7 @@ inputdevice(struct wl_listener *listener, void *data)
|
||||
}
|
||||
|
||||
int
|
||||
keybinding(uint32_t mods, xkb_keysym_t sym, bool run_func)
|
||||
keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
{
|
||||
/*
|
||||
* Here we handle compositor keybindings. This is when the compositor is
|
||||
@@ -1567,8 +1569,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym, bool run_func)
|
||||
for (k = keys; k < END(keys); k++) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||
&& sym == k->keysym && k->func) {
|
||||
if (run_func)
|
||||
k->func(&k->arg);
|
||||
k->func(&k->arg);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1597,10 +1598,9 @@ keypress(struct wl_listener *listener, void *data)
|
||||
|
||||
/* On _press_ if there is no active screen locker,
|
||||
* attempt to process a compositor keybinding. */
|
||||
if (!locked) {
|
||||
bool run_func = event->state == WL_KEYBOARD_KEY_STATE_PRESSED;
|
||||
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
for (i = 0; i < nsyms; i++)
|
||||
handled = keybinding(mods, syms[i], run_func) || handled;
|
||||
handled = keybinding(mods, syms[i]) || handled;
|
||||
}
|
||||
|
||||
if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
|
||||
@@ -1648,7 +1648,7 @@ keyrepeat(void *data)
|
||||
1000 / group->wlr_group->keyboard.repeat_info.rate);
|
||||
|
||||
for (i = 0; i < group->nsyms; i++)
|
||||
keybinding(group->mods, group->keysyms[i], true);
|
||||
keybinding(group->mods, group->keysyms[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user