summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-07 09:02:22 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-07 09:02:22 +0100
commit38536d8918c6ca49c16adcde5ff33379fb5b3b13 (patch)
tree99364c08d4e063ef1768728def1003ac448ffc09 /src/drivers
parent089584da9f3a984d794cb045a15f13414ea6a05f (diff)
Fix initialisation of hybrid Wayland/X11 platform
Also, terminate Wayland drag-and-drop operation after Fl::pushed(0).
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx2
-rw-r--r--src/drivers/Wayland/fl_wayland_platform_init.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx
index 12ec62c51..38484f135 100644
--- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx
+++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx
@@ -76,7 +76,7 @@ void write_data_source_cb(FL_SOCKET fd, data_source_write_struct *data) {
static void data_source_handle_send(void *data, struct wl_data_source *source, const char *mime_type, int fd) {
fl_intptr_t rank = (fl_intptr_t)data;
//fprintf(stderr, "data_source_handle_send: %s fd=%d l=%d\n", mime_type, fd, fl_selection_length[1]);
- if (!Fl::pushed()) { close(fd); }
+ if (!Fl::pushed()) { close(fd); wl_data_source_destroy(source); }
else if (strcmp(mime_type, wld_plain_text_clipboard) == 0 || strcmp(mime_type, "text/plain") == 0 || strcmp(mime_type, "image/bmp") == 0) {
data_source_write_struct *write_data = new data_source_write_struct;
write_data->rest = fl_selection_length[rank];
diff --git a/src/drivers/Wayland/fl_wayland_platform_init.cxx b/src/drivers/Wayland/fl_wayland_platform_init.cxx
index 01d49ccb5..9173150e2 100644
--- a/src/drivers/Wayland/fl_wayland_platform_init.cxx
+++ b/src/drivers/Wayland/fl_wayland_platform_init.cxx
@@ -134,9 +134,9 @@ Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int
Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() {
-#if FLTK_USE_X11
if (!Fl_Screen_Driver::system_driver) Fl::system_driver();
- if (Fl_Wayland_Screen_Driver::wl_display) {
+#if FLTK_USE_X11
+ if (attempt_wayland()) {
return new Fl_Wayland_Screen_Driver();
}
@@ -162,7 +162,7 @@ Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
Fl_Image_Surface_Driver *Fl_Image_Surface_Driver::newImageSurfaceDriver(int w, int h, int high_res, Fl_Offscreen off)
{
#if FLTK_USE_X11
- if (!Fl_Wayland_Screen_Driver::wl_display)
+ if (!attempt_wayland())
return new Fl_Xlib_Image_Surface_Driver(w, h, high_res, off);
#endif
return new Fl_Wayland_Image_Surface_Driver(w, h, high_res, off);