diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-05-17 12:11:18 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-05-17 12:11:18 +0200 |
| commit | 905a90f660e12391f3692402cb661f5efaa3218a (patch) | |
| tree | 6525824a113742d3b153e06a81ec0fb2645bbd4e /src | |
| parent | f01216f167bad1ad2efff1c351c9d310ef1104a2 (diff) | |
Make Fl_Wayland_Screen_Driver::close_display() close the GL connection if any.
Diffstat (limited to 'src')
4 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H index 8a1c4abc2..80f91970c 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H +++ b/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 a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx index 7cc646ab2..f4e6fbff0 100644 --- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx +++ b/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 a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 27512a43e..efa8779cf 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/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 a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H index 4fdcd957b..faa45b6fa 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H +++ b/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 |
