diff --git a/src/frame.h b/src/frame.h index bff610472c0..df73e63eb69 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1428,23 +1428,6 @@ #define AUTO_FRAME_ARG(name, parameter, value) \ /* False means there are no visible garbaged frames. */ extern bool frame_garbaged; -/* Set visibility of frame F. - We call redisplay_other_windows to make sure the frame gets redisplayed - if some changes were applied to it while it wasn't visible (and hence - wasn't redisplayed). */ -INLINE void -SET_FRAME_VISIBLE (struct frame *f, bool v) -{ - if (v) - { - if (v == 1 && f->visible != 1) - redisplay_other_windows (); - if (FRAME_GARBAGED_P (f)) - frame_garbaged = true; - } - f->visible = v; -} - /* Set iconified status of frame F. */ INLINE void SET_FRAME_ICONIFIED (struct frame *f, int i) @@ -1541,6 +1524,31 @@ #define SELECTED_FRAME() \ ? XFRAME (selected_frame) \ : (emacs_abort (), (struct frame *) 0)) +/* Set visibility of frame F. + We call redisplay_other_windows to make sure the frame gets redisplayed + if some changes were applied to it while it wasn't visible (and hence + wasn't redisplayed). */ +INLINE void +SET_FRAME_VISIBLE (struct frame *f, bool v) +{ + if (v) + { + if (v == 1 && f->visible != 1) + redisplay_other_windows (); + if (FRAME_GARBAGED_P (f)) + frame_garbaged = true; + } + else if (is_tty_child_frame (f) && f == XFRAME (selected_frame)) + { + struct frame *r = root_frame (f); + Lisp_Object frame; + + XSETFRAME (frame, r); + Fselect_frame (frame, Qnil); + } + + f->visible = v; +} /*********************************************************************** Display-related Macros