From c619527c15d2c0c88d5e73f102588f6c3d44ab73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 5 Dec 2013 17:20:11 +0100 Subject: [PATCH] Fix some pixelwise breakage, more remain. * nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width. * nsterm.m (x_set_window_size): Handle pixelwise. --- src/ChangeLog | 6 ++++++ src/nsfns.m | 2 ++ src/nsterm.m | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5aec2645907..9c536990bda 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-12-05 Jan Djärv + + * nsfns.m (ns_frame_parm_handlers): Add right/bottom_divider_width. + + * nsterm.m (x_set_window_size): Handle pixelwise. + 2013-12-05 Martin Rudalics * w32term.c (x_new_font): diff --git a/src/nsfns.m b/src/nsfns.m index 550e625c424..13103582891 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -946,6 +946,8 @@ frame_parm_handler ns_frame_parm_handlers[] = x_set_icon_name, x_set_icon_type, x_set_internal_border_width, /* generic OK */ + 0, /* x_set_right_divider_width */ + 0, /* x_set_bottom_divider_width */ x_set_menu_bar_lines, x_set_mouse_color, x_explicitly_set_name, diff --git a/src/nsterm.m b/src/nsterm.m index e58ac9b9277..3e6ceae6580 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1258,7 +1258,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows, bool pi if (view == nil) return; -/*fprintf (stderr, "\tsetWindowSize: %d x %d, font size %d x %d\n", cols, rows, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f)); */ +/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", cols, rows, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/ block_input (); @@ -1267,8 +1267,18 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows, bool pi f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f); compute_fringe_widths (f, 0); - pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); - pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); + if (pixelwise) + { + pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, cols); + pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, rows); + cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); + rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight); + } + else + { + pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); + pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); + } /* If we have a toolbar, take its height into account. */ if (tb && ! [view isFullscreen]) -- 2.39.2