mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
Revert "keyboard: include pressed modifiers in bound set"
This reverts commit 98bf316ee6.
This commit is contained in:
parent
5bcc03db05
commit
bd7a533dd6
3 changed files with 4 additions and 18 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
uint32_t *key_state_pressed_sent_keycodes(void);
|
uint32_t *key_state_pressed_sent_keycodes(void);
|
||||||
int key_state_nr_pressed_sent_keycodes(void);
|
int key_state_nr_pressed_sent_keycodes(void);
|
||||||
|
|
||||||
void key_state_set_pressed(uint32_t keycode, bool is_pressed, bool is_modifier);
|
void key_state_set_pressed(uint32_t keycode, bool is_pressed);
|
||||||
void key_state_store_pressed_key_as_bound(uint32_t keycode);
|
void key_state_store_pressed_key_as_bound(uint32_t keycode);
|
||||||
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
|
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
|
||||||
void key_state_bound_key_remove(uint32_t keycode);
|
void key_state_bound_key_remove(uint32_t keycode);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
#include "common/set.h"
|
#include "common/set.h"
|
||||||
#include "input/key-state.h"
|
#include "input/key-state.h"
|
||||||
|
|
||||||
static struct lab_set pressed, pressed_mods, bound, pressed_sent;
|
static struct lab_set pressed, bound, pressed_sent;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
report(struct lab_set *key_set, const char *msg)
|
report(struct lab_set *key_set, const char *msg)
|
||||||
|
|
@ -54,16 +54,12 @@ key_state_nr_pressed_sent_keycodes(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
key_state_set_pressed(uint32_t keycode, bool is_pressed, bool is_modifier)
|
key_state_set_pressed(uint32_t keycode, bool is_pressed)
|
||||||
{
|
{
|
||||||
if (is_pressed) {
|
if (is_pressed) {
|
||||||
lab_set_add(&pressed, keycode);
|
lab_set_add(&pressed, keycode);
|
||||||
if (is_modifier) {
|
|
||||||
lab_set_add(&pressed_mods, keycode);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
lab_set_remove(&pressed, keycode);
|
lab_set_remove(&pressed, keycode);
|
||||||
lab_set_remove(&pressed_mods, keycode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,15 +67,6 @@ void
|
||||||
key_state_store_pressed_key_as_bound(uint32_t keycode)
|
key_state_store_pressed_key_as_bound(uint32_t keycode)
|
||||||
{
|
{
|
||||||
lab_set_add(&bound, keycode);
|
lab_set_add(&bound, keycode);
|
||||||
/*
|
|
||||||
* Also store any pressed modifiers as bound. This prevents
|
|
||||||
* applications from seeing and handling the release event for
|
|
||||||
* a modifier key that was part of a keybinding (e.g. Firefox
|
|
||||||
* displays its menu bar for a lone Alt press + release).
|
|
||||||
*/
|
|
||||||
for (int i = 0; i < pressed_mods.size; ++i) {
|
|
||||||
lab_set_add(&bound, pressed_mods.values[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -514,8 +514,7 @@ handle_compositor_keybindings(struct keyboard *keyboard,
|
||||||
bool locked = seat->server->session_lock_manager->locked;
|
bool locked = seat->server->session_lock_manager->locked;
|
||||||
|
|
||||||
key_state_set_pressed(event->keycode,
|
key_state_set_pressed(event->keycode,
|
||||||
event->state == WL_KEYBOARD_KEY_STATE_PRESSED,
|
event->state == WL_KEYBOARD_KEY_STATE_PRESSED);
|
||||||
keyinfo.is_modifier);
|
|
||||||
|
|
||||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||||
if (cur_keybind && cur_keybind->on_release) {
|
if (cur_keybind && cur_keybind->on_release) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue