From ffcd5669d6a71dd9450a9c45b2ea67d3ddc7c988 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 2 Apr 2014 16:33:33 +0200 Subject: [PATCH] In x_new_font don't calculate non-toolkit scrollbar width from font width (Bug#17163). * xterm.c (x_new_font): Don't calculate non-toolkit scrollbar width from font width (Bug#17163). --- src/ChangeLog | 5 +++++ src/xterm.c | 24 ++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4a761249376..18b643bfe28 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-04-02 Martin Rudalics + + * xterm.c (x_new_font): Don't calculate non-toolkit scrollbar + width from font width (Bug#17163). + 2014-03-30 Martin Rudalics * frame.c (x_set_frame_parameters): Calculate default values of diff --git a/src/xterm.c b/src/xterm.c index 6fea807c975..ae16e589f62 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7778,20 +7778,16 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset) compute_fringe_widths (f, 1); + /* Compute character columns occupied by scrollbar. + + Don't do things differently for non-toolkit scrollbars + (Bug#17163). */ unit = FRAME_COLUMN_WIDTH (f); -#ifdef USE_TOOLKIT_SCROLL_BARS - /* The width of a toolkit scrollbar does not change with the new - font but we have to calculate the number of columns it occupies - anew. */ - FRAME_CONFIG_SCROLL_BAR_COLS (f) - = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + unit - 1) / unit; -#else - /* The width of a non-toolkit scrollbar is at least 14 pixels and a - multiple of the frame's character width. */ - FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit; - FRAME_CONFIG_SCROLL_BAR_WIDTH (f) - = FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit; -#endif + if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) + FRAME_CONFIG_SCROLL_BAR_COLS (f) + = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + unit - 1) / unit; + else + FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit; if (FRAME_X_WINDOW (f) != 0) { @@ -7997,7 +7993,7 @@ xim_close_dpy (struct x_display_info *dpyinfo) { #ifdef HAVE_X11R6_XIM struct xim_inst_t *xim_inst = dpyinfo->xim_callback_data; - + if (dpyinfo->display) { Bool ret = XUnregisterIMInstantiateCallback -- 2.39.2