summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-10-23 12:19:44 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-10-23 12:19:44 +0200
commite69d45cde88373a32b580745aafae93529a5cc73 (patch)
treeb0671a3bf097505d6118599826bfb52e298545d2 /src/drivers
parentc7ffd8e72a3c8ffe12ec546824df48b95bdf790f (diff)
Make Fl::display(const char *) active also for the Wayland platform.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.H1
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx6
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.cxx4
4 files changed, 7 insertions, 5 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
index 28e5f3655..e55531509 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
@@ -148,6 +148,7 @@ public:
virtual int get_mouse(int &x, int &y);
virtual void open_display_platform();
virtual void close_display();
+ virtual void display(const char *d);
// --- compute dimensions of an Fl_Offscreen
virtual void offscreen_size(Fl_Offscreen o, int &width, int &height);
virtual int has_marked_text() const;
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index ec93f1fa9..0f2f24ee0 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1492,6 +1492,12 @@ void Fl_Wayland_Screen_Driver::reset_spot() {
}
+void Fl_Wayland_Screen_Driver::display(const char *d)
+{
+ if (d) ::setenv("WAYLAND_DISPLAY", d, 1);
+}
+
+
struct wl_display *fl_wl_display() {
if (!Fl_Wayland_Screen_Driver::wl_display || !Fl_Wayland_Screen_Driver::wl_registry) return NULL;
return Fl_Wayland_Screen_Driver::wl_display;
diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H
index a5347d74d..6e94bf44b 100644
--- a/src/drivers/X11/Fl_X11_System_Driver.H
+++ b/src/drivers/X11/Fl_X11_System_Driver.H
@@ -28,7 +28,6 @@ public:
key_table = NULL;
key_table_size = 0;
}
- virtual void display_arg(const char *arg);
virtual int XParseGeometry(const char*, int*, int*, unsigned int*, unsigned int*);
// these 2 are in Fl_get_key.cxx
virtual int event_key(int k);
diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx
index d3a81c745..4eebee27a 100644
--- a/src/drivers/X11/Fl_X11_System_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -70,10 +70,6 @@ extern "C" {
#endif
-void Fl_X11_System_Driver::display_arg(const char *arg) {
- Fl::display(arg);
-}
-
int Fl_X11_System_Driver::XParseGeometry(const char* string, int* x, int* y,
unsigned int* width, unsigned int* height) {
return ::XParseGeometry(string, x, y, width, height);