You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When handling a cursor change event with an empty cursor_name (Chromium), try matching on the cursor's bitmap image before falling back to the default cursor
Copy file name to clipboardExpand all lines: gui-agent/vmside.c
+78-2Lines changed: 78 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@
44
44
#include<X11/XKBlib.h>
45
45
#include<X11/Xatom.h>
46
46
#include<X11/cursorfont.h>
47
+
#include<X11/Xcursor/Xcursor.h>
47
48
#include<qubes-gui-protocol.h>
48
49
#include<qubes-xorg-tray-defs.h>
49
50
#include"xdriver-shm-cmd.h"
@@ -420,6 +421,76 @@ static uint32_t find_cursor(Ghandles *g, Atom atom)
420
421
returnCURSOR_DEFAULT;
421
422
}
422
423
424
+
/*
425
+
* Some applications don't set cursor names properly when sending XfixesDisplayCursorNotify events, notably Chromium and derivatives.
426
+
* Before falling back to CURSOR_DEFAULT, we'll try to match (quick hashes of) the live cursor's bitmap with each supported cursor's bitmap.
427
+
* TODO: Precompute the hashes of supported_cursors once during init to avoid redundant computations everytime a cursor changes (this might not be trivial).
428
+
**/
429
+
430
+
// Generic Fowler-Noll-Vo quick hash function (FNV-1a), magic mix number from WikiPedia's entry
0 commit comments