FLTK logo

[master] d971f6f - Simpler, compositor-independent procedure to map GL window 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] d971f6f - Simpler, compositor-independent procedure to map GL window under Wayland. "ManoloFLTK" May 23, 2022  
 
commit d971f6f59f966a0be31baa6d07c7f179cf0712db
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon May 23 19:45:12 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon May 23 19:45:12 2022 +0200

    Simpler, compositor-independent procedure to map GL window under Wayland.

 .../Wayland/Fl_Wayland_Gl_Window_Driver.cxx        | 23 ++--------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index dc35dc3..d674884 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -217,16 +217,6 @@ void Fl_Wayland_Gl_Window_Driver::redraw_overlay() {
 }
 
 
-static void gl_frame_ready(void *data, struct wl_callback *cb, uint32_t time) {
-  *(bool*)data = true;
-}
-
-
-static const struct wl_callback_listener gl_surface_frame_listener = {
-  .done = gl_frame_ready,
-};
-
-
 void Fl_Wayland_Gl_Window_Driver::make_current_before() {
   if (!egl_window) {
     struct wld_window *win = fl_xid(pWindow);
@@ -241,20 +231,11 @@ 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);
-//TODO It's still not entirely clear how to map a GL window
-// in a compositor-independent way.
-    bool done = false;
-    bool special = (Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::unspecified);
-    if (!special) {
-      struct wl_callback *callback = wl_surface_frame(surface);
-      wl_surface_commit(surface);
-      wl_callback_add_listener(callback, &gl_surface_frame_listener, &done);
-    }
+//TODO It's still not entirely clear how to justify the value 5 below
     int count = 0;
-    while (!done && count < 5) {
+    while (count++ < 5) {
       wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
       eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
-      if (special) count++;
     }
   }
 }
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'.