diff options
| author | Po Lu | 2022-09-18 15:23:42 +0800 |
|---|---|---|
| committer | Po Lu | 2022-09-18 15:24:02 +0800 |
| commit | 25587ada2c094e5435a7a39bf99e97730cc7ecd0 (patch) | |
| tree | 68bb778dcd495fbd3891ae0cffc921778e594b96 /src | |
| parent | 117795a0594d1b4fc1c267311d789b0255ac6291 (diff) | |
| download | emacs-25587ada2c094e5435a7a39bf99e97730cc7ecd0.tar.gz emacs-25587ada2c094e5435a7a39bf99e97730cc7ecd0.zip | |
Remove what should be unnecessary calls to block_input
* src/xterm.c (handle_one_xevent): Do not block input inside.
This function is not reentrant and is always called with input
blocked.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/xterm.c b/src/xterm.c index deceafbc817..cb6581b78cf 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -17628,6 +17628,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 17628 | int dx, dy; | 17628 | int dx, dy; |
| 17629 | USE_SAFE_ALLOCA; | 17629 | USE_SAFE_ALLOCA; |
| 17630 | 17630 | ||
| 17631 | /* This function is not reentrant, so input should be blocked before | ||
| 17632 | it is called. */ | ||
| 17633 | |||
| 17634 | if (!input_blocked_p ()) | ||
| 17635 | emacs_abort (); | ||
| 17636 | |||
| 17631 | *finish = X_EVENT_NORMAL; | 17637 | *finish = X_EVENT_NORMAL; |
| 17632 | 17638 | ||
| 17633 | EVENT_INIT (inev.ie); | 17639 | EVENT_INIT (inev.ie); |
| @@ -18526,11 +18532,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 18526 | Window root; | 18532 | Window root; |
| 18527 | unsigned int dummy_uint; | 18533 | unsigned int dummy_uint; |
| 18528 | 18534 | ||
| 18529 | block_input (); | ||
| 18530 | XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 18535 | XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 18531 | &root, &f->left_pos, &f->top_pos, | 18536 | &root, &f->left_pos, &f->top_pos, |
| 18532 | &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); | 18537 | &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); |
| 18533 | unblock_input (); | ||
| 18534 | } | 18538 | } |
| 18535 | 18539 | ||
| 18536 | x_set_frame_alpha (f); | 18540 | x_set_frame_alpha (f); |
| @@ -18555,7 +18559,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 18555 | { | 18559 | { |
| 18556 | if (!FRAME_VISIBLE_P (f)) | 18560 | if (!FRAME_VISIBLE_P (f)) |
| 18557 | { | 18561 | { |
| 18558 | block_input (); | ||
| 18559 | /* By default, do not set the frame's visibility here, see | 18562 | /* By default, do not set the frame's visibility here, see |
| 18560 | https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. | 18563 | https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html. |
| 18561 | The default behavior can be overridden by setting | 18564 | The default behavior can be overridden by setting |
| @@ -18574,7 +18577,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 18574 | #endif | 18577 | #endif |
| 18575 | f->output_data.x->has_been_visible = true; | 18578 | f->output_data.x->has_been_visible = true; |
| 18576 | SET_FRAME_GARBAGED (f); | 18579 | SET_FRAME_GARBAGED (f); |
| 18577 | unblock_input (); | ||
| 18578 | } | 18580 | } |
| 18579 | else if (FRAME_GARBAGED_P (f)) | 18581 | else if (FRAME_GARBAGED_P (f)) |
| 18580 | { | 18582 | { |
| @@ -20069,12 +20071,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20069 | flicker. Don't try to optimize these calls by looking only | 20071 | flicker. Don't try to optimize these calls by looking only |
| 20070 | for size changes: that's not sufficient. We miss some | 20072 | for size changes: that's not sufficient. We miss some |
| 20071 | surface invalidations and flicker. */ | 20073 | surface invalidations and flicker. */ |
| 20072 | block_input (); | ||
| 20073 | #ifdef HAVE_XDBE | 20074 | #ifdef HAVE_XDBE |
| 20074 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) | 20075 | if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) |
| 20075 | x_drop_xrender_surfaces (f); | 20076 | x_drop_xrender_surfaces (f); |
| 20076 | #endif | 20077 | #endif |
| 20077 | unblock_input (); | ||
| 20078 | #if defined USE_CAIRO && !defined USE_GTK | 20078 | #if defined USE_CAIRO && !defined USE_GTK |
| 20079 | if (f) | 20079 | if (f) |
| 20080 | x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, | 20080 | x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, |
| @@ -20104,10 +20104,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20104 | f->new_width, f->new_height); | 20104 | f->new_width, f->new_height); |
| 20105 | 20105 | ||
| 20106 | #ifdef HAVE_XDBE | 20106 | #ifdef HAVE_XDBE |
| 20107 | block_input (); | ||
| 20108 | if (FRAME_X_DOUBLE_BUFFERED_P (f)) | 20107 | if (FRAME_X_DOUBLE_BUFFERED_P (f)) |
| 20109 | x_drop_xrender_surfaces (f); | 20108 | x_drop_xrender_surfaces (f); |
| 20110 | unblock_input (); | ||
| 20111 | #endif | 20109 | #endif |
| 20112 | xg_frame_resized (f, configureEvent.xconfigure.width, | 20110 | xg_frame_resized (f, configureEvent.xconfigure.width, |
| 20113 | configureEvent.xconfigure.height); | 20111 | configureEvent.xconfigure.height); |
| @@ -20197,11 +20195,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20197 | Window root; | 20195 | Window root; |
| 20198 | unsigned int dummy_uint; | 20196 | unsigned int dummy_uint; |
| 20199 | 20197 | ||
| 20200 | block_input (); | ||
| 20201 | XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 20198 | XGetGeometry (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 20202 | &root, &f->left_pos, &f->top_pos, | 20199 | &root, &f->left_pos, &f->top_pos, |
| 20203 | &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); | 20200 | &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint); |
| 20204 | unblock_input (); | ||
| 20205 | } | 20201 | } |
| 20206 | 20202 | ||
| 20207 | if (!FRAME_TOOLTIP_P (f) | 20203 | if (!FRAME_TOOLTIP_P (f) |
| @@ -20486,12 +20482,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20486 | 20482 | ||
| 20487 | if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) | 20483 | if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) |
| 20488 | { | 20484 | { |
| 20489 | block_input (); | ||
| 20490 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 20485 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 20491 | RevertToParent, event->xbutton.time); | 20486 | RevertToParent, event->xbutton.time); |
| 20492 | if (FRAME_PARENT_FRAME (f)) | 20487 | if (FRAME_PARENT_FRAME (f)) |
| 20493 | XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); | 20488 | XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); |
| 20494 | unblock_input (); | ||
| 20495 | } | 20489 | } |
| 20496 | } | 20490 | } |
| 20497 | 20491 | ||
| @@ -22152,7 +22146,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 22152 | 22146 | ||
| 22153 | if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) | 22147 | if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) |
| 22154 | { | 22148 | { |
| 22155 | block_input (); | ||
| 22156 | #if defined HAVE_GTK3 || (!defined USE_GTK && !defined USE_X_TOOLKIT) | 22149 | #if defined HAVE_GTK3 || (!defined USE_GTK && !defined USE_X_TOOLKIT) |
| 22157 | if (device) | 22150 | if (device) |
| 22158 | { | 22151 | { |
| @@ -22175,7 +22168,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 22175 | #endif | 22168 | #endif |
| 22176 | if (FRAME_PARENT_FRAME (f)) | 22169 | if (FRAME_PARENT_FRAME (f)) |
| 22177 | XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); | 22170 | XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); |
| 22178 | unblock_input (); | ||
| 22179 | } | 22171 | } |
| 22180 | } | 22172 | } |
| 22181 | 22173 | ||
| @@ -23680,7 +23672,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 23680 | #endif | 23672 | #endif |
| 23681 | OTHER: | 23673 | OTHER: |
| 23682 | #ifdef USE_X_TOOLKIT | 23674 | #ifdef USE_X_TOOLKIT |
| 23683 | block_input (); | ||
| 23684 | if (*finish != X_EVENT_DROP) | 23675 | if (*finish != X_EVENT_DROP) |
| 23685 | { | 23676 | { |
| 23686 | /* Ignore some obviously bogus ConfigureNotify events that | 23677 | /* Ignore some obviously bogus ConfigureNotify events that |
| @@ -23697,7 +23688,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 23697 | #endif | 23688 | #endif |
| 23698 | } | 23689 | } |
| 23699 | } | 23690 | } |
| 23700 | unblock_input (); | ||
| 23701 | #endif /* USE_X_TOOLKIT */ | 23691 | #endif /* USE_X_TOOLKIT */ |
| 23702 | #if defined USE_GTK && !defined HAVE_GTK3 && defined HAVE_XINPUT2 | 23692 | #if defined USE_GTK && !defined HAVE_GTK3 && defined HAVE_XINPUT2 |
| 23703 | if (*finish != X_EVENT_DROP && copy) | 23693 | if (*finish != X_EVENT_DROP && copy) |