summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_System_Driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_System_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_System_Driver.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_System_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_System_Driver.cxx
index 4b26a17ea..7c3cf9aa8 100644
--- a/src/drivers/Wayland/Fl_Wayland_System_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_System_Driver.cxx
@@ -88,3 +88,21 @@ void *Fl_Wayland_System_Driver::control_maximize_button(void *data) {
return NULL;
}
}
+
+
+void Fl_Wayland_System_Driver::disable_wayland() {
+ if (fl_wl_display()) {
+ fprintf(stderr, "Error: fl_disable_wayland() cannot be called "
+ "after the Wayland display was opened\n");
+ exit(1);
+ }
+
+ if (Fl_Wayland_Screen_Driver::wl_display) {
+ wl_display_disconnect(Fl_Wayland_Screen_Driver::wl_display);
+ Fl_Wayland_Screen_Driver::wl_display = NULL;
+ delete Fl_Screen_Driver::system_driver;
+ Fl_Screen_Driver::system_driver = NULL;
+ }
+ Fl_Wayland_Screen_Driver::wld_disabled = true;
+ Fl::system_driver();
+}