From dcd61d75485405fa8f1663f2cb8504abae9c3bd1 Mon Sep 17 00:00:00 2001 From: Maxim Kartashev Date: Wed, 12 Feb 2025 19:42:34 +0400 Subject: [PATCH] JBR-8234 IDE cannot start on Wayland with large scale Make sure the surface used for the cursor is marked as such prior to being committed in order to receive an exception from enforcing the rule about the buffer size having to be multiple of its scale. --- src/java.desktop/unix/native/libawt_wlawt/WLCursor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/unix/native/libawt_wlawt/WLCursor.c b/src/java.desktop/unix/native/libawt_wlawt/WLCursor.c index f032b65a6c7a..40f5e9442c39 100644 --- a/src/java.desktop/unix/native/libawt_wlawt/WLCursor.c +++ b/src/java.desktop/unix/native/libawt_wlawt/WLCursor.c @@ -166,12 +166,12 @@ JNIEXPORT void JNICALL Java_sun_awt_wl_WLToolkit_nativeSetCursor wl_cursor_surface = wl_compositor_create_surface(wl_compositor); CHECK_NULL(wl_cursor_surface); + wl_pointer_set_cursor(wl_pointer, pointerEnterSerial, wl_cursor_surface, + hotspot_x / scale, hotspot_y / scale); wl_surface_attach(wl_cursor_surface, buffer, 0, 0); wl_surface_set_buffer_scale(wl_cursor_surface, scale); wl_surface_damage_buffer(wl_cursor_surface, 0, 0, width, height); - wl_surface_commit(wl_cursor_surface); - wl_pointer_set_cursor(wl_pointer, pointerEnterSerial, wl_cursor_surface, - hotspot_x / scale, hotspot_y / scale); + wl_surface_commit(wl_cursor_surface); wlFlushToServer(env); }