diff options
| author | Glenn Morris | 2020-04-11 07:50:12 -0700 |
|---|---|---|
| committer | Glenn Morris | 2020-04-11 07:50:12 -0700 |
| commit | 1988ffbaed709dfc71126efbf06644476830f07e (patch) | |
| tree | fdc98855a3ab7bf6d6cb4c8826ec4a9dfc603d33 /src | |
| parent | b902d7c9d07b2cc951fa5c789d585d65366d19d2 (diff) | |
| parent | fd27685c1e68e742abf1698573dac53743f15e48 (diff) | |
| download | emacs-1988ffbaed709dfc71126efbf06644476830f07e.tar.gz emacs-1988ffbaed709dfc71126efbf06644476830f07e.zip | |
Merge from origin/emacs-27
fd27685c1e (origin/emacs-27) ; * doc/lispref/keymaps.texi (Extended M...
6057d79a4e * doc/lispref/keymaps.texi (Extended Menu Items): Tweak :k...
17a1bb5a03 Fix redisplay when scrolling under redisplay-dont-pause
90321f595c Fix face extension in pulse.el
36c42d2a30 * doc/misc/tramp.texi (Bug Reports): Avoid line breaks in ...
d5750af151 Avoid assertion violation in intervals.c
18d1bc0a09 Improve documentation of 'jit-lock-contextually'
08486f4cae Speed up 'resize-mode' child frames a little
f451ef9308 ; * etc/NEWS: Mention 'executing-macro' in removed vars.
c49d379f17 Fix some problems with moving and resizing child frames
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/frame.c | 1 | ||||
| -rw-r--r-- | src/gtkutil.c | 41 | ||||
| -rw-r--r-- | src/intervals.c | 2 | ||||
| -rw-r--r-- | src/xfns.c | 56 | ||||
| -rw-r--r-- | src/xterm.c | 43 |
6 files changed, 121 insertions, 26 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index d79ae836c56..5b6fa51a563 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3683,6 +3683,10 @@ update_window (struct window *w, bool force_p) | |||
| 3683 | W->output_cursor doesn't contain the cursor location. */ | 3683 | W->output_cursor doesn't contain the cursor location. */ |
| 3684 | gui_update_window_end (w, !paused_p, mouse_face_overwritten_p); | 3684 | gui_update_window_end (w, !paused_p, mouse_face_overwritten_p); |
| 3685 | #endif | 3685 | #endif |
| 3686 | /* If the update wasn't interrupted, this window has been | ||
| 3687 | completely updated. */ | ||
| 3688 | if (!paused_p) | ||
| 3689 | w->must_be_updated_p = false; | ||
| 3686 | } | 3690 | } |
| 3687 | else | 3691 | else |
| 3688 | paused_p = 1; | 3692 | paused_p = 1; |
diff --git a/src/frame.c b/src/frame.c index 884de2f5349..c871e4fd994 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -5930,6 +5930,7 @@ syms_of_frame (void) | |||
| 5930 | DEFSYM (Qxg_frame_set_char_size_1, "xg-frame-set-char-size-1"); | 5930 | DEFSYM (Qxg_frame_set_char_size_1, "xg-frame-set-char-size-1"); |
| 5931 | DEFSYM (Qxg_frame_set_char_size_2, "xg-frame-set-char-size-2"); | 5931 | DEFSYM (Qxg_frame_set_char_size_2, "xg-frame-set-char-size-2"); |
| 5932 | DEFSYM (Qxg_frame_set_char_size_3, "xg-frame-set-char-size-3"); | 5932 | DEFSYM (Qxg_frame_set_char_size_3, "xg-frame-set-char-size-3"); |
| 5933 | DEFSYM (Qxg_frame_set_char_size_4, "xg-frame-set-char-size-4"); | ||
| 5933 | DEFSYM (Qx_set_window_size_1, "x-set-window-size-1"); | 5934 | DEFSYM (Qx_set_window_size_1, "x-set-window-size-1"); |
| 5934 | DEFSYM (Qx_set_window_size_2, "x-set-window-size-2"); | 5935 | DEFSYM (Qx_set_window_size_2, "x-set-window-size-2"); |
| 5935 | DEFSYM (Qx_set_window_size_3, "x-set-window-size-3"); | 5936 | DEFSYM (Qx_set_window_size_3, "x-set-window-size-3"); |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 338c6036c2c..681f86f51ba 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -941,9 +941,8 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight) | |||
| 941 | } | 941 | } |
| 942 | } | 942 | } |
| 943 | 943 | ||
| 944 | /* Resize the outer window of frame F after changing the height. | 944 | /** Resize the outer window of frame F. WIDTH and HEIGHT are the new |
| 945 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ | 945 | pixel sizes of F's text area. */ |
| 946 | |||
| 947 | void | 946 | void |
| 948 | xg_frame_set_char_size (struct frame *f, int width, int height) | 947 | xg_frame_set_char_size (struct frame *f, int width, int height) |
| 949 | { | 948 | { |
| @@ -954,6 +953,8 @@ xg_frame_set_char_size (struct frame *f, int width, int height) | |||
| 954 | int totalheight | 953 | int totalheight |
| 955 | = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f); | 954 | = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f); |
| 956 | int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f); | 955 | int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f); |
| 956 | bool was_visible = false; | ||
| 957 | bool hide_child_frame; | ||
| 957 | 958 | ||
| 958 | if (FRAME_PIXEL_HEIGHT (f) == 0) | 959 | if (FRAME_PIXEL_HEIGHT (f) == 0) |
| 959 | return; | 960 | return; |
| @@ -996,12 +997,42 @@ xg_frame_set_char_size (struct frame *f, int width, int height) | |||
| 996 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 997 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 997 | totalwidth, gheight); | 998 | totalwidth, gheight); |
| 998 | } | 999 | } |
| 1000 | else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f)) | ||
| 1001 | { | ||
| 1002 | was_visible = true; | ||
| 1003 | hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide); | ||
| 1004 | |||
| 1005 | if (totalwidth != gwidth || totalheight != gheight) | ||
| 1006 | { | ||
| 1007 | frame_size_history_add | ||
| 1008 | (f, Qxg_frame_set_char_size_4, width, height, | ||
| 1009 | list2i (totalwidth, totalheight)); | ||
| 1010 | |||
| 1011 | if (hide_child_frame) | ||
| 1012 | { | ||
| 1013 | block_input (); | ||
| 1014 | gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f)); | ||
| 1015 | unblock_input (); | ||
| 1016 | } | ||
| 1017 | |||
| 1018 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | ||
| 1019 | totalwidth, totalheight); | ||
| 1020 | |||
| 1021 | if (hide_child_frame) | ||
| 1022 | { | ||
| 1023 | block_input (); | ||
| 1024 | gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); | ||
| 1025 | unblock_input (); | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | fullscreen = Qnil; | ||
| 1029 | } | ||
| 1030 | } | ||
| 999 | else | 1031 | else |
| 1000 | { | 1032 | { |
| 1001 | frame_size_history_add | 1033 | frame_size_history_add |
| 1002 | (f, Qxg_frame_set_char_size_3, width, height, | 1034 | (f, Qxg_frame_set_char_size_3, width, height, |
| 1003 | list2i (totalwidth, totalheight)); | 1035 | list2i (totalwidth, totalheight)); |
| 1004 | |||
| 1005 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 1036 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 1006 | totalwidth, totalheight); | 1037 | totalwidth, totalheight); |
| 1007 | fullscreen = Qnil; | 1038 | fullscreen = Qnil; |
| @@ -1017,7 +1048,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) | |||
| 1017 | size as fast as possible. | 1048 | size as fast as possible. |
| 1018 | For unmapped windows, we can set rows/cols. When | 1049 | For unmapped windows, we can set rows/cols. When |
| 1019 | the frame is mapped again we will (hopefully) get the correct size. */ | 1050 | the frame is mapped again we will (hopefully) get the correct size. */ |
| 1020 | if (FRAME_VISIBLE_P (f)) | 1051 | if (FRAME_VISIBLE_P (f) && !was_visible) |
| 1021 | { | 1052 | { |
| 1022 | /* Must call this to flush out events */ | 1053 | /* Must call this to flush out events */ |
| 1023 | (void)gtk_events_pending (); | 1054 | (void)gtk_events_pending (); |
diff --git a/src/intervals.c b/src/intervals.c index 594d8924ebc..d4a734c923c 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -1187,7 +1187,7 @@ delete_interval (register INTERVAL i) | |||
| 1187 | register INTERVAL parent; | 1187 | register INTERVAL parent; |
| 1188 | ptrdiff_t amt = LENGTH (i); | 1188 | ptrdiff_t amt = LENGTH (i); |
| 1189 | 1189 | ||
| 1190 | eassert (amt == 0); /* Only used on zero-length intervals now. */ | 1190 | eassert (amt <= 0); /* Only used on zero total-length intervals now. */ |
| 1191 | 1191 | ||
| 1192 | if (ROOT_INTERVAL_P (i)) | 1192 | if (ROOT_INTERVAL_P (i)) |
| 1193 | { | 1193 | { |
diff --git a/src/xfns.c b/src/xfns.c index ebe51b70a56..10e1b5e58c2 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -861,6 +861,12 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu | |||
| 861 | (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 861 | (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 862 | p ? FRAME_X_WINDOW (p) : DefaultRootWindow (FRAME_X_DISPLAY (f)), | 862 | p ? FRAME_X_WINDOW (p) : DefaultRootWindow (FRAME_X_DISPLAY (f)), |
| 863 | f->left_pos, f->top_pos); | 863 | f->left_pos, f->top_pos); |
| 864 | #ifdef USE_GTK | ||
| 865 | if (EQ (x_gtk_resize_child_frames, Qresize_mode)) | ||
| 866 | gtk_container_set_resize_mode | ||
| 867 | (GTK_CONTAINER (FRAME_GTK_OUTER_WIDGET (f)), | ||
| 868 | p ? GTK_RESIZE_IMMEDIATE : GTK_RESIZE_QUEUE); | ||
| 869 | #endif | ||
| 864 | unblock_input (); | 870 | unblock_input (); |
| 865 | 871 | ||
| 866 | fset_parent_frame (f, new_value); | 872 | fset_parent_frame (f, new_value); |
| @@ -4078,6 +4084,11 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4078 | block_input (); | 4084 | block_input (); |
| 4079 | XReparentWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 4085 | XReparentWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 4080 | FRAME_X_WINDOW (p), f->left_pos, f->top_pos); | 4086 | FRAME_X_WINDOW (p), f->left_pos, f->top_pos); |
| 4087 | #ifdef USE_GTK | ||
| 4088 | if (EQ (x_gtk_resize_child_frames, Qresize_mode)) | ||
| 4089 | gtk_container_set_resize_mode | ||
| 4090 | (GTK_CONTAINER (FRAME_GTK_OUTER_WIDGET (f)), GTK_RESIZE_IMMEDIATE); | ||
| 4091 | #endif | ||
| 4081 | unblock_input (); | 4092 | unblock_input (); |
| 4082 | } | 4093 | } |
| 4083 | 4094 | ||
| @@ -7734,6 +7745,22 @@ Note: Text drawn with the `x' font backend is shown with hollow boxes. */) | |||
| 7734 | #endif /* USE_GTK */ | 7745 | #endif /* USE_GTK */ |
| 7735 | #endif /* USE_CAIRO */ | 7746 | #endif /* USE_CAIRO */ |
| 7736 | 7747 | ||
| 7748 | #ifdef USE_GTK | ||
| 7749 | #ifdef HAVE_GTK3 | ||
| 7750 | DEFUN ("x-gtk-debug", Fx_gtk_debug, Sx_gtk_debug, 1, 1, 0, | ||
| 7751 | doc: /* Toggle interactive GTK debugging. */) | ||
| 7752 | (Lisp_Object enable) | ||
| 7753 | { | ||
| 7754 | gboolean enable_debug = !NILP (enable); | ||
| 7755 | |||
| 7756 | block_input (); | ||
| 7757 | gtk_window_set_interactive_debugging (enable_debug); | ||
| 7758 | unblock_input (); | ||
| 7759 | |||
| 7760 | return NILP (enable) ? Qnil : Qt; | ||
| 7761 | } | ||
| 7762 | #endif /* HAVE_GTK3 */ | ||
| 7763 | #endif /* USE_GTK */ | ||
| 7737 | 7764 | ||
| 7738 | /*********************************************************************** | 7765 | /*********************************************************************** |
| 7739 | Initialization | 7766 | Initialization |
| @@ -7802,6 +7829,8 @@ syms_of_xfns (void) | |||
| 7802 | DEFSYM (Qfont_parameter, "font-parameter"); | 7829 | DEFSYM (Qfont_parameter, "font-parameter"); |
| 7803 | DEFSYM (Qmono, "mono"); | 7830 | DEFSYM (Qmono, "mono"); |
| 7804 | DEFSYM (Qassq_delete_all, "assq-delete-all"); | 7831 | DEFSYM (Qassq_delete_all, "assq-delete-all"); |
| 7832 | DEFSYM (Qhide, "hide"); | ||
| 7833 | DEFSYM (Qresize_mode, "resize-mode"); | ||
| 7805 | 7834 | ||
| 7806 | #ifdef USE_CAIRO | 7835 | #ifdef USE_CAIRO |
| 7807 | DEFSYM (Qpdf, "pdf"); | 7836 | DEFSYM (Qpdf, "pdf"); |
| @@ -7978,6 +8007,28 @@ Otherwise use Emacs own tooltip implementation. | |||
| 7978 | When using Gtk+ tooltips, the tooltip face is not used. */); | 8007 | When using Gtk+ tooltips, the tooltip face is not used. */); |
| 7979 | x_gtk_use_system_tooltips = true; | 8008 | x_gtk_use_system_tooltips = true; |
| 7980 | 8009 | ||
| 8010 | DEFVAR_LISP ("x-gtk-resize-child-frames", x_gtk_resize_child_frames, | ||
| 8011 | doc: /* If non-nil, resize child frames specially with GTK builds. | ||
| 8012 | If this is nil, resize child frames like any other frames. This is the | ||
| 8013 | default and usually works with most desktops. Some desktop environments | ||
| 8014 | (GNOME shell in particular when using the mutter window manager), | ||
| 8015 | however, may refuse to resize a child frame when Emacs is built with | ||
| 8016 | GTK3. For those environments, the two settings below are provided. | ||
| 8017 | |||
| 8018 | If this equals the symbol 'hide', Emacs temporarily hides the child | ||
| 8019 | frame during resizing. This approach seems to work reliably, may | ||
| 8020 | however induce some flicker when the frame is made visible again. | ||
| 8021 | |||
| 8022 | If this equals the symbol 'resize-mode', Emacs uses GTK's resize mode to | ||
| 8023 | always trigger an immediate resize of the child frame. This method is | ||
| 8024 | deprecated by GTK and may not work in future versions of that toolkit. | ||
| 8025 | It also may freeze Emacs when used with other desktop environments. It | ||
| 8026 | avoids, however, the unpleasent flicker induced by the hiding approach. | ||
| 8027 | |||
| 8028 | This variable is considered a temporary workaround and will be hopefully | ||
| 8029 | eliminated in future versions of Emacs. */); | ||
| 8030 | x_gtk_resize_child_frames = Qnil; | ||
| 8031 | |||
| 7981 | /* Tell Emacs about this window system. */ | 8032 | /* Tell Emacs about this window system. */ |
| 7982 | Fprovide (Qx, Qnil); | 8033 | Fprovide (Qx, Qnil); |
| 7983 | 8034 | ||
| @@ -8093,4 +8144,9 @@ When using Gtk+ tooltips, the tooltip face is not used. */); | |||
| 8093 | defsubr (&Sx_print_frames_dialog); | 8144 | defsubr (&Sx_print_frames_dialog); |
| 8094 | #endif | 8145 | #endif |
| 8095 | #endif | 8146 | #endif |
| 8147 | #ifdef USE_GTK | ||
| 8148 | #ifdef HAVE_GTK3 | ||
| 8149 | defsubr (&Sx_gtk_debug); | ||
| 8150 | #endif | ||
| 8151 | #endif | ||
| 8096 | } | 8152 | } |
diff --git a/src/xterm.c b/src/xterm.c index bd9688fda81..ae5dad92897 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10613,26 +10613,29 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ | |||
| 10613 | modified_left, modified_top); | 10613 | modified_left, modified_top); |
| 10614 | #endif | 10614 | #endif |
| 10615 | 10615 | ||
| 10616 | x_sync_with_move (f, f->left_pos, f->top_pos, | 10616 | /* 'x_sync_with_move' is too costly for dragging child frames. */ |
| 10617 | FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN); | 10617 | if (!FRAME_PARENT_FRAME (f)) |
| 10618 | 10618 | { | |
| 10619 | /* change_gravity is non-zero when this function is called from Lisp to | 10619 | x_sync_with_move (f, f->left_pos, f->top_pos, |
| 10620 | programmatically move a frame. In that case, we call | 10620 | FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN); |
| 10621 | x_check_expected_move to discover if we have a "Type A" or "Type B" | 10621 | |
| 10622 | window manager, and, for a "Type A" window manager, adjust the position | 10622 | /* change_gravity is non-zero when this function is called from Lisp to |
| 10623 | of the frame. | 10623 | programmatically move a frame. In that case, we call |
| 10624 | 10624 | x_check_expected_move to discover if we have a "Type A" or "Type B" | |
| 10625 | We call x_check_expected_move if a programmatic move occurred, and | 10625 | window manager, and, for a "Type A" window manager, adjust the position |
| 10626 | either the window manager type (A/B) is unknown or it is Type A but we | 10626 | of the frame. |
| 10627 | need to compute the top/left offset adjustment for this frame. */ | 10627 | |
| 10628 | 10628 | We call x_check_expected_move if a programmatic move occurred, and | |
| 10629 | if (change_gravity != 0 | 10629 | either the window manager type (A/B) is unknown or it is Type A but we |
| 10630 | && !FRAME_PARENT_FRAME (f) | 10630 | need to compute the top/left offset adjustment for this frame. */ |
| 10631 | && (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN | 10631 | |
| 10632 | || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A | 10632 | if (change_gravity != 0 |
| 10633 | && (FRAME_X_OUTPUT (f)->move_offset_left == 0 | 10633 | && (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN |
| 10634 | && FRAME_X_OUTPUT (f)->move_offset_top == 0)))) | 10634 | || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A |
| 10635 | x_check_expected_move (f, modified_left, modified_top); | 10635 | && (FRAME_X_OUTPUT (f)->move_offset_left == 0 |
| 10636 | && FRAME_X_OUTPUT (f)->move_offset_top == 0)))) | ||
| 10637 | x_check_expected_move (f, modified_left, modified_top); | ||
| 10638 | } | ||
| 10636 | 10639 | ||
| 10637 | unblock_input (); | 10640 | unblock_input (); |
| 10638 | } | 10641 | } |