summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMennoMax <mennomax@outlook.de>2020-02-10 01:52:19 +0100
committerMennoMax <mennomax@outlook.de>2020-02-10 01:52:19 +0100
commita9946b95153a58218a444faf45e33a1ae917408f (patch)
tree2f7baf11b413b71a7f0f82de0094488cc3c7fd0e
parent3bd3462d6150f3189278fd6303348bf527affc69 (diff)
adjusted linux cursors, added fallbacks
-rw-r--r--platform/x11/os_x11.cpp68
1 files changed, 61 insertions, 7 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 55a612eb37..ff59bf9ac1 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -526,19 +526,73 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
"watch",
"left_ptr_watch",
"fleur",
- "hand1",
- "X_cursor",
- "sb_v_double_arrow",
- "sb_h_double_arrow",
+ "dnd-move",
+ "crossed_circle",
+ "v_double_arrow",
+ "h_double_arrow",
"size_bdiag",
"size_fdiag",
- "hand1",
- "sb_v_double_arrow",
- "sb_h_double_arrow",
+ "move",
+ "row_resize",
+ "col_resize",
"question_arrow"
};
img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size);
+ if (!img[i]) {
+ const char *fallback = NULL;
+
+ switch (i) {
+ case CURSOR_POINTING_HAND:
+ fallback = "pointer";
+ break;
+ case CURSOR_CROSS:
+ fallback = "crosshair";
+ break;
+ case CURSOR_WAIT:
+ fallback = "wait";
+ break;
+ case CURSOR_BUSY:
+ fallback = "progress";
+ break;
+ case CURSOR_DRAG:
+ fallback = "grabbing";
+ break;
+ case CURSOR_CAN_DROP:
+ fallback = "hand1";
+ break;
+ case CURSOR_FORBIDDEN:
+ fallback = "forbidden";
+ break;
+ case CURSOR_VSIZE:
+ fallback = "ns-resize";
+ break;
+ case CURSOR_HSIZE:
+ fallback = "ew-resize";
+ break;
+ case CURSOR_BDIAGSIZE:
+ fallback = "fd_double_arrow";
+ break;
+ case CURSOR_FDIAGSIZE:
+ fallback = "bd_double_arrow";
+ break;
+ case CURSOR_MOVE:
+ img[i] = img[CURSOR_DRAG];
+ break;
+ case CURSOR_VSPLIT:
+ fallback = "sb_v_double_arrow";
+ break;
+ case CURSOR_HSPLIT:
+ fallback = "sb_h_double_arrow";
+ break;
+ case CURSOR_HELP:
+ fallback = "help";
+ break;
+ }
+ if (fallback != NULL) {
+ img[i] = XcursorLibraryLoadImage(fallback, cursor_theme, cursor_size);
+ }
+ }
if (img[i]) {
cursors[i] = XcursorImageLoadCursor(x11_display, img[i]);
} else {