From b6dae138d4422049e87f46d4a0155c6238a0992e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 14 May 2022 17:21:25 +0200 Subject: Restore top-level GL window under Weston. --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 4 ++-- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 686816203..67ad43b9e 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -242,7 +242,7 @@ void Fl_Wayland_Gl_Window_Driver::make_current_before() { egl_surface = eglCreateWindowSurface(egl_display, g->egl_conf, egl_window, NULL); //fprintf(stderr, "Created egl surface=%p at scale=%d\n", egl_surface, win->scale); wl_surface_set_buffer_scale(surface, win->scale); - if (Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::WESTON) { + if (pWindow->parent() && Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::WESTON) { bool done = false; struct wl_callback *callback = wl_surface_frame(surface); wl_surface_commit(surface); @@ -344,7 +344,7 @@ void Fl_Wayland_Gl_Window_Driver::resize(int is_a_resize, int W, int H) { if (W2 != W || H2 != H) { wl_egl_window_resize(egl_window, W, H, 0, 0); //fprintf(stderr, "Fl_Wayland_Gl_Window_Driver::resize to %dx%d\n", W, H); - egl_resize_in_progress = true; + if (!Fl_Window::is_a_rescale()) egl_resize_in_progress = true; } } diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 7b12ca124..7b4b34116 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -513,8 +513,10 @@ static void wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard, seat->keyboard_surface = surface; seat->keyboard_enter_serial = serial; Fl_Window *win = Fl_Wayland_Screen_Driver::surface_to_window(surface); - Fl::handle(FL_FOCUS, win); - fl_find(fl_xid(win)); + if (win) { + Fl::handle(FL_FOCUS, win); + fl_find(fl_xid(win)); + } } struct key_repeat_data_t { -- cgit v1.2.3