From f5879ae2283404e48aeca218f896b746eb973468 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:05:46 +0200 Subject: Slight simplification of Fl_Wayland_Gl_Window_Driver::swap_buffers() Also, reorder members of class Fl_Wayland_Gl_Window_Driver --- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H | 9 +++++---- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 6 +----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H index 64248bfdb..5506ad5eb 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H @@ -35,6 +35,11 @@ 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 *); friend class Fl_Wayland_Gl_Plugin; +private: + static EGLDisplay egl_display; + static EGLint configs_count; + struct wl_egl_window *egl_window; + EGLSurface egl_surface; bool egl_swap_in_progress; Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win); float pixels_per_unit() FL_OVERRIDE; @@ -52,11 +57,7 @@ class Fl_Wayland_Gl_Window_Driver : public Fl_Gl_Window_Driver { void gl_start() FL_OVERRIDE; void gl_visual(Fl_Gl_Choice *c) FL_OVERRIDE; char *alpha_mask_for_string(const char *str, int n, int w, int h, Fl_Fontsize fs) FL_OVERRIDE; - static EGLDisplay egl_display; - static EGLint configs_count; void init(); - struct wl_egl_window *egl_window; - EGLSurface egl_surface; public: //virtual bool need_scissor() { return true; } // CONTROL_LEAKING_SUB_GL_WINDOWS //void apply_scissor(); // CONTROL_LEAKING_SUB_GL_WINDOWS diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 9ff150461..83912582b 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx @@ -358,11 +358,7 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() { if (egl_surface && !egl_swap_in_progress) { egl_swap_in_progress = true; // prevents crash while down resizing rotating glpuzzle - while (wl_display_prepare_read(Fl_Wayland_Screen_Driver::wl_display) != 0) { - wl_display_dispatch_pending(Fl_Wayland_Screen_Driver::wl_display); - } - wl_display_flush(Fl_Wayland_Screen_Driver::wl_display); - wl_display_read_events(Fl_Wayland_Screen_Driver::wl_display); + wl_display_dispatch_pending(Fl_Wayland_Screen_Driver::wl_display); eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface); egl_swap_in_progress = false; } -- cgit v1.2.3