diff options
| author | Po Lu | 2022-08-21 14:06:22 +0800 |
|---|---|---|
| committer | Po Lu | 2022-08-21 14:06:22 +0800 |
| commit | 8d4789c07273f5fdc9d3c1f06e357746a012b8dd (patch) | |
| tree | e9421f3b3918077719eefe5040057c0509539d36 /src | |
| parent | 07c04da01016cd81e064a06b2449892eff7c8da0 (diff) | |
| download | emacs-8d4789c07273f5fdc9d3c1f06e357746a012b8dd.tar.gz emacs-8d4789c07273f5fdc9d3c1f06e357746a012b8dd.zip | |
Minor optimization to x_query_pointer_1
* src/xterm.c (x_query_pointer_1): Clear client pointer if it
disappeared.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c index 39e5a8e1861..4f9b0b83b55 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -13442,10 +13442,20 @@ x_query_pointer_1 (struct x_display_info *dpyinfo, | |||
| 13442 | x_uncatch_errors_after_check (); | 13442 | x_uncatch_errors_after_check (); |
| 13443 | 13443 | ||
| 13444 | if (had_errors) | 13444 | if (had_errors) |
| 13445 | rc = XQueryPointer (dpyinfo->display, w, root_return, | 13445 | { |
| 13446 | child_return, root_x_return, | 13446 | /* If the specified client pointer is the display's client |
| 13447 | root_y_return, win_x_return, | 13447 | pointer, clear it now. A new client pointer might not be |
| 13448 | win_y_return, mask_return); | 13448 | found before the next call to x_query_pointer_1 and |
| 13449 | waiting for the error leads to excessive syncing. */ | ||
| 13450 | |||
| 13451 | if (client_pointer_device == dpyinfo->client_pointer_device) | ||
| 13452 | dpyinfo->client_pointer_device = -1; | ||
| 13453 | |||
| 13454 | rc = XQueryPointer (dpyinfo->display, w, root_return, | ||
| 13455 | child_return, root_x_return, | ||
| 13456 | root_y_return, win_x_return, | ||
| 13457 | win_y_return, mask_return); | ||
| 13458 | } | ||
| 13449 | else | 13459 | else |
| 13450 | { | 13460 | { |
| 13451 | state = 0; | 13461 | state = 0; |