summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-17 09:52:22 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-17 09:52:34 +0100
commite84a1730ad77e336ff8d30f248be04dc053905e8 (patch)
tree4774e88706205f6ecb4a19a1ae8fedd47d906798 /src
parent89874f4f85fe1a3008d53bf0878de21472fcd8ff (diff)
Wayland: improve and document support of FL_CURSOR_NONE
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx4
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx16
2 files changed, 6 insertions, 14 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 0b8ee348a..281724e9a 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1450,7 +1450,9 @@ struct wl_cursor *Fl_Wayland_Screen_Driver::cache_cursor(const char *cursor_name
}
void Fl_Wayland_Screen_Driver::reset_cursor() {
- xc_arrow = xc_ns = xc_wait = xc_insert = xc_hand = xc_help = xc_cross = xc_move = xc_north = xc_south = xc_west = xc_east = xc_we = xc_nesw = xc_nwse = xc_sw = xc_se = xc_ne = xc_nw = NULL;
+ xc_arrow = xc_ns = xc_wait = xc_insert = xc_hand = xc_help = xc_cross = xc_move =
+ xc_north = xc_south = xc_west = xc_east = xc_we = xc_nesw = xc_nwse = xc_sw = xc_se =
+ xc_ne = xc_nw = xc_none = NULL;
}
uint32_t Fl_Wayland_Screen_Driver::get_serial() {
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 8eed14648..a23ae5653 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -22,8 +22,6 @@
#include <FL/filename.H>
#include <wayland-cursor.h>
#include "../../../libdecor/src/libdecor.h"
-#include "../../fl_cursor_none.xpm"
-#include "../../fl_cursor_help.xpm"
#include "xdg-shell-client-protocol.h"
#include <pango/pangocairo.h>
#include <FL/Fl_Overlay_Window.H>
@@ -1341,14 +1339,7 @@ int Fl_Wayland_Window_Driver::set_cursor(Fl_Cursor c) {
break;
case FL_CURSOR_HELP:
if (!scr_driver->xc_help) scr_driver->xc_help = scr_driver->cache_cursor("help");
- if (!scr_driver->xc_help) {
- const char **xpm = (const char**)fl_cursor_help_xpm;
- Fl_Pixmap pxm(xpm);
- Fl_RGB_Image image(&pxm);
- this->set_cursor(&image, 1, 3);
- scr_driver->xc_help = xid->custom_cursor;
- xid->custom_cursor = NULL;
- }
+ if (!scr_driver->xc_help) return 0;
scr_driver->default_cursor(scr_driver->xc_help);
break;
case FL_CURSOR_MOVE:
@@ -1413,9 +1404,8 @@ int Fl_Wayland_Window_Driver::set_cursor(Fl_Cursor c) {
break;
case FL_CURSOR_NONE:
if (!scr_driver->xc_none) {
- const char **xpm = (const char**)fl_cursor_none_xpm;
- Fl_Pixmap pxm(xpm);
- Fl_RGB_Image image(&pxm);
+ static const uchar pixel[] = {0, 0, 0, 0};
+ Fl_RGB_Image image(pixel, 1, 1, 4);
this->set_cursor(&image, 0, 0);
scr_driver->xc_none = xid->custom_cursor;
xid->custom_cursor = NULL;