mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-20 01:40:18 -05:00
opt: sync keymap to xwayland after xwayland ready
This commit is contained in:
parent
acf8363714
commit
faf2e1e9da
2 changed files with 15 additions and 6 deletions
16
src/mango.c
16
src/mango.c
|
|
@ -730,6 +730,7 @@ static void set_rect_size(struct wlr_scene_rect *rect, int32_t width,
|
|||
static Client *center_tiled_select(Monitor *m);
|
||||
static void handlecursoractivity(void);
|
||||
static int32_t hidecursor(void *data);
|
||||
static int32_t synckeymap(void *data);
|
||||
static bool check_hit_no_border(Client *c);
|
||||
static void reset_keyboard_layout(void);
|
||||
static void client_update_oldmonname_record(Client *c, Monitor *m);
|
||||
|
|
@ -876,6 +877,7 @@ struct dvec2 *baked_points_opafadein;
|
|||
struct dvec2 *baked_points_opafadeout;
|
||||
|
||||
static struct wl_event_source *hide_source;
|
||||
static struct wl_event_source *sync_keymap;
|
||||
static bool cursor_hidden = false;
|
||||
static bool tag_combo = false;
|
||||
static const char *cli_config_path = NULL;
|
||||
|
|
@ -5327,7 +5329,8 @@ void setup(void) {
|
|||
&request_set_cursor_shape);
|
||||
hide_source = wl_event_loop_add_timer(wl_display_get_event_loop(dpy),
|
||||
hidecursor, cursor);
|
||||
|
||||
sync_keymap = wl_event_loop_add_timer(wl_display_get_event_loop(dpy),
|
||||
synckeymap, NULL);
|
||||
/*
|
||||
* Configures a seat, which is a single "seat" at which a user sits and
|
||||
* operates the computer. This conceptually includes up to one keyboard,
|
||||
|
|
@ -5556,6 +5559,13 @@ int32_t hidecursor(void *data) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int32_t synckeymap(void *data) {
|
||||
reset_keyboard_layout();
|
||||
// we only need to sync keymap once
|
||||
wl_event_source_timer_update(sync_keymap, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void unlocksession(struct wl_listener *listener, void *data) {
|
||||
SessionLock *lock = wl_container_of(listener, lock, unlock);
|
||||
destroylock(lock, 1);
|
||||
|
|
@ -6147,6 +6157,10 @@ void xwaylandready(struct wl_listener *listener, void *data) {
|
|||
xwayland, xcursor->images[0]->buffer, xcursor->images[0]->width * 4,
|
||||
xcursor->images[0]->width, xcursor->images[0]->height,
|
||||
xcursor->images[0]->hotspot_x, xcursor->images[0]->hotspot_y);
|
||||
/* xwayland can't auto sync the keymap, so we do it manually
|
||||
and we need to wait the xwayland completely inited
|
||||
*/
|
||||
wl_event_source_timer_update(sync_keymap, 500);
|
||||
}
|
||||
|
||||
static void setgeometrynotify(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue