FLTK logo

[master] 905a90f - Make Fl_Wayland_Screen_Driver::close_display() close the GL connection if any.

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] 905a90f - Make Fl_Wayland_Screen_Driver::close_display() close the GL connection if any. "ManoloFLTK" May 17, 2022  
 
commit 905a90f660e12391f3692402cb661f5efaa3218a
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue May 17 12:11:18 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue May 17 12:11:18 2022 +0200

    Make Fl_Wayland_Screen_Driver::close_display() close the GL connection if any.

 src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H   | 1 +
 src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 5 +++++
 src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx    | 4 ++++
 src/drivers/Wayland/Fl_Wayland_Window_Driver.H      | 1 +
 4 files changed, 11 insertions(+)

diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
index 8a1c4ab..80f9197 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
@@ -35,6 +35,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 *);
+  friend class Fl_Wayland_Gl_Plugin;
   bool egl_resize_in_progress;
   Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win);
   virtual float pixels_per_unit();
diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 7cc646a..f4e6fbf 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -327,6 +327,11 @@ public:
   virtual void invalidate(Fl_Window *w) {
     w->as_gl_window()->valid(0);
   }
+  virtual void terminate() {
+    if (Fl_Wayland_Gl_Window_Driver::egl_display != EGL_NO_DISPLAY) {
+      eglTerminate(Fl_Wayland_Gl_Window_Driver::egl_display);
+    }
+  }
 };
 
 static Fl_Wayland_Gl_Plugin Gl_Overlay_Plugin;
diff --git src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 27512a4..efa8779 100644
--- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1098,6 +1098,10 @@ void Fl_Wayland_Screen_Driver::open_display_platform() {
 }
 
 void Fl_Wayland_Screen_Driver::close_display() {
+  Fl_Plugin_Manager pm("wayland.fltk.org");
+  Fl_Wayland_Plugin *plugin = (Fl_Wayland_Plugin*)pm.plugin("gl.wayland.fltk.org");
+  if (plugin) plugin->terminate();
+
   Fl::remove_fd(wl_display_get_fd(Fl_Wayland_Screen_Driver::wl_display));
   wl_display_disconnect(Fl_Wayland_Screen_Driver::wl_display);
   Fl_Wayland_Screen_Driver::wl_display = NULL;
diff --git src/drivers/Wayland/Fl_Wayland_Window_Driver.H src/drivers/Wayland/Fl_Wayland_Window_Driver.H
index 4fdcd95..faa45b6 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.H
+++ src/drivers/Wayland/Fl_Wayland_Window_Driver.H
@@ -155,6 +155,7 @@ public:
   virtual const char *name() = 0;
   virtual void do_swap(Fl_Window*) = 0;
   virtual void invalidate(Fl_Window*) = 0;
+  virtual void terminate() = 0;
 };
 
 #endif // FL_WAYLAND_WINDOW_DRIVER_H
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'.