commit 2953d89d74ebfe6a6bcbe0d25a60a845acad0e13 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed Oct 12 15:07:49 2022 +0800 Stop relying on Xt hack to set window manager hints * src/widget.c (get_wm_shell): Return WMShellWidget. (update_wm_hints, widget_update_wm_size_hints): Return whether or not size hints changed. * src/widget.h: Delete `size_switch'. * src/widgetprv.h (EmacsFramePart): Likewise. * src/xterm.c (x_wm_set_size_hint): Set size hints the usual way if Xt did not set them. (bug#58412) diff --git a/src/widget.c b/src/widget.c index 5a75cdaca8..aaab33b6d8 100644 --- a/src/widget.c +++ b/src/widget.c @@ -195,7 +195,7 @@ round_size_to_char (EmacsFrame ew, Dimension in_width, Dimension in_height, out_width, out_height); } -static Widget +static WMShellWidget get_wm_shell (Widget w) { Widget wmshell; @@ -204,7 +204,7 @@ get_wm_shell (Widget w) wmshell && !XtIsWMShell (wmshell); wmshell = XtParent (wmshell)); - return wmshell; + return (WMShellWidget) wmshell; } #if 0 /* Currently not used. */ @@ -269,8 +269,8 @@ set_frame_size (EmacsFrame ew) (f, build_string ("set_frame_size")); } -static void -update_wm_hints (Widget wmshell, EmacsFrame ew) +static bool +update_wm_hints (WMShellWidget wmshell, EmacsFrame ew) { int cw; int ch; @@ -280,6 +280,12 @@ update_wm_hints (Widget wmshell, EmacsFrame ew) int char_height; int base_width; int base_height; + char buffer[sizeof wmshell->wm.size_hints]; + char *hints_ptr; + + /* Copy the old size hints to the buffer. */ + memcpy (buffer, &wmshell->wm.size_hints, + sizeof wmshell->wm.size_hints); pixel_to_char_size (ew, ew->core.width, ew->core.height, &char_width, &char_height); @@ -292,27 +298,29 @@ update_wm_hints (Widget wmshell, EmacsFrame ew) base_height = (wmshell->core.height - ew->core.height + (rounded_height - (char_height * ch))); - /* Ensure that Xt actually sets window manager hint flags specified - by the caller by making sure XtNminWidth (a relatively harmless - resource) always changes each time this function is invoked. */ - ew->emacs_frame.size_switch = !ew->emacs_frame.size_switch; - - XtVaSetValues (wmshell, + XtVaSetValues ((Widget) wmshell, XtNbaseWidth, (XtArgVal) base_width, XtNbaseHeight, (XtArgVal) base_height, XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw), XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch), - XtNminWidth, (XtArgVal) (base_width - + ew->emacs_frame.size_switch), - XtNminHeight, (XtArgVal) (base_height - + ew->emacs_frame.size_switch), + XtNminWidth, (XtArgVal) base_width, + XtNminHeight, (XtArgVal) base_height, NULL); + + /* Return if size hints really changed. If they did not, then Xt + probably didn't set them either (or take the flags into + account.) */ + hints_ptr = (char *) &wmshell->wm.size_hints; + + /* Skip flags, which is unsigned long. */ + return memcmp (hints_ptr + sizeof (long), buffer + sizeof (long), + sizeof wmshell->wm.wm_hints - sizeof (long)); } -void +bool widget_update_wm_size_hints (Widget widget, Widget frame) { - update_wm_hints (widget, (EmacsFrame) frame); + return update_wm_hints ((WMShellWidget) widget, (EmacsFrame) frame); } static void @@ -357,8 +365,6 @@ EmacsFrameInitialize (Widget request, Widget new, exit (1); } - ew->emacs_frame.size_switch = 1; - update_from_various_frame_slots (ew); set_frame_size (ew); } diff --git a/src/widget.h b/src/widget.h index 2906d5ff9e..cf83cb1078 100644 --- a/src/widget.h +++ b/src/widget.h @@ -97,6 +97,6 @@ extern struct _DisplayContext *display_context; /* Special entry points */ void EmacsFrameSetCharSize (Widget, int, int); void widget_store_internal_border (Widget widget); -void widget_update_wm_size_hints (Widget widget, Widget frame); +bool widget_update_wm_size_hints (Widget widget, Widget frame); #endif /* _EmacsFrame_h */ diff --git a/src/widgetprv.h b/src/widgetprv.h index fe960326b0..3a4d9206ff 100644 --- a/src/widgetprv.h +++ b/src/widgetprv.h @@ -49,9 +49,6 @@ typedef struct { Boolean visual_bell; /* flash instead of beep */ int bell_volume; /* how loud is beep */ - int size_switch; /* hack to make setting size - hints work correctly */ - /* private state */ } EmacsFramePart; diff --git a/src/xterm.c b/src/xterm.c index 9c34fce7c5..9059ad7136 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -28006,6 +28006,7 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) Window window = FRAME_OUTER_WINDOW (f); #ifdef USE_X_TOOLKIT WMShellWidget shell; + bool hints_changed; #endif if (!window) @@ -28032,8 +28033,9 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) shell->wm.size_hints.flags |= USPosition; } - widget_update_wm_size_hints (f->output_data.x->widget, - f->output_data.x->edit_widget); + hints_changed + = widget_update_wm_size_hints (f->output_data.x->widget, + f->output_data.x->edit_widget); #ifdef USE_MOTIF /* Do this all over again for the benefit of Motif, which always @@ -28046,6 +28048,7 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) shell->wm.size_hints.flags &= ~PPosition; shell->wm.size_hints.flags |= USPosition; } +#endif /* Drill hints into Motif, since it keeps setting its own. */ size_hints.flags = shell->wm.size_hints.flags; @@ -28063,15 +28066,23 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) size_hints.min_aspect.y = shell->wm.size_hints.min_aspect.y; size_hints.max_aspect.x = shell->wm.size_hints.max_aspect.x; size_hints.max_aspect.y = shell->wm.size_hints.max_aspect.y; -#ifdef HAVE_X11XTR6 size_hints.base_width = shell->wm.base_width; size_hints.base_height = shell->wm.base_height; size_hints.win_gravity = shell->wm.win_gravity; -#endif +#ifdef USE_MOTIF XSetWMNormalHints (XtDisplay (f->output_data.x->widget), XtWindow (f->output_data.x->widget), &size_hints); +#else + /* In many cases, widget_update_wm_size_hints will not have + updated the size hints if only flags changed. When that + happens, set the WM hints manually. */ + + if (!hints_changed) + XSetWMNormalHints (XtDisplay (f->output_data.x->widget), + XtWindow (f->output_data.x->widget), + &size_hints); #endif return; commit c22e85715e47e371fda1af420f54e3840978b81f Merge: ef6e518035 3787d0b11a Author: Stefan Kangas Date: Wed Oct 12 06:31:27 2022 +0200 Merge from origin/emacs-28 3787d0b11a ; * doc/lispref/windows.texi (Window Hooks): Fix markup (b... commit ef6e518035fddf13547d7f1f945b5069a0fe6ea7 Author: Dmitry Gutov Date: Wed Oct 12 00:04:54 2022 +0300 ; lisp/progmodes/project.el: Bump version diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ee94d0d85d..ac278edd40 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2022 Free Software Foundation, Inc. -;; Version: 0.8.1 +;; Version: 0.8.2 ;; Package-Requires: ((emacs "26.1") (xref "1.4.0")) ;; This is a GNU ELPA :core package. Avoid using functionality that commit 37447209042e174f4e95c8d0166418d2aef018ed Author: Andrea Corallo Date: Tue Oct 11 21:17:55 2022 +0200 Add trampoline AOT compilation target (bug#58318) * Makefile.in (trampolines): New target. * lisp/Makefile.in (trampolines): Likewise. * lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New function. diff --git a/Makefile.in b/Makefile.in index 741a4c5538..2d617e2294 100644 --- a/Makefile.in +++ b/Makefile.in @@ -530,6 +530,11 @@ lisp: src lib lib-src lisp nt: Makefile $(MAKE) -C $@ all +trampolines: src lisp +ifeq ($(HAVE_NATIVE_COMP),yes) + $(MAKE) -C lisp trampolines +endif + # Pass an unexpanded $srcdir to src's Makefile, which then # expands it using its own value of srcdir (which points to the # source directory of src/). diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 256017f6c5..338814fdda 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -430,6 +430,12 @@ compile-always: find $(lisp) -name '*.elc' $(FIND_DELETE) $(MAKE) compile +.PHONY: trampolines +trampolines: compile +ifeq ($(HAVE_NATIVE_COMP),yes) + $(emacs) -l comp -f comp-compile-all-trampolines +endif + .PHONY: backup-compiled-files compile-after-backup # Backup compiled Lisp files in elc.tar.gz. If that file already diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 6656b7e57c..889bffa3f5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4204,6 +4204,17 @@ bytecode definition was not changed in the meantime)." ;;; Compiler entry points. +(defun comp-compile-all-trampolines () + "Pre-compile AOT all trampolines." + (let ((comp-running-batch-compilation t) + ;; We want to target only the 'native-lisp' directory. + (native-compile-target-directory + (car (last native-comp-eln-load-path)))) + (mapatoms (lambda (f) + (when (subr-primitive-p (symbol-function f)) + (message "Compiling trampoline for: %s" f) + (comp-trampoline-compile f)))))) + ;;;###autoload (defun comp-lookup-eln (filename) "Given a Lisp source FILENAME return the corresponding .eln file if found. commit 3787d0b11a40484bf15e860ac300f35a91734ffb (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Tue Oct 11 20:20:44 2022 +0300 ; * doc/lispref/windows.texi (Window Hooks): Fix markup (bug#58445). diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5d31f70e01..1334e3bcf8 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6591,32 +6591,32 @@ time window change functions were run for @var{window}'s frame. If it returns @code{nil}, @var{window} has been created after that. If it returns @code{t}, @var{window} was not shown at that time but has been restored from a previously saved window configuration afterwards. -Otherwise, the return value is the buffer shown by @code{window} at +Otherwise, the return value is the buffer shown by @var{window} at that time. @end defun @defun window-old-pixel-width &optional window This function returns the total pixel width of @var{window} the -last time window change functions found @code{window} live on its -frame. It is zero if @code{window} was created after that. +last time window change functions found @var{window} live on its +frame. It is zero if @var{window} was created after that. @end defun @defun window-old-pixel-height &optional window This function returns the total pixel height of @var{window} the last -time window change functions found @code{window} live on its frame. -It is zero if @code{window} was created after that. +time window change functions found @var{window} live on its frame. +It is zero if @var{window} was created after that. @end defun @defun window-old-body-pixel-width &optional window This function returns the pixel width of @var{window}'s text area the -last time window change functions found @code{window} live on its -frame. It is zero if @code{window} was created after that. +last time window change functions found @var{window} live on its +frame. It is zero if @var{window} was created after that. @end defun @defun window-old-body-pixel-height &optional window This function returns the pixel height of @var{window}'s text area the -last time window change functions found @code{window} live on its -frame. It is zero if @code{window} was created after that. +last time window change functions found @var{window} live on its +frame. It is zero if @var{window} was created after that. @end defun In order to find out which window or frame was selected the last time commit 61b6da5acef2d550022c664e628346539ba1852f Author: Po Lu Date: Tue Oct 11 19:55:14 2022 +0800 Also avoid setting _NET_WM_USER_TIME on crossing * src/xterm.c (handle_one_xevent): Stop setting user time prop on crossing events. diff --git a/src/xterm.c b/src/xterm.c index 21207a3146..9c34fce7c5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7592,17 +7592,19 @@ static void x_check_font (struct frame *, struct font *); ridiculously large value, and this way a more reasonable timestamp can be obtained upon the next event. + Alternatively, the server time could've overflowed. + SET_PROPERTY specifies whether or not to change the user time property for the active frame. The important thing is to not set the last user time upon leave events; on Metacity and GNOME Shell, mapping a new frame on top of the old frame potentially causes - LeaveNotify or XI_Leave to be sent to the old frame if it contains - the pointer, as the new frame will initially stack above the old - frame. If _NET_WM_USER_TIME is changed at that point, then GNOME - may get notified about the user time change on the old frame before - it tries to focus the new frame, which will make it consider the - new frame (whose user time property will not have been updated at - that point, due to not being focused) as having been mapped + crossing events to be sent to the old frame if it contains the + pointer, as the new frame will initially stack above the old frame. + If _NET_WM_USER_TIME is changed at that point, then GNOME may get + notified about the user time change on the old frame before it + tries to focus the new frame, which will make it consider the new + frame (whose user time property will not have been updated at that + point, due to not being focused) as having been mapped out-of-order, and lower the new frame, which is typically not what users want. */ @@ -19567,7 +19569,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, case EnterNotify: x_display_set_last_user_time (dpyinfo, event->xcrossing.time, - event->xcrossing.send_event, true); + event->xcrossing.send_event, false); #ifdef HAVE_XINPUT2 /* For whatever reason, the X server continues to deliver @@ -21114,7 +21116,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, ev.send_event = enter->send_event; x_display_set_last_user_time (dpyinfo, enter->time, - enter->send_event, true); + enter->send_event, false); #ifdef USE_MOTIF use_copy = true; commit 48df8bbb1fd55e363c85e968de3719c9ec5150a7 Author: Mattias EngdegÄrd Date: Tue Oct 11 11:10:46 2022 +0200 ; * src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): run faster on mainframes diff --git a/src/fns.c b/src/fns.c index 5eab35a564..4055792382 100644 --- a/src/fns.c +++ b/src/fns.c @@ -442,7 +442,8 @@ If string STR1 is greater, the value is a positive number N; || defined __i386__ || defined __i386 \ || defined __arm64__ || defined __aarch64__ \ || defined __powerpc__ || defined __powerpc \ - || defined __ppc__ || defined __ppc + || defined __ppc__ || defined __ppc \ + || defined __s390__ || defined __s390x__ #define HAVE_FAST_UNALIGNED_ACCESS 1 #else #define HAVE_FAST_UNALIGNED_ACCESS 0 commit 5724ee61313c52a17f94ebad52f2e8e7a44fe7cd Author: Lars Ingebrigtsen Date: Tue Oct 11 13:02:20 2022 +0200 Make read-string-from-buffer and string-edit mention each other * lisp/textmodes/string-edit.el (read-string-from-buffer) (string-edit): Mention each other in the doc strings. diff --git a/lisp/textmodes/string-edit.el b/lisp/textmodes/string-edit.el index 53850674ac..562ab60d13 100644 --- a/lisp/textmodes/string-edit.el +++ b/lisp/textmodes/string-edit.el @@ -46,7 +46,9 @@ called with no parameters. PROMPT will be inserted at the start of the buffer, but won't be included in the resulting string. If PROMPT is nil, no help text -will be inserted." +will be inserted. + +Also see `read-string-from-buffer'." (with-current-buffer (generate-new-buffer "*edit string*") (when prompt (let ((inhibit-read-only t)) @@ -88,7 +90,9 @@ The user finishes editing with \\\\[string-edit-done], or PROMPT will be inserted at the start of the buffer, but won't be included in the resulting string. If nil, no prompt will be -inserted in the buffer." +inserted in the buffer. + +Also see `string-edit'." (string-edit prompt string commit 4f114c0d95caa0e26de3d188cebe9e3cbcb2dee8 Author: Eli Zaretskii Date: Tue Oct 11 13:26:01 2022 +0300 Speed up scrolling when lines are very long and truncated * src/window.c (window_scroll_for_long_lines): New function. (window_scroll): Call 'window_scroll_for_long_lines' when lines are very long and truncated on display. Also, disable 'fontification-functions' during scrolling in that case. * src/xdisp.c (redisplay_window): When recentering the window's display, go back to the centering position using a simplified method, if lines in the buffer are very long and truncated on display. diff --git a/src/window.c b/src/window.c index da80fabe33..4e8b352e16 100644 --- a/src/window.c +++ b/src/window.c @@ -52,6 +52,7 @@ static ptrdiff_t get_leaf_windows (struct window *, struct window **, ptrdiff_t); static void window_scroll_pixel_based (Lisp_Object, int, bool, bool); static void window_scroll_line_based (Lisp_Object, int, bool, bool); +static void window_scroll_for_long_lines (struct window *, int, bool); static void foreach_window (struct frame *, bool (* fn) (struct window *, void *), void *); @@ -5536,19 +5537,40 @@ window_internal_height (struct window *w) static void window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror) { + struct window *w = XWINDOW (window); + struct buffer *b = XBUFFER (w->contents); + bool long_lines_truncated = + b->long_line_optimizations_p && !NILP (BVAR (b, truncate_lines)); specpdl_ref count = SPECPDL_INDEX (); n = clip_to_bounds (INT_MIN, n, INT_MAX); - wset_redisplay (XWINDOW (window)); + wset_redisplay (w); - if (whole && fast_but_imprecise_scrolling) + /* Does this window's buffer have very long and truncated lines? */ + if (b->long_line_optimizations_p + && !long_lines_truncated + && !NILP (Vtruncate_partial_width_windows) + && w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w)))) + { + if (FIXNUMP (Vtruncate_partial_width_windows)) + long_lines_truncated = + w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); + else + long_lines_truncated = true; + } + + if (whole && (fast_but_imprecise_scrolling || long_lines_truncated)) specbind (Qfontification_functions, Qnil); - /* On GUI frames, use the pixel-based version which is much slower - than the line-based one but can handle varying line heights. */ - if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) + if (whole && long_lines_truncated) + window_scroll_for_long_lines (w, n, noerror); + else if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) { + + /* On GUI frames, use the pixel-based version which is much + slower than the line-based one, but can handle varying + line heights. */ record_unwind_protect_void (unwind_display_working_on_window); display_working_on_window_p = true; window_scroll_pixel_based (window, n, whole, noerror); @@ -5598,6 +5620,71 @@ sanitize_next_screen_context_lines (void) return clip_to_bounds (0, next_screen_context_lines, 1000000); } +/* Implementation of window_scroll for very long and truncated lines. + This is a simplified version, it only handles WHOLE window scrolls, + and doesn't honor scroll-preserve-screen-position nor scroll-margin. */ +static void +window_scroll_for_long_lines (struct window *w, int n, bool noerror) +{ + ptrdiff_t startpos = marker_position (w->start); + ptrdiff_t startbyte = marker_byte_position (w->start); + int nscls = sanitize_next_screen_context_lines (); + register int ht = window_internal_height (w); + + n *= max (1, ht - nscls); + + /* If point is not visible in window, bring it inside window. */ + struct position pos; + int rtop, rbot, dummy_rowh, dummy_vpos, dummy_x, dummy_y; + if (!(PT >= startpos + && PT <= ZV + && startpos <= ZV + && pos_visible_p (w, PT, &dummy_x, &dummy_y, &rtop, &rbot, &dummy_rowh, + &dummy_vpos) + && !rtop && !rbot)) + { + pos = *vmotion (PT, PT_BYTE, - (ht / 2), w); + startpos = pos.bufpos; + startbyte = pos.bytepos; + } + SET_PT_BOTH (startpos, startbyte); + + bool lose = n < 0 && PT == BEGV; + pos = *vmotion (PT, PT_BYTE, n, w); + if (lose) + { + if (noerror) + return; + else + xsignal0 (Qbeginning_of_buffer); + } + + bool bolp = pos.bufpos == BEGV || FETCH_BYTE (pos.bytepos - 1) == '\n'; + if (pos.bufpos < ZV) + { + set_marker_restricted_both (w->start, w->contents, + pos.bufpos, pos.bytepos); + w->start_at_line_beg = bolp; + wset_update_mode_line (w); + /* Set force_start so that redisplay_window will run + the window-scroll-functions. */ + w->force_start = true; + SET_PT_BOTH (pos.bufpos, pos.bytepos); + if (n > 0) + pos = *vmotion (PT, PT_BYTE, ht / 2, w); + else if (n < 0) + pos = *vmotion (PT, PT_BYTE, - (ht / 2), w); + SET_PT_BOTH (pos.bufpos, pos.bytepos); + } + else + { + if (noerror) + return; + else + xsignal0 (Qend_of_buffer); + } +} + /* Implementation of window_scroll that works based on pixel line heights. See the comment of window_scroll for parameter descriptions. */ diff --git a/src/xdisp.c b/src/xdisp.c index 9534e27843..e390de6a33 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20165,7 +20165,20 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) from point. */ centering_position = window_box_height (w) / 2; } - move_it_vertically_backward (&it, centering_position); + if (current_buffer->long_line_optimizations_p + && it.line_wrap == TRUNCATE) + { + /* For very long and truncated lines, go back using a simplified + method, which ignored any inaccuracies due to line-height + differences, display properties/overlays, etc. */ + int nlines = centering_position / frame_line_height; + + while (nlines-- && IT_CHARPOS (it) > BEGV) + back_to_previous_visible_line_start (&it); + reseat_1 (&it, it.current.pos, true); + } + else + move_it_vertically_backward (&it, centering_position); eassert (IT_CHARPOS (it) >= BEGV); commit 163000fb5980a0a098d1c4620b88a4717702d779 Author: Po Lu Date: Tue Oct 11 15:45:08 2022 +0800 Remove some more unnecessary calls to block_input * src/xterm.c (x_update_opaque_region, show_back_buffer) (XTbuffer_flipping_unblocked_hook, x_clear_under_internal_border) (x_after_update_window_line): Remove and add calls to block_input as required. diff --git a/src/xterm.c b/src/xterm.c index a374b13780..21207a3146 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5139,24 +5139,20 @@ x_update_opaque_region (struct frame *f, XEvent *configure) if (!FRAME_DISPLAY_INFO (f)->alpha_bits) return; - block_input (); if (f->alpha_background < 1.0) - XChangeProperty (FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), + XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_DISPLAY_INFO (f)->Xatom_net_wm_opaque_region, XA_CARDINAL, 32, PropModeReplace, NULL, 0); #ifndef HAVE_GTK3 else - XChangeProperty (FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), + XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_DISPLAY_INFO (f)->Xatom_net_wm_opaque_region, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opaque_region, 4); #else else if (FRAME_TOOLTIP_P (f)) - XChangeProperty (FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), + XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_DISPLAY_INFO (f)->Xatom_net_wm_opaque_region, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opaque_region, 4); @@ -5174,7 +5170,6 @@ x_update_opaque_region (struct frame *f, XEvent *configure) } } #endif - unblock_input (); } @@ -7144,8 +7139,6 @@ show_back_buffer (struct frame *f) cairo_t *cr; #endif - block_input (); - if (FRAME_X_DOUBLE_BUFFERED_P (f)) { #if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME @@ -7174,8 +7167,6 @@ show_back_buffer (struct frame *f) } FRAME_X_NEED_BUFFER_FLIP (f) = false; - - unblock_input (); } #endif @@ -7283,8 +7274,12 @@ XTframe_up_to_date (struct frame *f) static void XTbuffer_flipping_unblocked_hook (struct frame *f) { + block_input (); + if (FRAME_X_NEED_BUFFER_FLIP (f)) show_back_buffer (f); + + unblock_input (); } #endif @@ -7313,8 +7308,6 @@ x_clear_under_internal_border (struct frame *f) : INTERNAL_BORDER_FACE_ID)); struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); - block_input (); - if (face) { unsigned long color = face->background; @@ -7335,8 +7328,6 @@ x_clear_under_internal_border (struct frame *f) x_clear_area (f, width - border, 0, border, height); x_clear_area (f, 0, height - border, width, border); } - - unblock_input (); } } @@ -7384,7 +7375,6 @@ x_after_update_window_line (struct window *w, struct glyph_row *desired_row) : INTERNAL_BORDER_FACE_ID)); struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); - block_input (); if (face) { unsigned long color = face->background; @@ -7402,7 +7392,6 @@ x_after_update_window_line (struct window *w, struct glyph_row *desired_row) x_clear_area (f, 0, y, width, height); x_clear_area (f, FRAME_PIXEL_WIDTH (f) - width, y, width, height); } - unblock_input (); } } #endif