aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2011-06-14 23:08:20 +0200
committerJan Djärv2011-06-14 23:08:20 +0200
commitc195f2de12d7fc5466bf8b5bd2cf98a42a749691 (patch)
treed1d117469249ed5e7a2012eb35d1145a317f5258
parentc5dd5a516c9f0f4b622452c42e34e95ca2e2fae5 (diff)
downloademacs-c195f2de12d7fc5466bf8b5bd2cf98a42a749691.tar.gz
emacs-c195f2de12d7fc5466bf8b5bd2cf98a42a749691.zip
Fix resize and change of scroll bar width for Gtk3.
* configure.in: Add emacsgtkfixed.o to GTK_OBJ if HAVE_GTK3. * src/emacsgtkfixed.c, src/emacsgtkfixed.h: New files. * src/gtkutil.c: Include src/emacsgtkfixed.h if HAVE_GTK3. (int_gtk_range_get_value): Move to the scroll bar part of the file. (style_changed_cb): Call update_theme_scrollbar_width and call x_set_scroll_bar_default_width and xg_frame_set_char_size for all frames. (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505). Call gtk_window_set_resizable if HAVE_GTK3. (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width and height if HAVE_GTK3 (Bug#8505). (scroll_bar_width_for_theme): New variable. (update_theme_scrollbar_width): New function. (xg_get_default_scrollbar_width): Move code to update_theme_scrollbar_width, just return scroll_bar_width_for_theme. (xg_initialize): Call update_theme_scrollbar_width. * src/gtkutil.h (xg_get_default_scrollbar_width): Remove argument. * src/xfns.c (x_set_scroll_bar_default_width): Remove argument to xg_get_default_scrollbar_width.
-rw-r--r--ChangeLog4
-rw-r--r--configure.in5
-rw-r--r--src/ChangeLog24
-rw-r--r--src/emacsgtkfixed.c123
-rw-r--r--src/emacsgtkfixed.h58
-rw-r--r--src/gtkutil.c76
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/xfns.c2
8 files changed, 280 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e404183669..cd73001d541 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12011-06-14 Jan Djärv <jan.h.d@swipnet.se>
2
3 * configure.in: Add emacsgtkfixed.o to GTK_OBJ if HAVE_GTK3.
4
12011-06-08 Paul Eggert <eggert@cs.ucla.edu> 52011-06-08 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * lib/gnulib.mk, m4/gnulib-common.m4: Merge from gnulib. 7 * lib/gnulib.mk, m4/gnulib-common.m4: Merge from gnulib.
diff --git a/configure.in b/configure.in
index 3d507789f22..9e7ea8522b2 100644
--- a/configure.in
+++ b/configure.in
@@ -1819,6 +1819,7 @@ fi
1819 1819
1820 1820
1821HAVE_GTK=no 1821HAVE_GTK=no
1822GTK_OBJ=
1822if test "${with_gtk3}" = "yes"; then 1823if test "${with_gtk3}" = "yes"; then
1823 GLIB_REQUIRED=2.28 1824 GLIB_REQUIRED=2.28
1824 GTK_REQUIRED=3.0 1825 GTK_REQUIRED=3.0
@@ -1830,6 +1831,7 @@ if test "${with_gtk3}" = "yes"; then
1830 AC_MSG_ERROR($GTK_PKG_ERRORS) 1831 AC_MSG_ERROR($GTK_PKG_ERRORS)
1831 fi 1832 fi
1832 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) 1833 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1834 GTK_OBJ=emacsgtkfixed.o
1833fi 1835fi
1834 1836
1835if test "$pkg_check_gtk" != "yes"; then 1837if test "$pkg_check_gtk" != "yes"; then
@@ -1847,7 +1849,6 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
1847fi 1849fi
1848fi 1850fi
1849 1851
1850GTK_OBJ=
1851if test x"$pkg_check_gtk" = xyes; then 1852if test x"$pkg_check_gtk" = xyes; then
1852 1853
1853 AC_SUBST(GTK_CFLAGS) 1854 AC_SUBST(GTK_CFLAGS)
@@ -1865,7 +1866,7 @@ if test x"$pkg_check_gtk" = xyes; then
1865 else 1866 else
1866 HAVE_GTK=yes 1867 HAVE_GTK=yes
1867 AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.]) 1868 AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
1868 GTK_OBJ=gtkutil.o 1869 GTK_OBJ="gtkutil.o $GTK_OBJ"
1869 USE_X_TOOLKIT=none 1870 USE_X_TOOLKIT=none
1870 if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then 1871 if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
1871 : 1872 :
diff --git a/src/ChangeLog b/src/ChangeLog
index 15b6bf6baf2..c72311c305f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12011-06-14 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
4 xg_get_default_scrollbar_width.
5
6 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
7 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8 (style_changed_cb): Call update_theme_scrollbar_width and call
9 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10 all frames (Bug#8505).
11 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12 Call gtk_window_set_resizable if HAVE_GTK3.
13 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14 and height if HAVE_GTK3 (Bug#8505).
15 (scroll_bar_width_for_theme): New variable.
16 (update_theme_scrollbar_width): New function.
17 (xg_get_default_scrollbar_width): Move code to
18 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19 (xg_initialize): Call update_theme_scrollbar_width.
20
21 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
22
23 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
24
12011-06-12 Martin Rudalics <rudalics@gmx.at> 252011-06-12 Martin Rudalics <rudalics@gmx.at>
2 26
3 * frame.c (make_frame): Call other_buffer_safely instead of 27 * frame.c (make_frame): Call other_buffer_safely instead of
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
new file mode 100644
index 00000000000..fe3514bce93
--- /dev/null
+++ b/src/emacsgtkfixed.c
@@ -0,0 +1,123 @@
1/* A Gtk Widget that inherits GtkFixed, but can be shrinked.
2
3Copyright (C) 2011 Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "emacsgtkfixed.h"
21
22
23struct _EmacsFixedPrivate
24{
25 int minwidth, minheight;
26};
27
28
29static void emacs_fixed_get_preferred_width (GtkWidget *widget,
30 gint *minimum,
31 gint *natural);
32static void emacs_fixed_get_preferred_height (GtkWidget *widget,
33 gint *minimum,
34 gint *natural);
35G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED)
36
37static void
38emacs_fixed_class_init (EmacsFixedClass *klass)
39{
40 GtkWidgetClass *widget_class;
41 GtkFixedClass *fixed_class;
42
43 widget_class = (GtkWidgetClass*) klass;
44 fixed_class = (GtkFixedClass*) klass;
45
46 widget_class->get_preferred_width = emacs_fixed_get_preferred_width;
47 widget_class->get_preferred_height = emacs_fixed_get_preferred_height;
48 g_type_class_add_private (klass, sizeof (EmacsFixedPrivate));
49}
50
51static GType
52emacs_fixed_child_type (GtkFixed *container)
53{
54 return GTK_TYPE_WIDGET;
55}
56
57static void
58emacs_fixed_init (EmacsFixed *fixed)
59{
60 fixed->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixed, EMACS_TYPE_FIXED,
61 EmacsFixedPrivate);
62 fixed->priv->minwidth = fixed->priv->minheight = 0;
63}
64
65/**
66 * emacs_fixed_new:
67 *
68 * Creates a new #EmacsFixed.
69 *
70 * Returns: a new #EmacsFixed.
71 */
72GtkWidget*
73emacs_fixed_new (void)
74{
75 return g_object_new (EMACS_TYPE_FIXED, NULL);
76}
77
78static GtkWidgetClass *
79get_parent_class (EmacsFixed *fixed)
80{
81 EmacsFixedClass *klass = EMACS_FIXED_GET_CLASS (fixed);
82 GtkFixedClass *parent_class = g_type_class_peek_parent (klass);
83 return (GtkWidgetClass*) parent_class;
84}
85
86static void
87emacs_fixed_get_preferred_width (GtkWidget *widget,
88 gint *minimum,
89 gint *natural)
90{
91 EmacsFixed *fixed = EMACS_FIXED (widget);
92 EmacsFixedPrivate *priv = fixed->priv;
93 GtkWidgetClass *widget_class = get_parent_class (fixed);
94 widget_class->get_preferred_width (widget, minimum, natural);
95 if (minimum) *minimum = priv->minwidth;
96}
97
98static void
99emacs_fixed_get_preferred_height (GtkWidget *widget,
100 gint *minimum,
101 gint *natural)
102{
103 EmacsFixed *fixed = EMACS_FIXED (widget);
104 EmacsFixedPrivate *priv = fixed->priv;
105 GtkWidgetClass *widget_class = get_parent_class (fixed);
106 widget_class->get_preferred_height (widget, minimum, natural);
107 if (minimum) *minimum = priv->minheight;
108}
109
110void
111emacs_fixed_set_min_size (EmacsFixed *widget, int width, int height)
112{
113 EmacsFixedPrivate *priv = widget->priv;
114 GtkWidgetClass *widget_class = get_parent_class (widget);
115 int mw, nw, mh, nh;
116
117 widget_class->get_preferred_height (GTK_WIDGET (widget), &mh, &nh);
118 widget_class->get_preferred_width (GTK_WIDGET (widget), &mw, &nw);
119
120 /* Gtk complains if min size is less than natural size. */
121 if (width <= nw) priv->minwidth = width;
122 if (height <= nh) priv->minheight = height;
123}
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
new file mode 100644
index 00000000000..405374373ec
--- /dev/null
+++ b/src/emacsgtkfixed.h
@@ -0,0 +1,58 @@
1/* A Gtk Widget that inherits GtkFixed, but can be shrinked.
2
3Copyright (C) 2011 Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20#ifndef EMACSGTKFIXED_H
21#define EMACSGTKFIXED_H
22
23#include <gtk/gtk.h>
24
25G_BEGIN_DECLS
26
27#define EMACS_TYPE_FIXED (emacs_fixed_get_type ())
28#define EMACS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMACS_TYPE_FIXED, EmacsFixed))
29#define EMACS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMACS_TYPE_FIXED, EmacsFixedClass))
30#define EMACS_IS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMACS_TYPE_FIXED))
31#define EMACS_IS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMACS_TYPE_FIXED))
32#define EMACS_FIXED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMACS_TYPE_FIXED, EmacsFixedClass))
33
34typedef struct _EmacsFixed EmacsFixed;
35typedef struct _EmacsFixedPrivate EmacsFixedPrivate;
36typedef struct _EmacsFixedClass EmacsFixedClass;
37
38struct _EmacsFixed
39{
40 GtkFixed container;
41
42 /*< private >*/
43 EmacsFixedPrivate *priv;
44};
45
46
47struct _EmacsFixedClass
48{
49 GtkFixedClass parent_class;
50};
51
52extern GtkWidget *emacs_fixed_new (void);
53extern void emacs_fixed_set_min_size (EmacsFixed *widget, int width, int height);
54extern GType emacs_fixed_get_type (void);
55
56G_END_DECLS
57
58#endif /* EMACSGTKFIXED_H */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index dedb39a7a40..45f112ae9e5 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -42,6 +42,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42 42
43#ifdef HAVE_GTK3 43#ifdef HAVE_GTK3
44#include <gtk/gtkx.h> 44#include <gtk/gtkx.h>
45#include "emacsgtkfixed.h"
45#endif 46#endif
46 47
47#define FRAME_TOTAL_PIXEL_HEIGHT(f) \ 48#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
@@ -88,12 +89,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
88 89
89#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x)) 90#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
90 91
91/* Get the current value of the range, truncated to an integer. */ 92static void update_theme_scrollbar_width (void);
92static int
93int_gtk_range_get_value (GtkRange *range)
94{
95 return gtk_range_get_value (range);
96}
97 93
98 94
99/*********************************************************************** 95/***********************************************************************
@@ -1015,6 +1011,7 @@ style_changed_cb (GObject *go,
1015 struct input_event event; 1011 struct input_event event;
1016 GdkDisplay *gdpy = (GdkDisplay *) user_data; 1012 GdkDisplay *gdpy = (GdkDisplay *) user_data;
1017 const char *display_name = gdk_display_get_name (gdpy); 1013 const char *display_name = gdk_display_get_name (gdpy);
1014 Display *dpy = GDK_DISPLAY_XDISPLAY (gdpy);
1018 1015
1019 EVENT_INIT (event); 1016 EVENT_INIT (event);
1020 event.kind = CONFIG_CHANGED_EVENT; 1017 event.kind = CONFIG_CHANGED_EVENT;
@@ -1022,6 +1019,24 @@ style_changed_cb (GObject *go,
1022 /* Theme doesn't change often, so intern is called seldom. */ 1019 /* Theme doesn't change often, so intern is called seldom. */
1023 event.arg = intern ("theme-name"); 1020 event.arg = intern ("theme-name");
1024 kbd_buffer_store_event (&event); 1021 kbd_buffer_store_event (&event);
1022
1023 update_theme_scrollbar_width ();
1024
1025 /* If scroll bar width changed, we need set the new size on all frames
1026 on this display. */
1027 if (dpy)
1028 {
1029 Lisp_Object rest, frame;
1030 FOR_EACH_FRAME (rest, frame)
1031 {
1032 FRAME_PTR f = XFRAME (frame);
1033 if (FRAME_X_DISPLAY (f) == dpy)
1034 {
1035 x_set_scroll_bar_default_width (f);
1036 xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f));
1037 }
1038 }
1039 }
1025} 1040}
1026 1041
1027/* Called when a delete-event occurs on WIDGET. */ 1042/* Called when a delete-event occurs on WIDGET. */
@@ -1069,7 +1084,12 @@ xg_create_frame_widgets (FRAME_PTR f)
1069 1084
1070 wvbox = gtk_vbox_new (FALSE, 0); 1085 wvbox = gtk_vbox_new (FALSE, 0);
1071 whbox = gtk_hbox_new (FALSE, 0); 1086 whbox = gtk_hbox_new (FALSE, 0);
1072 wfixed = gtk_fixed_new (); /* Must have this to place scroll bars */ 1087
1088#ifdef HAVE_GTK3
1089 wfixed = emacs_fixed_new ();
1090#else
1091 wfixed = gtk_fixed_new ();
1092#endif
1073 1093
1074 if (! wtop || ! wvbox || ! whbox || ! wfixed) 1094 if (! wtop || ! wvbox || ! whbox || ! wfixed)
1075 { 1095 {
@@ -1162,6 +1182,7 @@ xg_create_frame_widgets (FRAME_PTR f)
1162 gtk_widget_modify_style (wfixed, style); 1182 gtk_widget_modify_style (wfixed, style);
1163#else 1183#else
1164 gtk_widget_set_can_focus (wfixed, TRUE); 1184 gtk_widget_set_can_focus (wfixed, TRUE);
1185 gtk_window_set_resizable (GTK_WINDOW (wtop), TRUE);
1165#endif 1186#endif
1166 1187
1167#ifdef USE_GTK_TOOLTIP 1188#ifdef USE_GTK_TOOLTIP
@@ -1265,6 +1286,18 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position)
1265 size_hints.min_width = base_width + min_cols * size_hints.width_inc; 1286 size_hints.min_width = base_width + min_cols * size_hints.width_inc;
1266 size_hints.min_height = base_height + min_rows * size_hints.height_inc; 1287 size_hints.min_height = base_height + min_rows * size_hints.height_inc;
1267 1288
1289#ifdef HAVE_GTK3
1290 /* Gtk3 ignores min width/height and overwrites them with its own idea
1291 of min width/height. Put out min values to the widget so Gtk
1292 gets the same value we want it to be. Without this, a user can't
1293 shrink an Emacs frame.
1294 */
1295 if (FRAME_GTK_WIDGET (f))
1296 emacs_fixed_set_min_size (EMACS_FIXED (FRAME_GTK_WIDGET (f)),
1297 size_hints.min_width,
1298 size_hints.min_height);
1299#endif
1300
1268 /* These currently have a one to one mapping with the X values, but I 1301 /* These currently have a one to one mapping with the X values, but I
1269 don't think we should rely on that. */ 1302 don't think we should rely on that. */
1270 hint_flags |= GDK_HINT_WIN_GRAVITY; 1303 hint_flags |= GDK_HINT_WIN_GRAVITY;
@@ -3250,6 +3283,10 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
3250 3283
3251int xg_ignore_gtk_scrollbar; 3284int xg_ignore_gtk_scrollbar;
3252 3285
3286/* The width of the scroll bar for the current theme. */
3287
3288static int scroll_bar_width_for_theme;
3289
3253/* Xlib's `Window' fits in 32 bits. But we want to store pointers, and they 3290/* Xlib's `Window' fits in 32 bits. But we want to store pointers, and they
3254 may be larger than 32 bits. Keep a mapping from integer index to widget 3291 may be larger than 32 bits. Keep a mapping from integer index to widget
3255 pointers to get around the 32 bit limitation. */ 3292 pointers to get around the 32 bit limitation. */
@@ -3326,8 +3363,8 @@ xg_get_widget_from_map (int idx)
3326 return 0; 3363 return 0;
3327} 3364}
3328 3365
3329int 3366static void
3330xg_get_default_scrollbar_width (FRAME_PTR f) 3367update_theme_scrollbar_width (void)
3331{ 3368{
3332#ifdef HAVE_GTK3 3369#ifdef HAVE_GTK3
3333 GtkAdjustment *vadj; 3370 GtkAdjustment *vadj;
@@ -3336,13 +3373,22 @@ xg_get_default_scrollbar_width (FRAME_PTR f)
3336#endif 3373#endif
3337 GtkWidget *wscroll; 3374 GtkWidget *wscroll;
3338 int w = 0, b = 0; 3375 int w = 0, b = 0;
3376
3339 vadj = gtk_adjustment_new (XG_SB_MIN, XG_SB_MIN, XG_SB_MAX, 0.1, 0.1, 0.1); 3377 vadj = gtk_adjustment_new (XG_SB_MIN, XG_SB_MIN, XG_SB_MAX, 0.1, 0.1, 0.1);
3340 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj)); 3378 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
3379 g_object_ref_sink (G_OBJECT (wscroll));
3341 gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL); 3380 gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL);
3342 gtk_widget_destroy (wscroll); 3381 gtk_widget_destroy (wscroll);
3382 g_object_unref (G_OBJECT (wscroll));
3343 w += 2*b; 3383 w += 2*b;
3344 if (w < 16) w = 16; 3384 if (w < 16) w = 16;
3345 return w; 3385 scroll_bar_width_for_theme = w;
3386}
3387
3388int
3389xg_get_default_scrollbar_width (void)
3390{
3391 return scroll_bar_width_for_theme;
3346} 3392}
3347 3393
3348/* Return the scrollbar id for X Window WID on display DPY. 3394/* Return the scrollbar id for X Window WID on display DPY.
@@ -3528,6 +3574,15 @@ xg_update_scrollbar_pos (FRAME_PTR f,
3528 } 3574 }
3529} 3575}
3530 3576
3577/* Get the current value of the range, truncated to an integer. */
3578
3579static int
3580int_gtk_range_get_value (GtkRange *range)
3581{
3582 return gtk_range_get_value (range);
3583}
3584
3585
3531/* Set the thumb size and position of scroll bar BAR. We are currently 3586/* Set the thumb size and position of scroll bar BAR. We are currently
3532 displaying PORTION out of a whole WHOLE, and our position POSITION. */ 3587 displaying PORTION out of a whole WHOLE, and our position POSITION. */
3533 3588
@@ -4680,6 +4735,7 @@ xg_initialize (void)
4680 (GTK_TYPE_MENU_SHELL)); 4735 (GTK_TYPE_MENU_SHELL));
4681 gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK, 4736 gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
4682 "cancel", 0); 4737 "cancel", 0);
4738 update_theme_scrollbar_width ();
4683} 4739}
4684 4740
4685#endif /* USE_GTK */ 4741#endif /* USE_GTK */
diff --git a/src/gtkutil.h b/src/gtkutil.h
index cf58d03b0ce..769e56da917 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -135,7 +135,7 @@ extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
135 int position, 135 int position,
136 int whole); 136 int whole);
137extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); 137extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event);
138extern int xg_get_default_scrollbar_width (FRAME_PTR f); 138extern int xg_get_default_scrollbar_width (void);
139 139
140extern void update_frame_tool_bar (FRAME_PTR f); 140extern void update_frame_tool_bar (FRAME_PTR f);
141extern void free_frame_tool_bar (FRAME_PTR f); 141extern void free_frame_tool_bar (FRAME_PTR f);
diff --git a/src/xfns.c b/src/xfns.c
index 8417db7d6e5..5bc0cef6154 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1701,7 +1701,7 @@ x_set_scroll_bar_default_width (struct frame *f)
1701 int wid = FRAME_COLUMN_WIDTH (f); 1701 int wid = FRAME_COLUMN_WIDTH (f);
1702#ifdef USE_TOOLKIT_SCROLL_BARS 1702#ifdef USE_TOOLKIT_SCROLL_BARS
1703#ifdef USE_GTK 1703#ifdef USE_GTK
1704 int minw = xg_get_default_scrollbar_width (f); 1704 int minw = xg_get_default_scrollbar_width ();
1705#else 1705#else
1706 int minw = 16; 1706 int minw = 16;
1707#endif 1707#endif