diff options
| author | Po Lu | 2022-11-02 18:27:16 +0800 |
|---|---|---|
| committer | Po Lu | 2022-11-02 18:27:48 +0800 |
| commit | a5d4c29a7fac505254576515704f7943afad18b3 (patch) | |
| tree | dfbd2d2664174e13a69215d99831e98f8357faa6 /src | |
| parent | 840b9eadd6a06c939980bb8b90d8402128ea8901 (diff) | |
| download | emacs-a5d4c29a7fac505254576515704f7943afad18b3.tar.gz emacs-a5d4c29a7fac505254576515704f7943afad18b3.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 24 |
1 files changed, 15 insertions, 9 deletions
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) | |||
| 11414 | x_frame_rehighlight (dpyinfo); | 11414 | x_frame_rehighlight (dpyinfo); |
| 11415 | } | 11415 | } |
| 11416 | 11416 | ||
| 11417 | #ifdef HAVE_XFIXES | ||
| 11418 | |||
| 11417 | /* True if the display in DPYINFO supports a version of Xfixes | 11419 | /* True if the display in DPYINFO supports a version of Xfixes |
| 11418 | sufficient for pointer blanking. */ | 11420 | sufficient for pointer blanking. */ |
| 11419 | #ifdef HAVE_XFIXES | 11421 | |
| 11420 | static bool | 11422 | static bool |
| 11421 | x_probe_xfixes_extension (struct x_display_info *dpyinfo) | 11423 | x_fixes_pointer_blanking_supported (struct x_display_info *dpyinfo) |
| 11422 | { | 11424 | { |
| 11423 | return (dpyinfo->xfixes_supported_p | 11425 | return (dpyinfo->xfixes_supported_p |
| 11424 | && dpyinfo->xfixes_major >= 4); | 11426 | && dpyinfo->xfixes_major >= 4); |
| 11425 | } | 11427 | } |
| 11428 | |||
| 11426 | #endif /* HAVE_XFIXES */ | 11429 | #endif /* HAVE_XFIXES */ |
| 11427 | 11430 | ||
| 11428 | /* Toggle mouse pointer visibility on frame F using the XFixes | 11431 | /* Toggle mouse pointer visibility on frame F using the XFixes |
| @@ -11493,7 +11496,7 @@ x_toggle_visible_pointer (struct frame *f, bool invisible) | |||
| 11493 | /* But if Xfixes is available, try using it instead. */ | 11496 | /* But if Xfixes is available, try using it instead. */ |
| 11494 | if (dpyinfo->invisible_cursor == None) | 11497 | if (dpyinfo->invisible_cursor == None) |
| 11495 | { | 11498 | { |
| 11496 | if (x_probe_xfixes_extension (dpyinfo)) | 11499 | if (x_fixes_pointer_blanking_supported (dpyinfo)) |
| 11497 | { | 11500 | { |
| 11498 | dpyinfo->fixes_pointer_blanking = true; | 11501 | dpyinfo->fixes_pointer_blanking = true; |
| 11499 | xfixes_toggle_visible_pointer (f, invisible); | 11502 | xfixes_toggle_visible_pointer (f, invisible); |
| @@ -11521,7 +11524,7 @@ XTtoggle_invisible_pointer (struct frame *f, bool invisible) | |||
| 11521 | block_input (); | 11524 | block_input (); |
| 11522 | #ifdef HAVE_XFIXES | 11525 | #ifdef HAVE_XFIXES |
| 11523 | if (FRAME_DISPLAY_INFO (f)->fixes_pointer_blanking | 11526 | if (FRAME_DISPLAY_INFO (f)->fixes_pointer_blanking |
| 11524 | && x_probe_xfixes_extension (FRAME_DISPLAY_INFO (f))) | 11527 | && x_fixes_pointer_blanking_supported (FRAME_DISPLAY_INFO (f))) |
| 11525 | xfixes_toggle_visible_pointer (f, invisible); | 11528 | xfixes_toggle_visible_pointer (f, invisible); |
| 11526 | else | 11529 | else |
| 11527 | #endif | 11530 | #endif |
| @@ -11529,13 +11532,16 @@ XTtoggle_invisible_pointer (struct frame *f, bool invisible) | |||
| 11529 | unblock_input (); | 11532 | unblock_input (); |
| 11530 | } | 11533 | } |
| 11531 | 11534 | ||
| 11532 | /* Handle FocusIn and FocusOut state changes for FRAME. | 11535 | /* Handle FocusIn and FocusOut state changes for FRAME. If FRAME has |
| 11533 | If FRAME has focus and there exists more than one frame, puts | 11536 | focus and there exists more than one frame, puts a FOCUS_IN_EVENT |
| 11534 | a FOCUS_IN_EVENT into *BUFP. */ | 11537 | into *BUFP. Note that this code is not used to handle focus |
| 11538 | changes on builds that can use the X Input extension for handling | ||
| 11539 | input focus when it is available (currently the no toolkit and GTK | ||
| 11540 | 3 toolkits). */ | ||
| 11535 | 11541 | ||
| 11536 | static void | 11542 | static void |
| 11537 | x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct frame *frame, | 11543 | x_focus_changed (int type, int state, struct x_display_info *dpyinfo, |
| 11538 | struct input_event *bufp) | 11544 | struct frame *frame, struct input_event *bufp) |
| 11539 | { | 11545 | { |
| 11540 | if (type == FocusIn) | 11546 | if (type == FocusIn) |
| 11541 | { | 11547 | { |