emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1a988d9ff5: Improve handling of invisible cursor alloc failures


From: Po Lu
Subject: master 1a988d9ff5: Improve handling of invisible cursor alloc failures
Date: Sun, 8 May 2022 02:33:48 -0400 (EDT)

branch: master
commit 1a988d9ff55c098ddee0c79afcccbdc63e7c680e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 2fc4c559a9..a7f0f3d7ef 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),



reply via email to

[Prev in Thread] Current Thread [Next in Thread]