summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.zig15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 2abf9166..46d2cc78 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -2367,12 +2367,23 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, attach: ?[]const u
defer c.SDL_DestroyWindow(window);
updateDisplayScale(window);
if (native_wayland) log.info("Wayland opacity: background-only transparent surface", .{});
- const arrow_cursor = c.SDL_CreateCursor(&p9_arrow_set, &p9_arrow_mask, 16, 16, 1, 1);
+ // On Linux the desktop's own cursor theme draws them (the compositor's
+ // cursor-shape protocol, else XCURSOR_THEME), at its size and scale:
+ // the arrow is its default, acme's box its move, as the plan9 theme
+ // has them. Elsewhere acme's bitmaps, at 16 pixels.
+ const themed_cursors = builtin.os.tag == .linux;
+ const arrow_cursor = if (themed_cursors)
+ c.SDL_CreateSystemCursor(c.SDL_SYSTEM_CURSOR_DEFAULT)
+ else
+ c.SDL_CreateCursor(&p9_arrow_set, &p9_arrow_mask, 16, 16, 1, 1);
defer if (arrow_cursor) |cursor| c.SDL_DestroyCursor(cursor);
const link_cursor = c.SDL_CreateSystemCursor(c.SDL_SYSTEM_CURSOR_POINTER);
defer if (link_cursor) |cursor| c.SDL_DestroyCursor(cursor);
// Its hot spot the middle, as acme's {-7, -7} offset puts it.
- const box_cursor = c.SDL_CreateCursor(&p9_box_set, &p9_box_mask, 16, 16, 7, 7);
+ const box_cursor = if (themed_cursors)
+ c.SDL_CreateSystemCursor(c.SDL_SYSTEM_CURSOR_MOVE)
+ else
+ c.SDL_CreateCursor(&p9_box_set, &p9_box_mask, 16, 16, 7, 7);
defer if (box_cursor) |cursor| c.SDL_DestroyCursor(cursor);
if (arrow_cursor) |cur| {
_ = c.SDL_SetCursor(cur);