summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-05-11 18:42:07 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-05-11 18:42:07 +0200
commit37abac2d8e3d4b3d810554dfd965f367be706c18 (patch)
treebab5b85aa55198519ff53b62e46b5e781fb60bbe /src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
parent4fb18ffbddfb1c6e5b90e42e6bfcd79117597f90 (diff)
Wayland: fix opening GL top-level window on 2-screen system
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index fe8e75e0a..afcfd5d7d 100644
--- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -411,7 +411,9 @@ void Fl_Wayland_Gl_Window_Driver::resize(int is_a_resize, int W, int H) {
wl_egl_window_get_attached_size(egl_window, &W2, &H2);
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);
+ //fprintf(stderr, "Fl_Wayland_Gl_Window_Driver::resize from %dx%d to %dx%d\n",
+ // W2, H2, W, H);
+ Fl::wait(0);
}
/* CONTROL_LEAKING_SUB_GL_WINDOWS
if (Fl_Wayland_Window_Driver::driver(pWindow)->subRect()) {
@@ -430,9 +432,6 @@ void Fl_Wayland_Gl_Window_Driver::gl_visual(Fl_Gl_Choice *c) {
wld_egl_conf = ((Fl_Wayland_Gl_Choice*)c)->egl_conf;
}
-static void delayed_redraw(Fl_Window *win) {
- win->redraw();
-}
void Fl_Wayland_Gl_Window_Driver::gl_start() {
float f = Fl::screen_scale(Fl_Window::current()->screen_num());
@@ -443,7 +442,7 @@ void Fl_Wayland_Gl_Window_Driver::gl_start() {
wl_egl_window_get_attached_size(dr->gl_start_support_->egl_window, &W2, &H2);
if (W2 != W || H2 != H) {
wl_egl_window_resize(dr->gl_start_support_->egl_window, W, H, 0, 0);
- Fl::add_timeout(0.01, (Fl_Timeout_Handler)delayed_redraw, Fl_Window::current());
+ Fl::wait(0);
}
glClearColor(0., 0., 0., 0.);
glClear(GL_COLOR_BUFFER_BIT);