aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2017-10-01 10:17:17 +0200
committerMartin Rudalics2017-10-01 10:17:17 +0200
commitb03b4f6d79f1736f2455574aced92f89ed032d79 (patch)
treed1c6e321991f13f90b95dd2a90bded0263c7406c /src
parentba9139c501ed8220980e898f127e293e8f263ea1 (diff)
downloademacs-b03b4f6d79f1736f2455574aced92f89ed032d79.tar.gz
emacs-b03b4f6d79f1736f2455574aced92f89ed032d79.zip
Improve handling of iconification of child frames (Bug#28611)
* src/frame.c (Ficonify_frame): Handle `iconify-child-frame' option. (syms_of_frame): New symbols Qiconify_top_level and Qmake_invisible. (iconify_child_frame): New option. * lisp/cus-start.el (iconify-child-frame): Add customization properties. * doc/lispref/frames.texi (Child Frames): Describe new option `iconify-child-frame'. Don't index "top-level frame" twice.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c
index 39e5cc9c854..4ec54fa3473 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2535,10 +2535,33 @@ displayed in the terminal. */)
2535DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, 2535DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
2536 0, 1, "", 2536 0, 1, "",
2537 doc: /* Make the frame FRAME into an icon. 2537 doc: /* Make the frame FRAME into an icon.
2538If omitted, FRAME defaults to the currently selected frame. */) 2538If omitted, FRAME defaults to the currently selected frame.
2539
2540If FRAME is a child frame, consult the variable `iconify-child-frame'
2541for how to proceed. */)
2539 (Lisp_Object frame) 2542 (Lisp_Object frame)
2540{ 2543{
2541 struct frame *f = decode_live_frame (frame); 2544 struct frame *f = decode_live_frame (frame);
2545 Lisp_Object parent = f->parent_frame;
2546
2547 if (!NILP (parent))
2548 {
2549 if (NILP (iconify_child_frame))
2550 /* Do nothing. */
2551 return Qnil;
2552 else if (EQ (iconify_child_frame, Qiconify_top_level))
2553 {
2554 /* Iconify top level frame instead (the default). */
2555 Ficonify_frame (parent);
2556 return Qnil;
2557 }
2558 else if (EQ (iconify_child_frame, Qmake_invisible))
2559 {
2560 /* Make frame invisible instead. */
2561 Fmake_frame_invisible (frame, Qnil);
2562 return Qnil;
2563 }
2564 }
2542 2565
2543 /* Don't allow minibuf_window to remain on an iconified frame. */ 2566 /* Don't allow minibuf_window to remain on an iconified frame. */
2544 check_minibuf_window (frame, EQ (minibuf_window, selected_window)); 2567 check_minibuf_window (frame, EQ (minibuf_window, selected_window));
@@ -5713,6 +5736,8 @@ syms_of_frame (void)
5713 DEFSYM (Qheight_only, "height-only"); 5736 DEFSYM (Qheight_only, "height-only");
5714 DEFSYM (Qleft_only, "left-only"); 5737 DEFSYM (Qleft_only, "left-only");
5715 DEFSYM (Qtop_only, "top-only"); 5738 DEFSYM (Qtop_only, "top-only");
5739 DEFSYM (Qiconify_top_level, "iconify-top-level");
5740 DEFSYM (Qmake_invisible, "make-invisible");
5716 5741
5717 { 5742 {
5718 int i; 5743 int i;
@@ -6016,6 +6041,21 @@ This variable is effective only with the X toolkit (and there only when
6016Gtk+ tooltips are not used) and on Windows. */); 6041Gtk+ tooltips are not used) and on Windows. */);
6017 tooltip_reuse_hidden_frame = false; 6042 tooltip_reuse_hidden_frame = false;
6018 6043
6044 DEFVAR_LISP ("iconify-child-frame", iconify_child_frame,
6045 doc: /* How to handle iconification of child frames.
6046This variable tells Emacs how to proceed when it is asked to iconify a
6047child frame. If it is nil, `iconify-frame' will do nothing when invoked
6048on a child frame. If it is `iconify-top-level', Emacs will try to
6049iconify the top level frame associated with this child frame instead.
6050If it is `make-invisible', Emacs will try to make this child frame
6051invisible instead.
6052
6053Any other value means to try iconifying the child frame. Since such an
6054attempt is not honored by all window managers and may even lead to
6055making the child frame unresponsive to user actions, the default is to
6056iconify the top level frame instead. */);
6057 iconify_child_frame = Qiconify_top_level;
6058
6019 staticpro (&Vframe_list); 6059 staticpro (&Vframe_list);
6020 6060
6021 defsubr (&Sframep); 6061 defsubr (&Sframep);