Commit 90caab3f authored by Martin Rudalics's avatar Martin Rudalics
Browse files

Remove some unused items introduced during pixelwise change.

* window.c (window_resize_total_check): Remove unused function.
* xdisp.c (remember_mouse_glyph): Remove unused label.
(Ftool_bar_height): Move declaration inside #if.
* xterm.c (x_set_window_size): Don't use r and c.
parent 6ae87264
2013-11-30 Martin Rudalics <rudalics@gmx.at>
Remove some unused items introduced during pixelwise change.
* window.c (window_resize_total_check): Remove unused function.
* xdisp.c (remember_mouse_glyph): Remove unused label.
(Ftool_bar_height): Move declaration inside #if.
* xterm.c (x_set_window_size): Don't use r and c.
2013-11-30 Juanma Barranquero <lekktu@gmail.com>
* xdisp.c (Fwindow_text_pixel_size): Remove unused variables
......
......@@ -3784,102 +3784,6 @@ window_resize_check (struct window *w, bool horflag)
: FRAME_LINE_HEIGHT (f)));
}
static int
window_resize_total_check (struct window *w, int horflag)
{
struct frame *f = XFRAME (w->frame);
struct window *c;
if (WINDOW_VERTICAL_COMBINATION_P (w))
/* W is a vertical combination. */
{
c = XWINDOW (w->contents);
if (horflag)
/* All child windows of W must have the same width as W. */
{
while (c)
{
if (XINT (c->new_pixel) != XINT (w->new_pixel)
/** || XINT (c->new_total != XINT (w->new_total)) **/
|| !window_resize_check (c, horflag))
return 0;
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return 1;
}
else
/* The sum of the heights of the child windows of W must equal
W's height. */
{
int sum_of_pixels = 0, sum_of_totals = 0;
while (c)
{
if (!window_resize_check (c, horflag))
return 0;
sum_of_pixels = sum_of_pixels + XINT (c->new_pixel);
/** sum_of_totals = sum_of_totals + XINT (c->new_total); **/
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return (sum_of_pixels == XINT (w->new_pixel)
/** && sum_of_totals == XINT (w->new_total) **/
);
}
}
else if (WINDOW_HORIZONTAL_COMBINATION_P (w))
/* W is a horizontal combination. */
{
c = XWINDOW (w->contents);
if (horflag)
/* The sum of the widths of the child windows of W must equal W's
width. */
{
int sum_of_pixels = 0, sum_of_totals = 0;
while (c)
{
if (!window_resize_check (c, horflag))
return 0;
sum_of_pixels = sum_of_pixels + XINT (c->new_pixel);
sum_of_totals = sum_of_totals + XINT (c->new_total);
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return (sum_of_pixels == XINT (w->new_pixel)
/** && sum_of_totals == XINT (w->new_total) **/
);
}
else
/* All child windows of W must have the same height as W. */
{
while (c)
{
if (XINT (c->new_pixel) != XINT (w->new_pixel)
/** || XINT (c->new_total) != XINT (w->new_total) **/
|| !window_resize_check (c, horflag))
return 0;
c = NILP (c->next) ? 0 : XWINDOW (c->next);
}
return 1;
}
}
else
/* A leaf window. Make sure it's not too small. The following
hardcodes the values of `window-safe-min-width' (2) and
`window-safe-min-height' (1) which are defined in window.el. */
return (XINT (w->new_pixel) >= (horflag
? (2 * FRAME_COLUMN_WIDTH (f))
: FRAME_LINE_HEIGHT (f))
/** && XINT (w->new_total) >= (horflag ? 2 : 1) **/
);
}
/* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to
w->new_pixel for window W and recursively all child windows of W.
......
......@@ -2484,7 +2484,6 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
goto store_rect;
}
 
pixelwise:
gx += WINDOW_LEFT_EDGE_X (w);
gy += WINDOW_TOP_EDGE_Y (w);
 
......@@ -12108,10 +12107,11 @@ If FRAME is nil or omitted, use the selected frame. Optional argument
PIXELWISE non-nil means return the height of the tool bar inpixels. */)
(Lisp_Object frame, Lisp_Object pixelwise)
{
struct frame *f = decode_any_frame (frame);
int height = 0;
 
#if ! defined (USE_GTK) && ! defined (HAVE_NS)
struct frame *f = decode_any_frame (frame);
if (WINDOWP (f->tool_bar_window)
&& WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0)
{
......
......@@ -8747,7 +8747,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
{
int r, c, text_width, text_height;
int text_width, text_height;
/* When the frame is maximized/fullscreen or running under for
example Xmonad, x_set_window_size_1 will be a no-op.
......@@ -8764,12 +8764,10 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
#endif
text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, FRAME_PIXEL_WIDTH (f));
text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelh);
r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
/* Update f->scroll_bar_actual_width because it is used in
FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */
f->scroll_bar_actual_width
= FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment