aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-07-03 14:30:12 +0800
committerPo Lu2023-07-03 14:30:12 +0800
commita273b95fa505182dfa4686782c464165e14813ba (patch)
tree80a94b8e72c0f91256d9665a123d01b58dd7922d /src
parent61a38b470de2f9796ccf8273eca09622abc43368 (diff)
parentd679f9e388cde367d8d0c2e438b62a16ec1aca67 (diff)
downloademacs-a273b95fa505182dfa4686782c464165e14813ba.tar.gz
emacs-a273b95fa505182dfa4686782c464165e14813ba.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
-rw-r--r--src/frame.c13
-rw-r--r--src/xfns.c1
-rw-r--r--src/xselect.c34
3 files changed, 41 insertions, 7 deletions
diff --git a/src/frame.c b/src/frame.c
index eee72954ac1..65711106671 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -6851,4 +6851,17 @@ iconify the top level frame instead. */);
6851 defsubr (&Sx_parse_geometry); 6851 defsubr (&Sx_parse_geometry);
6852 defsubr (&Sreconsider_frame_fonts); 6852 defsubr (&Sreconsider_frame_fonts);
6853#endif 6853#endif
6854
6855#ifdef HAVE_WINDOW_SYSTEM
6856 DEFSYM (Qmove_toolbar, "move-toolbar");
6857
6858 /* The `tool-bar-position' frame parameter is supported on GTK and
6859 builds using the internal tool bar. Providing this feature
6860 causes menu-bar.el to provide `tool-bar-position' as a user
6861 option. */
6862
6863#if !defined HAVE_EXT_TOOL_BAR || defined USE_GTK
6864 Fprovide (Qmove_toolbar, Qnil);
6865#endif /* !HAVE_EXT_TOOL_BAR || USE_GTK */
6866#endif /* HAVE_WINDOW_SYSTEM */
6854} 6867}
diff --git a/src/xfns.c b/src/xfns.c
index 2046999cf5d..12aef228c3a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -10459,7 +10459,6 @@ eliminated in future versions of Emacs. */);
10459 accepts --with-x-toolkit=gtk. */ 10459 accepts --with-x-toolkit=gtk. */
10460 Fprovide (intern_c_string ("x-toolkit"), Qnil); 10460 Fprovide (intern_c_string ("x-toolkit"), Qnil);
10461 Fprovide (intern_c_string ("gtk"), Qnil); 10461 Fprovide (intern_c_string ("gtk"), Qnil);
10462 Fprovide (intern_c_string ("move-toolbar"), Qnil);
10463 10462
10464 DEFVAR_LISP ("gtk-version-string", Vgtk_version_string, 10463 DEFVAR_LISP ("gtk-version-string", Vgtk_version_string,
10465 doc: /* Version info for GTK+. */); 10464 doc: /* Version info for GTK+. */);
diff --git a/src/xselect.c b/src/xselect.c
index 40be6d4c00c..c38a1f8b6a9 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1989,9 +1989,22 @@ receive_incremental_selection (struct x_display_info *dpyinfo,
1989} 1989}
1990 1990
1991 1991
1992
1993/* Free the selection data allocated inside *DATA, which is actually a
1994 pointer to unsigned char *. */
1995
1996static void
1997x_free_selection_data (void *data)
1998{
1999 unsigned char **ptr;
2000
2001 ptr = data;
2002 xfree (*ptr);
2003}
2004
1992/* Fetch a value from property PROPERTY of X window WINDOW on display 2005/* Fetch a value from property PROPERTY of X window WINDOW on display
1993 DISPLAY. TARGET_TYPE and SELECTION_ATOM are used in error message 2006 DISPLAY. TARGET_TYPE and SELECTION_ATOM are used in the error
1994 if this fails. */ 2007 message signaled if this fails. */
1995 2008
1996static Lisp_Object 2009static Lisp_Object
1997x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo, 2010x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
@@ -2007,6 +2020,7 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
2007 ptrdiff_t bytes = 0, array_bytes; 2020 ptrdiff_t bytes = 0, array_bytes;
2008 Lisp_Object val; 2021 Lisp_Object val;
2009 Display *display = dpyinfo->display; 2022 Display *display = dpyinfo->display;
2023 specpdl_ref count;
2010 2024
2011 /* array_bytes is only used as an argument to xpalloc. The actual 2025 /* array_bytes is only used as an argument to xpalloc. The actual
2012 size of the data inside the buffer is inside bytes. */ 2026 size of the data inside the buffer is inside bytes. */
@@ -2042,6 +2056,13 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
2042 } 2056 }
2043 } 2057 }
2044 2058
2059 /* Make sure DATA is freed even if `receive_incremental_connection'
2060 quits. Use xfree, not XFree, because x_get_window_property calls
2061 xmalloc itself. */
2062
2063 count = SPECPDL_INDEX ();
2064 record_unwind_protect_ptr (x_free_selection_data, &data);
2065
2045 if (!for_multiple && actual_type == dpyinfo->Xatom_INCR) 2066 if (!for_multiple && actual_type == dpyinfo->Xatom_INCR)
2046 { 2067 {
2047 /* That wasn't really the data, just the beginning. */ 2068 /* That wasn't really the data, just the beginning. */
@@ -2051,6 +2072,9 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
2051 /* Use xfree, not XFree, because x_get_window_property 2072 /* Use xfree, not XFree, because x_get_window_property
2052 calls xmalloc itself. */ 2073 calls xmalloc itself. */
2053 xfree (data); 2074 xfree (data);
2075
2076 /* In case quitting happens below. */
2077 data = NULL;
2054 unblock_input (); 2078 unblock_input ();
2055 2079
2056 /* Clear bytes again. Previously, receive_incremental_selection 2080 /* Clear bytes again. Previously, receive_incremental_selection
@@ -2077,10 +2101,8 @@ x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
2077 val = selection_data_to_lisp_data (dpyinfo, data, bytes, 2101 val = selection_data_to_lisp_data (dpyinfo, data, bytes,
2078 actual_type, actual_format); 2102 actual_type, actual_format);
2079 2103
2080 /* Use xfree, not XFree, because x_get_window_property 2104 /* This will also free `data'. */
2081 calls xmalloc itself. */ 2105 return unbind_to (count, val);
2082 xfree (data);
2083 return val;
2084} 2106}
2085 2107
2086/* These functions convert from the selection data read from the server into 2108/* These functions convert from the selection data read from the server into