Wayland: Load a bigger cursor theme for HiDPI

This commit is contained in:
Emmanuel Gil Peyrot 2018-09-11 14:18:52 +02:00 committed by linkmauve
parent 5ea6e6cda2
commit 321062833a
2 changed files with 5 additions and 0 deletions

View File

@ -1067,6 +1067,8 @@ int _glfwPlatformInit(void)
"Wayland: Unable to load default cursor theme"); "Wayland: Unable to load default cursor theme");
return GLFW_FALSE; return GLFW_FALSE;
} }
// If this happens to be NULL, we just fallback to the scale=1 version.
_glfw.wl.cursorThemeHiDPI = wl_cursor_theme_load(NULL, 64, _glfw.wl.shm);
_glfw.wl.cursorSurface = _glfw.wl.cursorSurface =
wl_compositor_create_surface(_glfw.wl.compositor); wl_compositor_create_surface(_glfw.wl.compositor);
_glfw.wl.cursorTimerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); _glfw.wl.cursorTimerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC);
@ -1105,6 +1107,8 @@ void _glfwPlatformTerminate(void)
if (_glfw.wl.cursorTheme) if (_glfw.wl.cursorTheme)
wl_cursor_theme_destroy(_glfw.wl.cursorTheme); wl_cursor_theme_destroy(_glfw.wl.cursorTheme);
if (_glfw.wl.cursorThemeHiDPI)
wl_cursor_theme_destroy(_glfw.wl.cursorThemeHiDPI);
if (_glfw.wl.cursor.handle) if (_glfw.wl.cursor.handle)
{ {
_glfw_dlclose(_glfw.wl.cursor.handle); _glfw_dlclose(_glfw.wl.cursor.handle);

View File

@ -240,6 +240,7 @@ typedef struct _GLFWlibraryWayland
int seatVersion; int seatVersion;
struct wl_cursor_theme* cursorTheme; struct wl_cursor_theme* cursorTheme;
struct wl_cursor_theme* cursorThemeHiDPI;
struct wl_surface* cursorSurface; struct wl_surface* cursorSurface;
int cursorTimerfd; int cursorTimerfd;
uint32_t pointerSerial; uint32_t pointerSerial;