aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMartin Rudalics2013-12-26 12:31:42 +0100
committerMartin Rudalics2013-12-26 12:31:42 +0100
commit0cbab19e6e5147fda4c89dcadd2826a35857b5ce (patch)
treea76904f11f07268a412df3037e8f677213e7baae /src/window.c
parente76119d7542b19eb03f8d725480cbf98f7fa03d9 (diff)
downloademacs-0cbab19e6e5147fda4c89dcadd2826a35857b5ce.tar.gz
emacs-0cbab19e6e5147fda4c89dcadd2826a35857b5ce.zip
Some more tinkering with Bug#16051.
* window.c (resize_frame_windows): Don't let the size of the root window drop below the frame's default character size. Never ever delete any subwindows - let the window manager do the clipping. * w32fns.c (x_set_tool_bar_lines): Rewrite calculation of number of toolbar lines needed when they exceed the height of the root window. (unwind_create_frame_1): New function. (Fx_create_frame): Generally inhibit calling the window configuration change hook here. Remove extra call to change_frame_size - it's not needed when we don't run the configuration change hook.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/window.c b/src/window.c
index 9939ec1d8fc..9bc95224f7c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4040,31 +4040,34 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4040 int old_pixel_size = horflag ? r->pixel_width : r->pixel_height; 4040 int old_pixel_size = horflag ? r->pixel_width : r->pixel_height;
4041 /* new_size is the new size of the frame's root window. */ 4041 /* new_size is the new size of the frame's root window. */
4042 int new_size, new_pixel_size; 4042 int new_size, new_pixel_size;
4043 int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f);
4043 4044
4045 /* Don't let the size drop below one unit. This is more comforting
4046 when we are called from x_set_tool_bar_lines since the latter may
4047 have implicitly given us a zero or negative height. */
4044 if (pixelwise) 4048 if (pixelwise)
4045 { 4049 {
4046 new_pixel_size 4050 new_pixel_size = max (horflag
4047 = (horflag 4051 ? size
4048 ? size 4052 : (size
4049 : (size 4053 - FRAME_TOP_MARGIN_HEIGHT (f)
4050 - FRAME_TOP_MARGIN_HEIGHT (f) 4054 - ((FRAME_HAS_MINIBUF_P (f)
4051 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) 4055 && !FRAME_MINIBUF_ONLY_P (f))
4052 ? FRAME_LINE_HEIGHT (f) : 0))); 4056 ? FRAME_LINE_HEIGHT (f) : 0)),
4053 new_size = new_pixel_size / (horflag 4057 unit);
4054 ? FRAME_COLUMN_WIDTH (f) 4058 new_size = new_pixel_size / unit;
4055 : FRAME_LINE_HEIGHT (f));
4056 } 4059 }
4057 else 4060 else
4058 { 4061 {
4059 new_size= (horflag 4062 new_size = max (horflag
4060 ? size 4063 ? size
4061 : (size 4064 : (size
4062 - FRAME_TOP_MARGIN (f) 4065 - FRAME_TOP_MARGIN (f)
4063 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) 4066 - ((FRAME_HAS_MINIBUF_P (f)
4064 ? 1 : 0))); 4067 && !FRAME_MINIBUF_ONLY_P (f))
4065 new_pixel_size = new_size * (horflag 4068 ? 1 : 0)),
4066 ? FRAME_COLUMN_WIDTH (f) 4069 1);
4067 : FRAME_LINE_HEIGHT (f)); 4070 new_pixel_size = new_size * unit;
4068 } 4071 }
4069 4072
4070 r->top_line = FRAME_TOP_MARGIN (f); 4073 r->top_line = FRAME_TOP_MARGIN (f);
@@ -4124,6 +4127,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4124 window_resize_apply (r, horflag); 4127 window_resize_apply (r, horflag);
4125 window_pixel_to_total (r->frame, horflag ? Qt : Qnil); 4128 window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
4126 } 4129 }
4130#if 0 /* Let's try without killing other windows. */
4127 else 4131 else
4128 { 4132 {
4129 /* We lost. Delete all windows but the frame's 4133 /* We lost. Delete all windows but the frame's
@@ -4141,6 +4145,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4141 XWINDOW (root)->pixel_height = new_pixel_size; 4145 XWINDOW (root)->pixel_height = new_pixel_size;
4142 } 4146 }
4143 } 4147 }
4148#endif /* 0 */
4144 } 4149 }
4145 } 4150 }
4146 } 4151 }