From: Po Lu Date: Sun, 8 May 2022 06:33:34 +0000 (+0800) Subject: Improve handling of invisible cursor alloc failures X-Git-Tag: emacs-29.0.90~1910^2~912 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1a988d9ff55c098ddee0c79afcccbdc63e7c680e;p=emacs.git Improve handling of invisible cursor alloc failures * src/xterm.c (x_toggle_visible_pointer): Use Xfixes if cursor allocation really fails. This happens when the X server has a limit on the number of cursors that can be created. --- diff --git a/src/xterm.c b/src/xterm.c index 2fc4c559a9c..a7f0f3d7efa 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9452,8 +9452,21 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) if (dpyinfo->invisible_cursor == None) dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo); +#ifndef HAVE_XFIXES if (dpyinfo->invisible_cursor == None) invisible = false; +#else + /* But if Xfixes is available, try using it instead. */ + if (x_probe_xfixes_extension (dpyinfo)) + { + dpyinfo->fixes_pointer_blanking = true; + xfixes_toggle_visible_pointer (f, invisible); + + return; + } + else + invisible = false; +#endif if (invisible) XDefineCursor (dpyinfo->display, FRAME_X_WINDOW (f),