diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 2d221f403..39a9f5e02 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -880,11 +880,6 @@ static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, // otherwise send it to Wayland-defined focus window Fl_Window *win = ( Fl::focus() ? Fl::focus()->top_window() : Fl_Wayland_Window_Driver::surface_to_window(seat->keyboard_surface) ); - if (win) { - set_event_xy(win); - Fl::e_is_click = 0; - Fl::handle(event, win); - } if (event == FL_KEYDOWN && status == XKB_COMPOSE_NOTHING && !(sym >= FL_Shift_L && sym <= FL_Alt_R)) { // Handling of key repeats : @@ -903,6 +898,11 @@ static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, Fl::add_timeout(key_repeat_delay, (Fl_Timeout_Handler)key_repeat_timer_cb, key_repeat_data); } + if (win) { + set_event_xy(win); + Fl::e_is_click = 0; + Fl::handle(event, win); + } } diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 5ef98ae63..0158dc623 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -172,7 +172,7 @@ void Fl_Wayland_Window_Driver::take_focus() xdg_toplevel_set_parent(xdg_toplevel(), top_dr->xdg_toplevel()); // this will remove the parent-child relationship xdg_toplevel_set_parent(xdg_toplevel(), NULL); - wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display); + wl_surface_commit(w->wl_surface); } // this sets the first window fl_wl_find(w);