FLTK logo

[master] 6efdcb1 - Simpler code to map GL windows under Wayland.

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] 6efdcb1 - Simpler code to map GL windows under Wayland. "ManoloFLTK" May 15, 2022  
 
commit 6efdcb1e6fa19660de090f04ad50a5402403a947
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun May 15 09:04:47 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun May 15 09:04:47 2022 +0200

    Simpler code to map GL windows under Wayland.

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

diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
index 7110a8e..8a1c4ab 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
@@ -36,7 +36,6 @@ 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 67ad43b..7cc646a 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -56,7 +56,6 @@ 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;
 }
 
 
@@ -242,12 +241,13 @@ 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 (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);
-      wl_callback_add_listener(callback, &gl_surface_frame_listener, &done);
-      while (!done) wl_display_dispatch(Fl_Wayland_Screen_Driver::wl_display);
+    bool done = false;
+    struct wl_callback *callback = wl_surface_frame(surface);
+    wl_surface_commit(surface);
+    wl_callback_add_listener(callback, &gl_surface_frame_listener, &done);
+    while (!done) {
+      wl_display_dispatch(Fl_Wayland_Screen_Driver::wl_display);
+      eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
     }
   }
 }
@@ -308,9 +308,8 @@ 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_resize_in_progress || pWindow->parent() || !swap_done) {
+    if (!egl_resize_in_progress || pWindow->parent()) {
        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'.