diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.H | 6 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 17 | ||||
| -rw-r--r-- | src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx (renamed from src/drivers/Wayland/Fl_wayland.cxx) | 28 |
3 files changed, 22 insertions, 29 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H index ce10884c5..0ce25734f 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H @@ -150,11 +150,11 @@ public: virtual int has_marked_text() const; static int next_marked_length; // next length of marked text after current marked text will have been replaced // --- clipboard operations - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual void copy(const char *stuff, int len, int clipboard, const char *type); - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual int clipboard_contains(const char *type); // --- Wayland-special void set_cursor(); diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 71a14ca22..84b2c8c91 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -1426,3 +1426,20 @@ char *Fl_Wayland_Screen_Driver::get_seat_name() { struct xkb_keymap *Fl_Wayland_Screen_Driver::get_xkb_keymap() { return seat->xkb_keymap; } + + +int Fl_Wayland_Screen_Driver::get_mouse_unscaled(int &mx, int &my) { + open_display(); + mx = Fl::e_x_root; my = Fl::e_y_root; + int screen = screen_num_unscaled(mx, my); + return screen >= 0 ? screen : 0; +} + + +int Fl_Wayland_Screen_Driver::get_mouse(int &xx, int &yy) { + int snum = get_mouse_unscaled(xx, yy); + float s = scale(snum); + xx = xx/s; + yy = yy/s; + return snum; +} diff --git a/src/drivers/Wayland/Fl_wayland.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index f00a7d909..b6e921fc5 100644 --- a/src/drivers/Wayland/Fl_wayland.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -1,7 +1,7 @@ // -// Wayland specific code for the Fast Light Tool Kit (FLTK). +// Wayland-specific code for clipboard and drag-n-drop support. // -// Copyright 1998-2021 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -33,30 +33,6 @@ //////////////////////////////////////////////////////////////// - -Window fl_message_window = 0; -int fl_screen; -Window fl_xim_win = 0; -char fl_is_over_the_spot = 0; - - -int Fl_Wayland_Screen_Driver::get_mouse_unscaled(int &mx, int &my) { - open_display(); - mx = Fl::e_x_root; my = Fl::e_y_root; - int screen = screen_num_unscaled(mx, my); - return screen >= 0 ? screen : 0; -} - - -int Fl_Wayland_Screen_Driver::get_mouse(int &xx, int &yy) { - int snum = get_mouse_unscaled(xx, yy); - float s = scale(snum); - xx = xx/s; - yy = yy/s; - return snum; -} - -//////////////////////////////////////////////////////////////// // Code used for copy and paste and DnD into the program: //static Window fl_dnd_source_window; |
