commit 6d78321ce824ede11ab04d976d46487bcd191cab (HEAD, refs/remotes/origin/master) Merge: 2b130bd944 9dadcbe429 Author: Stefan Kangas Date: Wed Mar 2 06:33:19 2022 +0100 Merge from origin/emacs-28 9dadcbe429 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup. 2c3d1b6bf4 Improve/correct documentation about Eshell variable expansion 9e257aecc9 Partially revert b03f74e0f2a578b1580e8b1c368665850ee7f808 commit 2b130bd944a36510043750286106a16a1e2ad7c4 Merge: 67af072204 b8bc359bbf Author: Stefan Kangas Date: Wed Mar 2 06:33:19 2022 +0100 ; Merge from origin/emacs-28 The following commit was skipped: b8bc359bbf Backport: Port pre-commit hook to Git 2.35.0 commit 67af072204ce973bdd42c750123749956bc558b9 Author: Po Lu Date: Wed Mar 2 05:21:20 2022 +0000 Fix some bugs with multiple terminals on Haiku * src/haikuterm.c (haiku_mouse_position): Only clear `mouse_moved' for Haiku frames. diff --git a/src/haikuterm.c b/src/haikuterm.c index 7779b3168b..a765eb715d 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2427,14 +2427,19 @@ haiku_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *timestamp) { + Lisp_Object frame, tail; + struct frame *f1 = NULL; + if (!fp) return; block_input (); - Lisp_Object frame, tail; - struct frame *f1 = NULL; + FOR_EACH_FRAME (tail, frame) - XFRAME (frame)->mouse_moved = false; + { + if (FRAME_HAIKU_P (XFRAME (frame))) + XFRAME (frame)->mouse_moved = false; + } if (gui_mouse_grabbed (x_display_list) && !EQ (track_mouse, Qdropping)) f1 = x_display_list->last_mouse_frame; commit ae00f07d88ced80ef8433594eb376858bb197782 Author: Po Lu Date: Wed Mar 2 11:12:09 2022 +0800 Fix persistent help text on disabled menu items * oldXMenu/Activate.c (XMenuActivate): Always deactivate help echo upon leaving a menu item. diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index 2d1d506832..781c05bd02 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -456,10 +456,10 @@ XMenuActivate( * If the current selection was activated then * deactivate it. */ + /* Emacs specific, HELP_STRING cannot be validly NULL + * in the real XMenu library. */ + help_callback (NULL, cur_p->serial, cur_s->serial); if (cur_s->activated) { - /* Emacs specific, HELP_STRING cannot be validly NULL - * in the real XMenu library. */ - help_callback (NULL, cur_p->serial, cur_s->serial); cur_s->activated = False; _XMRefreshSelection(display, menu, cur_s); } commit 84695d439ac77aa8ae871ae1f741929dc9d2761a Author: Po Lu Date: Wed Mar 2 10:07:59 2022 +0800 * src/msdos.c (dos_rawgetc): Handle tab bar clicks correctly. diff --git a/src/msdos.c b/src/msdos.c index f126d28c98..1608245904 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -2725,7 +2725,8 @@ dos_rawgetc (void) event.x = make_fixnum (x); event.y = make_fixnum (y); event.frame_or_window = selected_frame; - event.arg = Qnil; + event.arg = tty_handle_tab_bar_click (SELECTED_FRAME (), + x, y, press, &event); event.timestamp = event_timestamp (); kbd_buffer_store_event (&event); } commit 689a34e2153ec558dbf406809a5e58489250fe1a Author: Po Lu Date: Wed Mar 2 09:46:44 2022 +0800 Dismiss help text when item becomes unactivated on oldXMenu * oldXMenu/Activate.c (XMenuActivate): Dismiss help text when leaving an item. diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index 447b7398ca..2d1d506832 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -457,6 +457,9 @@ XMenuActivate( * deactivate it. */ if (cur_s->activated) { + /* Emacs specific, HELP_STRING cannot be validly NULL + * in the real XMenu library. */ + help_callback (NULL, cur_p->serial, cur_s->serial); cur_s->activated = False; _XMRefreshSelection(display, menu, cur_s); } commit 6b71b80fdcf32aed5191898e7339ffb9dcd29005 Author: Po Lu Date: Wed Mar 2 09:34:05 2022 +0800 Fix odd scrolling bugs on LessTif * src/xterm.c (handle_one_xevent): Give emulated button events to Motif. diff --git a/src/xterm.c b/src/xterm.c index f5ce42fc27..3f69300417 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12035,17 +12035,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, struct xwidget_view *xvw; #endif -#ifdef HAVE_XINPUT2_1 - /* Ignore emulated scroll events when XI2 native - scroll events are present. */ - if (xev->flags & XIPointerEmulated) - { - *finish = X_EVENT_DROP; - goto XI_OTHER; - } +#ifdef USE_MOTIF +#ifdef USE_TOOLKIT_SCROLL_BARS + struct scroll_bar *bar + = x_window_to_scroll_bar (dpyinfo->display, + xev->event, 2); #endif -#ifdef USE_MOTIF use_copy = true; copy.xbutton.type = (xev->evtype == XI_ButtonPress ? ButtonPress : ButtonRelease); @@ -12075,6 +12071,21 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #endif +#ifdef HAVE_XINPUT2_1 + /* Ignore emulated scroll events when XI2 native + scroll events are present. */ + if (xev->flags & XIPointerEmulated) + { +#if !defined USE_MOTIF || !defined USE_TOOLKIT_SCROLL_BARS + *finish = X_EVENT_DROP; +#else + if (bar) + *finish = X_EVENT_DROP; +#endif + goto XI_OTHER; + } +#endif + if (xev->evtype == XI_ButtonPress) x_display_set_last_user_time (dpyinfo, xev->time); commit 006a4474551ed43515c6249d2ed4cfcaefd9b7a5 Author: Po Lu Date: Wed Mar 2 09:01:48 2022 +0800 Improve behavior of Motif popup menus on XI2 * src/xmenu.c (create_and_show_popup_menu): Set input focus to menu window. diff --git a/src/xmenu.c b/src/xmenu.c index fb80221e15..e085fa1ace 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1728,6 +1728,15 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, /* Display the menu. */ lw_popup_menu (menu, &dummy); + +#if defined HAVE_XINPUT2 && defined USE_MOTIF + /* This is needed to prevent XI_Enter events that set an implicit + focus from being sent. */ + if (dpyinfo->supports_xi2) + XSetInputFocus (XtDisplay (menu), XtWindow (menu), + RevertToParent, CurrentTime); +#endif + popup_activated_flag = 1; #if defined HAVE_XINPUT2 && !defined USE_MOTIF commit caae254bb478ad83ba9caec6ec94b54e9abfb4c9 Author: Paul Eggert Date: Tue Mar 1 10:06:27 2022 -0800 Revert previous merge-gnulib change * admin/merge-gnulib: Revert previous stopgap change. It shouldn’t be needed now that Gnulib has the change 2022-03-01T18:01:59Z!eggert@cs.ucla.edu. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 7219fadd47..fec469c017 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -102,44 +102,34 @@ test -x "$gnulib_srcdir"/gnulib-tool || { exit 1 } +# gnulib-tool has problems with a bare checkout (Bug#32452#65). +test -f configure || ./autogen.sh || exit + # Old caches can confuse autoconf when some Gnulib-related changes take effect. rm -fr autom4te.cache || exit -# gnulib-tool has problems with a bare checkout (Bug#32452#91). -if test -f configure; then - passes='1' -else - passes='1 2' -fi - avoided_flags= for module in $AVOIDED_MODULES; do avoided_flags="$avoided_flags --avoid=$module" done -for pass in $passes; do - case $pass in - 2) echo 'Running gnulib-tool again to work around Bug#32452#91.' >&2 - esac - - "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS \ +"$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS \ $avoided_flags $GNULIB_MODULES && - rm -- "$src"lib/gl_openssl.h \ - "$src"lib/stdio-read.c "$src"lib/stdio-write.c \ - "$src"m4/fcntl-o.m4 \ - "$src"m4/gl-openssl.m4 \ - "$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \ - "$src"m4/manywarnings-c++.m4 \ - "$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 && - cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && - cp -- "$gnulib_srcdir"/build-aux/config.guess \ - "$gnulib_srcdir"/build-aux/config.sub \ - "$gnulib_srcdir"/build-aux/install-sh \ - "$gnulib_srcdir"/build-aux/move-if-change \ - "$src"build-aux && - cp -- "$gnulib_srcdir"/lib/af_alg.h \ - "$gnulib_srcdir"/lib/save-cwd.h \ - "$src"lib && - { test -z "$src" || cd "$src"; } && - ./autogen.sh || exit -done +rm -- "$src"lib/gl_openssl.h \ + "$src"lib/stdio-read.c "$src"lib/stdio-write.c \ + "$src"m4/fcntl-o.m4 \ + "$src"m4/gl-openssl.m4 \ + "$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \ + "$src"m4/manywarnings-c++.m4 \ + "$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 && +cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && +cp -- "$gnulib_srcdir"/build-aux/config.guess \ + "$gnulib_srcdir"/build-aux/config.sub \ + "$gnulib_srcdir"/build-aux/install-sh \ + "$gnulib_srcdir"/build-aux/move-if-change \ + "$src"build-aux && +cp -- "$gnulib_srcdir"/lib/af_alg.h \ + "$gnulib_srcdir"/lib/save-cwd.h \ + "$src"lib && +{ test -z "$src" || cd "$src"; } && +./autogen.sh commit 9dadcbe4297fdd52e2664e99fe693ba35a51eb57 (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Tue Mar 1 15:08:38 2022 +0200 ; * doc/misc/eshell.texi (Dollars Expansion): Fix markup. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 662c96dc92..f01023a1dc 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -579,62 +579,63 @@ of familiarity. @table @code -@item $var -Expands to the value bound to @code{var}. This is the main way to use +@item $@var{var} +Expands to the value bound to @var{var}. This is the main way to use variables in command invocations. -@item $"var" -@item $'var' -Expands to the value bound to @code{var}. This is useful to +@item $"@var{var}" +@item $'@var{var}' +Expands to the value bound to @var{var}. This is useful to disambiguate the variable name when concatenating it with another -value, such as @samp{$"var"-suffix}. +value, such as @samp{$"@var{var}"-suffix}. -@item $#var -Expands to the length of the value bound to @code{var}. Raises an error +@item $#@var{var} +Expands to the length of the value bound to @var{var}. Raises an error if the value is not a sequence (@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}). -@item $(lisp) -Expands to the result of evaluating the S-expression @code{(lisp)}. On -its own, this is identical to just @code{(lisp)}, but with the @code{$}, -it can be used in a string, such as @samp{/some/path/$(lisp).txt}. +@item $(@var{lisp}) +Expands to the result of evaluating the S-expression @code{(@var{lisp})}. On +its own, this is identical to just @code{(@var{lisp})}, but with the @code{$}, +it can be used in a string, such as @samp{/some/path/$(@var{lisp}).txt}. -@item $@{command@} -Returns the output of @command{command}, which can be any valid Eshell +@item $@{@var{command}@} +Returns the output of @command{@var{command}}, which can be any valid Eshell command invocation, and may even contain expansions. -@item $ -As with @samp{$@{command@}}, evaluates the Eshell command invocation -@command{command}, but writes the output to a temporary file and +@item $<@var{command}> +As with @samp{$@{@var{command}@}}, evaluates the Eshell command invocation +@command{@var{command}}, but writes the output to a temporary file and returns the file name. -@item $var[i] -Expands to the @code{i}th element of the value bound to @code{var}. If +@item $@var{var}[i] +Expands to the @code{i}th element of the value bound to @var{var}. If the value is a string, it will be split at whitespace to make it a list. Again, raises an error if the value is not a sequence. -@item $var[: i] +@item $@var{var}[: i] As above, but now splitting occurs at the colon character. -@item $var[: i j] +@item $@var{var}[: i j] As above, but instead of returning just a string, it now returns a list of two strings. If the result is being interpolated into a larger string, this list will be flattened into one big string, with each element separated by a space. -@item $var["\\\\" i] +@item $@var{var}["\\\\" i] Separate on backslash characters. Actually, the first argument -- if it doesn't have the form of a number, or a plain variable name -- can be -any regular expression. So to split on numbers, use @samp{$var["[0-9]+" 10 20]}. +any regular expression. So to split on numbers, use +@samp{$@var{var}["[0-9]+" 10 20]}. -@item $var[hello] -Calls @code{assoc} on @code{var} with @code{"hello"}, expecting it to be +@item $@var{var}[hello] +Calls @code{assoc} on @var{var} with @code{"hello"}, expecting it to be an alist (@pxref{Association List Type, Association Lists, , elisp, The Emacs Lisp Reference Manual}). -@item $#var[hello] -Returns the length of the cdr of the element of @code{var} who car is equal -to @code{"hello"}. +@item $#@var{var}[hello] +Returns the length of the @code{cdr} of the element of @var{var} whose +car is equal to @code{"hello"}. @end table commit 2c3d1b6bf41509bf0ba8995925fec9f20d8ed89d Author: Jim Porter Date: Sun Feb 27 13:20:51 2022 -0800 Improve/correct documentation about Eshell variable expansion * lisp/eshell/esh-var.el: Correct documentation comment. (eshell-parse-variable-ref): Correct docstring. * doc/misc/eshell.texi (Dollars Expansion): Add documentation for $"var"/$'var' and $ syntaxes. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 4f1d8c15da..662c96dc92 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -583,6 +583,12 @@ of familiarity. Expands to the value bound to @code{var}. This is the main way to use variables in command invocations. +@item $"var" +@item $'var' +Expands to the value bound to @code{var}. This is useful to +disambiguate the variable name when concatenating it with another +value, such as @samp{$"var"-suffix}. + @item $#var Expands to the length of the value bound to @code{var}. Raises an error if the value is not a sequence @@ -597,6 +603,11 @@ it can be used in a string, such as @samp{/some/path/$(lisp).txt}. Returns the output of @command{command}, which can be any valid Eshell command invocation, and may even contain expansions. +@item $ +As with @samp{$@{command@}}, evaluates the Eshell command invocation +@command{command}, but writes the output to a temporary file and +returns the file name. + @item $var[i] Expands to the @code{i}th element of the value bound to @code{var}. If the value is a string, it will be split at whitespace to make it a list. diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 081938b4e4..1d5d85deba 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -34,7 +34,8 @@ ;; ;; "-" is a valid part of a variable name. ;; -;; $-TOO +;; $\"MYVAR\"-TOO +;; $'MYVAR'-TOO ;; ;; Only "MYVAR" is part of the variable name in this case. ;; @@ -55,6 +56,11 @@ ;; Returns the value of an eshell subcommand. See the note above ;; regarding Lisp evaluations. ;; +;; $ +;; +;; Evaluates an eshell subcommand, redirecting the output to a +;; temporary file, and returning the file name. +;; ;; $ANYVAR[10] ;; ;; Return the 10th element of ANYVAR. If ANYVAR's value is a string, @@ -426,9 +432,12 @@ variable. Possible options are: NAME an environment or Lisp variable value - disambiguates the length of the name + \"LONG-NAME\" disambiguates the length of the name + 'LONG-NAME' as above {COMMAND} result of command is variable's value - (LISP-FORM) result of Lisp form is variable's value" + (LISP-FORM) result of Lisp form is variable's value + write the output of command to a temporary file; + result is the file name" (cond ((eq (char-after) ?{) (let ((end (eshell-find-delimiter ?\{ ?\}))) commit 9e257aecc9a3456fb3d66596862d44030f7d76c8 Author: Jim Porter Date: Mon Feb 28 09:31:22 2022 -0800 Partially revert b03f74e0f2a578b1580e8b1c368665850ee7f808 That commit regressed '$' forms in Eshell, due to a limitation/bug in how 'eshell-do-eval' works. This fixes bug#54190. * lisp/eshell/esh-var.el (eshell-parse-variable-ref): Quote a lambda. * test/lisp/eshell/eshell-tests.el (eshell-test/interp-temp-cmd): New test. diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 145a522516..081938b4e4 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -460,8 +460,12 @@ Possible options are: (eshell-as-subcommand ,(eshell-parse-command cmd)) (ignore (nconc eshell-this-command-hook - (list (lambda () - (delete-file ,temp))))) + ;; Quote this lambda; it will be evaluated + ;; by `eshell-do-eval', which requires very + ;; particular forms in order to work + ;; properly. See bug#54190. + (list (function (lambda () + (delete-file ,temp)))))) (quote ,temp))) (goto-char (1+ end))))))) ((eq (char-after) ?\() diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index a9b1e2ab4e..fe4fba294f 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -130,6 +130,10 @@ e.g. \"{(+ 1 2)} 3\" => 3" "Interpolate Lisp form evaluation" (should (equal (eshell-test-command-result "+ $(+ 1 2) 3") 6))) +(ert-deftest eshell-test/interp-temp-cmd () + "Interpolate command result redirected to temp file" + (should (equal (eshell-test-command-result "cat $") "hi"))) + (ert-deftest eshell-test/interp-concat () "Interpolate and concat command" (should (equal (eshell-test-command-result "+ ${+ 1 2}3 3") 36))) commit 87de4ad8bc227e7489373f546cb9c45c35d961c1 Author: Po Lu Date: Tue Mar 1 20:48:55 2022 +0800 ; Add a comment in recently installed code * faces.el (face-spec-recalc): Add a comment describing the special treatement of the scroll-bar face. diff --git a/lisp/faces.el b/lisp/faces.el index 4b582ac439..30f8483159 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1748,7 +1748,8 @@ The following sources are applied in this order: ; during loadup. (eq face 'scroll-bar)) ;; Set the `scroll-bar-foreground' and `scroll-bar-background' - ;; frame parameters. (bug#13476) + ;; frame parameters, because the face is handled by setting + ;; those two parameters. (bug#13476) (set-frame-parameter frame 'scroll-bar-foreground (face-foreground face)) (set-frame-parameter frame 'scroll-bar-background (face-background face))))) commit e361d0d7e5d3db8575d5d8673012aa4d7448ee54 Author: Po Lu Date: Tue Mar 1 20:15:02 2022 +0800 Add PropertyChangeMask to the standard event set * src/xfns.c (x_window): Remove special Motif code. * src/xterm.h (STANDARD_EVENT_SET): Add PropertyChangeMask. diff --git a/src/xfns.c b/src/xfns.c index 09bad71502..65218b3fc0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3803,13 +3803,8 @@ x_window (struct frame *f, long window_prompting) FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend, NULL, 0); -#if !defined USE_MOTIF || !defined HAVE_XINPUT2 /* Make all the standard events reach the Emacs frame. */ attributes.event_mask = STANDARD_EVENT_SET; -#else - /* This is used for Motif menus. */ - attributes.event_mask = STANDARD_EVENT_SET | PropertyChangeMask; -#endif #ifdef HAVE_X_I18N if (FRAME_XIC (f)) diff --git a/src/xterm.h b/src/xterm.h index f6c251649f..7f45e2f172 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -132,6 +132,7 @@ INLINE_HEADER_BEGIN | FocusChangeMask \ | LeaveWindowMask \ | EnterWindowMask \ + | PropertyChangeMask \ | VisibilityChangeMask) #ifdef HAVE_X11R6_XIM commit f980eed4c1b49393fb46f04538f2a9046cdfab2b Author: Po Lu Date: Tue Mar 1 19:15:46 2022 +0800 Fix crashes and other bugs on LessTif * lwlib/lwlib-Xm.c (make_menu_in_widget): XmIsRowColumn is broken on the latest LessTif release, so avoid that here. * src/xfns.c (x_window): Add PropertyChangeMask which LessTif doesn't do itself. diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 1b8675c0ed..a1114d4255 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -496,9 +496,11 @@ make_menu_in_widget (widget_instance* instance, ; children = (Widget*)(void*)XtMalloc (num_children * sizeof (Widget)); +#ifndef LESSTIF_VERSION /* WIDGET should be a RowColumn. */ if (!XmIsRowColumn (widget)) emacs_abort (); +#endif /* Determine whether WIDGET is a menu bar. */ type = -1; diff --git a/src/xfns.c b/src/xfns.c index 65218b3fc0..09bad71502 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3803,8 +3803,13 @@ x_window (struct frame *f, long window_prompting) FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols, XA_ATOM, 32, PropModeAppend, NULL, 0); +#if !defined USE_MOTIF || !defined HAVE_XINPUT2 /* Make all the standard events reach the Emacs frame. */ attributes.event_mask = STANDARD_EVENT_SET; +#else + /* This is used for Motif menus. */ + attributes.event_mask = STANDARD_EVENT_SET | PropertyChangeMask; +#endif #ifdef HAVE_X_I18N if (FRAME_XIC (f)) commit ad0fb40ae6921a265c6d21ed542cf6144eee0c51 Author: Po Lu Date: Tue Mar 1 18:38:08 2022 +0800 Fix reporting of wheel events on top of GTK scroll bars * src/gtkutil.c (xg_update_scrollbar_pos): (xg_update_horizontal_scrollbar_pos): Stop ensuring the window is native. (xg_event_is_for_scrollbar): New variable `for_valuator'. All callers changed. * src/gtkutil.h: Update prototypes. * src/xterm.c (handle_one_xevent): Drop all valuator change events destined for scroll bars. diff --git a/src/gtkutil.c b/src/gtkutil.c index d4726014c0..4f9907f795 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -4637,11 +4637,6 @@ xg_update_scrollbar_pos (struct frame *f, gtk_widget_set_size_request (wscroll, width, height); } -#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0) - if (!gdk_window_ensure_native (gtk_widget_get_window (wscroll))) - emacs_abort (); -#endif - if (oldx != -1 && oldw > 0 && oldh > 0) { /* Clear under old scroll bar position. */ @@ -4741,11 +4736,6 @@ xg_update_horizontal_scrollbar_pos (struct frame *f, pgtk_clear_area (f, oldx, oldy, oldw, oldh); #endif -#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0) - if (!gdk_window_ensure_native (gtk_widget_get_window (wscroll))) - emacs_abort (); -#endif - /* GTK does not redraw until the main loop is entered again, but if there are no X events pending we will not enter it. So we sync here to get some events. */ @@ -4911,7 +4901,8 @@ xg_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar, frame. This function does additional checks. */ bool -xg_event_is_for_scrollbar (struct frame *f, const EVENT *event) +xg_event_is_for_scrollbar (struct frame *f, const EVENT *event, + bool for_valuator) { bool retval = 0; @@ -4924,7 +4915,8 @@ xg_event_is_for_scrollbar (struct frame *f, const EVENT *event) && (event->xgeneric.evtype == XI_ButtonPress && xev->detail < 4)) || (event->type == ButtonPress - && event->xbutton.button < 4))) + && event->xbutton.button < 4) + || for_valuator)) #else if (f #ifndef HAVE_PGTK diff --git a/src/gtkutil.h b/src/gtkutil.h index b74244d84d..63ecac0790 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -148,7 +148,8 @@ extern void xg_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole); -extern bool xg_event_is_for_scrollbar (struct frame *, const EVENT *); +extern bool xg_event_is_for_scrollbar (struct frame *, const EVENT *, + bool for_valuator); extern int xg_get_default_scrollbar_width (struct frame *f); extern int xg_get_default_scrollbar_height (struct frame *f); diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 54b65ac54e..84e20235fd 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -5957,7 +5957,7 @@ motion_notify_event (GtkWidget * widget, GdkEvent * event, clear_mouse_face (hlinfo); } - if (f && xg_event_is_for_scrollbar (f, event)) + if (f && xg_event_is_for_scrollbar (f, event, false)) f = 0; if (f) { diff --git a/src/xterm.c b/src/xterm.c index ec17203fcd..f5ce42fc27 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10899,7 +10899,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window); #ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) + if (f && xg_event_is_for_scrollbar (f, event, false)) f = 0; #endif #ifdef HAVE_XWIDGETS @@ -11203,7 +11203,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, memset (&compose_status, 0, sizeof (compose_status)); dpyinfo->last_mouse_glyph_frame = NULL; - f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window); + f = mouse_or_wdesc_frame (dpyinfo, event->xbutton.window); if (f && event->xbutton.type == ButtonPress && !popup_activated () && !x_window_to_scroll_bar (event->xbutton.display, @@ -11228,7 +11228,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) + if (f && xg_event_is_for_scrollbar (f, event, false)) f = 0; #endif if (f) @@ -11733,7 +11733,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, int scroll_height; Lisp_Object window; - /* See the comment on top of x_init_master_valuators for more details on how scroll wheel movement is reported on XInput 2. */ @@ -11763,6 +11762,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, } } +#ifdef USE_GTK + if (f && xg_event_is_for_scrollbar (f, event, true)) + *finish = X_EVENT_DROP; +#endif + if (FRAME_X_WINDOW (f) != xev->event) XTranslateCoordinates (dpyinfo->display, xev->event, FRAME_X_WINDOW (f), @@ -11882,11 +11886,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, inev.ie.arg = list3 (Qnil, make_float (total_x), make_float (total_y)); - -#ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) - *finish = X_EVENT_DROP; -#endif } else { @@ -11953,7 +11952,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, f = mouse_or_wdesc_frame (dpyinfo, xev->event); #ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) + if (f && xg_event_is_for_scrollbar (f, event, false)) f = 0; #endif if (f) @@ -12138,7 +12137,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #ifdef USE_GTK - if (f && xg_event_is_for_scrollbar (f, event)) + if (f && xg_event_is_for_scrollbar (f, event, false)) f = 0; #endif commit b8bc359bbfd36b3e281bdcba154ed74ca897d850 Author: Paul Eggert Date: Wed Feb 23 11:29:56 2022 -0800 Backport: Port pre-commit hook to Git 2.35.0 * build-aux/git-hooks/pre-commit: Use LC_ALL=C grep -E instead of sane_egrep (removed in Git 2.35.0). (cherry picked from commit b8a96f055624f86fe965a0d1b7b2495b2db80e63) diff --git a/build-aux/git-hooks/pre-commit b/build-aux/git-hooks/pre-commit index a55004680f..49bf05f2d9 100755 --- a/build-aux/git-hooks/pre-commit +++ b/build-aux/git-hooks/pre-commit @@ -45,7 +45,9 @@ git_diff='git diff --cached --name-only --diff-filter=A' # 'git diff' will backslash escape tabs and newlines, so we don't have # to worry about word splitting here. -$git_diff $head | sane_egrep 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' | while IFS= read -r new_name; do +$git_diff $head | +LC_ALL=C grep -E 'ChangeLog|^-|/-|[^-+./_0-9A-Z_a-z]' | +while IFS= read -r new_name; do case $new_name in -* | */-*) echo "$new_name: File name component begins with '-'."