FLTK logo

[master] ad27da5 - Avoid glpuzzle crash when resizing while puzzle is spinning - cont'd.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] ad27da5 - Avoid glpuzzle crash when resizing while puzzle is spinning - cont'd. "ManoloFLTK" May 09, 2022  
 
commit ad27da578a952548dd16f8be4bbd871fccc423c7
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon May 9 19:56:17 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon May 9 19:56:17 2022 +0200

    Avoid glpuzzle crash when resizing while puzzle is spinning - cont'd.

 src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H   | 1 +
 src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 9 ++++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
index 8a1c4ab..7110a8e 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
@@ -36,6 +36,7 @@ Consequently, FL_DOUBLE is enforced in all Fl_Gl_Window::mode_ values under Wayl
 class Fl_Wayland_Gl_Window_Driver : public Fl_Gl_Window_Driver {
   friend Fl_Gl_Window_Driver* Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *);
   bool egl_resize_in_progress;
+  bool swap_done;
   Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win);
   virtual float pixels_per_unit();
   virtual void make_current_before();
diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 8165152..6868162 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -56,6 +56,7 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
   egl_window = NULL;
   egl_surface = NULL;
   egl_resize_in_progress = false;
+  swap_done = false;
 }
 
 
@@ -307,11 +308,9 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() {
       wl_display_read_events(Fl_Wayland_Screen_Driver::wl_display);
       wl_display_dispatch_queue_pending(Fl_Wayland_Screen_Driver::wl_display,  gl_event_queue);
     }
-    if (!egl_window) return;
-    int W = 0, H;
-    if (!pWindow->parent()) wl_egl_window_get_attached_size(egl_window, &W, &H);
-    if (!egl_resize_in_progress ||  W == 0) {
-      eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
+    if (!egl_resize_in_progress || pWindow->parent() || !swap_done) {
+       eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
+       swap_done = true;
     }
     egl_resize_in_progress = false;
   }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.