aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xterm.c48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 7b316ca9ddd..ee0035234b5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -26167,18 +26167,52 @@ x_raise_frame (struct frame *f)
26167 unblock_input (); 26167 unblock_input ();
26168} 26168}
26169 26169
26170static void
26171x_lower_frame_1 (struct frame *f)
26172{
26173 Window *windows;
26174 Lisp_Object frame, tail;
26175 struct frame *sibling;
26176
26177 windows = alloca (2 * sizeof *windows);
26178
26179 /* Lowering a child frame leads to the window being put below any
26180 scroll bars on the parent. To avoid that, restack the child
26181 frame below all of its siblings instead of just lowering it. */
26182
26183 FOR_EACH_FRAME (tail, frame)
26184 {
26185 sibling = XFRAME (frame);
26186
26187 if (sibling == f)
26188 continue;
26189
26190 if (FRAME_PARENT_FRAME (sibling)
26191 != FRAME_PARENT_FRAME (f))
26192 continue;
26193
26194 windows[0] = FRAME_OUTER_WINDOW (sibling);
26195 windows[1] = FRAME_OUTER_WINDOW (f);
26196
26197 XRestackWindows (FRAME_X_DISPLAY (f), windows, 2);
26198 }
26199}
26200
26170/* Lower frame F. */ 26201/* Lower frame F. */
26171 26202
26172static void 26203static void
26173x_lower_frame (struct frame *f) 26204x_lower_frame (struct frame *f)
26174{ 26205{
26175 if (FRAME_VISIBLE_P (f)) 26206 if (FRAME_PARENT_FRAME (f)
26176 { 26207 && (FRAME_HAS_VERTICAL_SCROLL_BARS (FRAME_PARENT_FRAME (f))
26177 block_input (); 26208 || FRAME_HAS_HORIZONTAL_SCROLL_BARS (FRAME_PARENT_FRAME (f))))
26178 XLowerWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); 26209 x_lower_frame_1 (f);
26179 XFlush (FRAME_X_DISPLAY (f)); 26210 else
26180 unblock_input (); 26211 XLowerWindow (FRAME_X_DISPLAY (f),
26181 } 26212 FRAME_OUTER_WINDOW (f));
26213
26214 XFlush (FRAME_X_DISPLAY (f));
26215
26182#ifdef HAVE_XWIDGETS 26216#ifdef HAVE_XWIDGETS
26183 /* Make sure any X windows owned by xwidget views of the parent 26217 /* Make sure any X windows owned by xwidget views of the parent
26184 still display below the lowered frame. */ 26218 still display below the lowered frame. */