aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mac.m17
-rw-r--r--src/win.c16
-rw-r--r--src/x11.c6
3 files changed, 30 insertions, 9 deletions
diff --git a/src/mac.m b/src/mac.m
index f93f80c..ab8ea68 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1672,6 +1672,19 @@ puglGetClipboard(PuglView* const view,
}
static NSCursor*
+extendedCursor(const SEL cursorSelector)
+{
+ if (cursorSelector && [NSCursor respondsToSelector:cursorSelector]) {
+ const id object = [NSCursor performSelector:cursorSelector];
+ if ([object isKindOfClass:[NSCursor class]]) {
+ return (NSCursor*)object;
+ }
+ }
+
+ return NULL;
+}
+
+static NSCursor*
puglGetNsCursor(const PuglCursor cursor)
{
switch (cursor) {
@@ -1689,6 +1702,10 @@ puglGetNsCursor(const PuglCursor cursor)
return [NSCursor resizeLeftRightCursor];
case PUGL_CURSOR_UP_DOWN:
return [NSCursor resizeUpDownCursor];
+ case PUGL_CURSOR_UP_LEFT_DOWN_RIGHT:
+ return extendedCursor(@selector(_windowResizeNorthWestSouthEastCursor));
+ case PUGL_CURSOR_UP_RIGHT_DOWN_LEFT:
+ return extendedCursor(@selector(_windowResizeNorthEastSouthWestCursor));
}
return NULL;
diff --git a/src/win.c b/src/win.c
index 75915d7..639f200 100644
--- a/src/win.c
+++ b/src/win.c
@@ -1295,13 +1295,15 @@ puglPaste(PuglView* const view)
}
static const char* const cursor_ids[] = {
- IDC_ARROW, // ARROW
- IDC_IBEAM, // CARET
- IDC_CROSS, // CROSSHAIR
- IDC_HAND, // HAND
- IDC_NO, // NO
- IDC_SIZEWE, // LEFT_RIGHT
- IDC_SIZENS, // UP_DOWN
+ IDC_ARROW, // ARROW
+ IDC_IBEAM, // CARET
+ IDC_CROSS, // CROSSHAIR
+ IDC_HAND, // HAND
+ IDC_NO, // NO
+ IDC_SIZEWE, // LEFT_RIGHT
+ IDC_SIZENS, // UP_DOWN
+ IDC_SIZENWSE, // UP_LEFT_DOWN_RIGHT
+ IDC_SIZENESW, // UP_RIGHT_DOWN_LEFT
};
PuglStatus
diff --git a/src/x11.c b/src/x11.c
index b6b6695..ac4950d 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -66,7 +66,7 @@ enum WmClientStateMessageAction {
WM_STATE_TOGGLE
};
-#define NUM_CURSORS ((unsigned)PUGL_CURSOR_UP_DOWN + 1U)
+#define NUM_CURSORS ((unsigned)PUGL_CURSOR_UP_RIGHT_DOWN_LEFT + 1U)
#ifdef HAVE_XCURSOR
static const char* const cursor_names[NUM_CURSORS] = {
@@ -76,7 +76,9 @@ static const char* const cursor_names[NUM_CURSORS] = {
"pointer", // HAND
"not-allowed", // NO
"sb_h_double_arrow", // LEFT_RIGHT
- "sb_v_double_arrow" // UP_DOWN
+ "sb_v_double_arrow", // UP_DOWN
+ "size_fdiag", // UP_LEFT_DOWN_RIGHT
+ "size_bdiag", // UP_RIGHT_DOWN_LEFT
};
#endif