From: Po Lu Date: Wed, 2 Nov 2022 10:27:16 +0000 (+0800) Subject: Improve commentary in some parts of xterm.c X-Git-Tag: emacs-29.0.90~1616^2~349 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5d4c29a7fac505254576515704f7943afad18b3;p=emacs.git Improve commentary in some parts of xterm.c * src/xterm.c (x_probe_xfixes_extension): Rename to `x_fixes_pointer_blanking_supported', as fixes is now used for selection tracking as well. All callers changed. (x_focus_changed): Document where this code is used. --- diff --git a/src/xterm.c b/src/xterm.c index bd60a04c6cd..17ff35a6712 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11414,15 +11414,18 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame) x_frame_rehighlight (dpyinfo); } +#ifdef HAVE_XFIXES + /* True if the display in DPYINFO supports a version of Xfixes sufficient for pointer blanking. */ -#ifdef HAVE_XFIXES + static bool -x_probe_xfixes_extension (struct x_display_info *dpyinfo) +x_fixes_pointer_blanking_supported (struct x_display_info *dpyinfo) { return (dpyinfo->xfixes_supported_p && dpyinfo->xfixes_major >= 4); } + #endif /* HAVE_XFIXES */ /* Toggle mouse pointer visibility on frame F using the XFixes @@ -11493,7 +11496,7 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) /* But if Xfixes is available, try using it instead. */ if (dpyinfo->invisible_cursor == None) { - if (x_probe_xfixes_extension (dpyinfo)) + if (x_fixes_pointer_blanking_supported (dpyinfo)) { dpyinfo->fixes_pointer_blanking = true; xfixes_toggle_visible_pointer (f, invisible); @@ -11521,7 +11524,7 @@ XTtoggle_invisible_pointer (struct frame *f, bool invisible) block_input (); #ifdef HAVE_XFIXES if (FRAME_DISPLAY_INFO (f)->fixes_pointer_blanking - && x_probe_xfixes_extension (FRAME_DISPLAY_INFO (f))) + && x_fixes_pointer_blanking_supported (FRAME_DISPLAY_INFO (f))) xfixes_toggle_visible_pointer (f, invisible); else #endif @@ -11529,13 +11532,16 @@ XTtoggle_invisible_pointer (struct frame *f, bool invisible) unblock_input (); } -/* Handle FocusIn and FocusOut state changes for FRAME. - If FRAME has focus and there exists more than one frame, puts - a FOCUS_IN_EVENT into *BUFP. */ +/* Handle FocusIn and FocusOut state changes for FRAME. If FRAME has + focus and there exists more than one frame, puts a FOCUS_IN_EVENT + into *BUFP. Note that this code is not used to handle focus + changes on builds that can use the X Input extension for handling + input focus when it is available (currently the no toolkit and GTK + 3 toolkits). */ static void -x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct frame *frame, - struct input_event *bufp) +x_focus_changed (int type, int state, struct x_display_info *dpyinfo, + struct frame *frame, struct input_event *bufp) { if (type == FocusIn) {