diff options
| author | Po Lu | 2022-04-22 19:43:42 +0800 |
|---|---|---|
| committer | Po Lu | 2022-04-22 19:43:42 +0800 |
| commit | 05705454d5c616cb54294ae3bbb2d40ab72fc8ed (patch) | |
| tree | a9d75b9b3de0aa10925abffed8eebef8033afd26 | |
| parent | 381eb5d5a0c7ba9d4ef06f8be1636f882d7a7b78 (diff) | |
| download | emacs-05705454d5c616cb54294ae3bbb2d40ab72fc8ed.tar.gz emacs-05705454d5c616cb54294ae3bbb2d40ab72fc8ed.zip | |
Don't transfer window attributes trying to find the XM drag window
* src/xterm.c (xm_get_drag_window): Select for impossible event
mask instead of asking for the window attributes.
| -rw-r--r-- | src/xterm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index adfe3059d1d..7e8d226fb26 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1385,7 +1385,6 @@ xm_get_drag_window (struct x_display_info *dpyinfo) | |||
| 1385 | unsigned char *tmp_data = NULL; | 1385 | unsigned char *tmp_data = NULL; |
| 1386 | Window drag_window; | 1386 | Window drag_window; |
| 1387 | XSetWindowAttributes attrs; | 1387 | XSetWindowAttributes attrs; |
| 1388 | XWindowAttributes wattrs; | ||
| 1389 | Display *temp_display; | 1388 | Display *temp_display; |
| 1390 | void *old_handler; | 1389 | void *old_handler; |
| 1391 | 1390 | ||
| @@ -1403,8 +1402,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo) | |||
| 1403 | { | 1402 | { |
| 1404 | drag_window = *(Window *) tmp_data; | 1403 | drag_window = *(Window *) tmp_data; |
| 1405 | x_catch_errors (dpyinfo->display); | 1404 | x_catch_errors (dpyinfo->display); |
| 1406 | XGetWindowAttributes (dpyinfo->display, | 1405 | /* We use ButtonPressMask since it's one of the events an |
| 1407 | drag_window, &wattrs); | 1406 | input-only window can never get. */ |
| 1407 | XSelectInput (dpyinfo->display, drag_window, | ||
| 1408 | ButtonPressMask); | ||
| 1408 | rc = !x_had_errors_p (dpyinfo->display); | 1409 | rc = !x_had_errors_p (dpyinfo->display); |
| 1409 | x_uncatch_errors_after_check (); | 1410 | x_uncatch_errors_after_check (); |
| 1410 | 1411 | ||
| @@ -1474,8 +1475,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo) | |||
| 1474 | current display, and the XOpenDisplay above didn't | 1475 | current display, and the XOpenDisplay above didn't |
| 1475 | accidentally connect to some other display. */ | 1476 | accidentally connect to some other display. */ |
| 1476 | x_catch_errors (dpyinfo->display); | 1477 | x_catch_errors (dpyinfo->display); |
| 1477 | XGetWindowAttributes (dpyinfo->display, | 1478 | /* We use ButtonPressMask since it's one of the events an |
| 1478 | drag_window, &wattrs); | 1479 | input-only window can never get. */ |
| 1480 | XSelectInput (dpyinfo->display, drag_window, | ||
| 1481 | ButtonPressMask); | ||
| 1479 | rc = !x_had_errors_p (dpyinfo->display); | 1482 | rc = !x_had_errors_p (dpyinfo->display); |
| 1480 | x_uncatch_errors_after_check (); | 1483 | x_uncatch_errors_after_check (); |
| 1481 | unblock_input (); | 1484 | unblock_input (); |