diff options
author | Martin Rudalics <rudalics@gmx.at> | 2013-12-03 08:45:54 +0100 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2013-12-03 08:45:54 +0100 |
commit | 7303a0aefc1fbabfea1b6b7711a6da2289aecdb2 (patch) | |
tree | 3d00b2cab57dac461a9810a9a77f7bdeefd4fbf1 /src/gtkutil.c | |
parent | 39fa32d6359c8292dd91ce1c58da1aa3f8668bd8 (diff) |
Fix issues related to pixelwise resizing. (Bug#16013) (Bug#16033)
* window.c (Fset_window_new_pixel): Don't choke at negative
argument value (Bug#16033).
* xfns.c (Fx_create_frame): Add another call to change_frame_size
to avoid crash in window_box_height.
* gtkutil.h: Fix external declaration of xg_frame_set_char_size.
* gtkutil.c (xg_frame_set_char_size, style_changed_cb): Fix size
calculation.
* xterm.c (x_set_window_size): Fix size calculation (Bug#16013).
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index d30a68a419..4ecdd18aeb 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -940,26 +940,12 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight) void xg_frame_set_char_size (struct frame *f, int width, int height) { - int pixelwidth; + int pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); int pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); if (FRAME_PIXEL_HEIGHT (f) == 0) return; - /* Take into account the size of the scroll bar. Always use the - number of columns occupied by the scroll bar here otherwise we - might end up with a frame width that is not a multiple of the - frame's character width which is bad for vertically split - windows. */ - f->scroll_bar_actual_width - = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); - - compute_fringe_widths (f, 0); - - /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it - after calculating that value. */ - pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); - /* Do this before resize, as we don't know yet if we will be resized. */ xg_clear_under_internal_border (f); @@ -987,11 +973,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) x_wait_for_event (f, ConfigureNotify); } else - { - change_frame_size (f, width, height, 0, 1, 0, 1); - FRAME_PIXEL_WIDTH (f) = pixelwidth; - FRAME_PIXEL_HEIGHT (f) = pixelheight; - } + change_frame_size (f, width, height, 0, 1, 0, 1); } /* Handle height/width changes (i.e. add/remove/move menu/toolbar). @@ -1095,7 +1077,7 @@ style_changed_cb (GObject *go, && FRAME_X_DISPLAY (f) == dpy) { x_set_scroll_bar_default_width (f); - xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); + xg_frame_set_char_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f)); } } } |