aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2013-02-14 20:01:12 +0100
committerJan Djärv2013-02-14 20:01:12 +0100
commit51b3a99c948dc83f3387f440702ab6e175b61e0f (patch)
treee1088ff82051ffacdaab556846dd7a2aa498be52 /src
parente31560a79130b8f477883a9a32253cb1ed3b3ef2 (diff)
downloademacs-51b3a99c948dc83f3387f440702ab6e175b61e0f.tar.gz
emacs-51b3a99c948dc83f3387f440702ab6e175b61e0f.zip
* gtkutil.c (tb_size_cb): New function.
(xg_create_tool_bar): Connect size-allocate to tb_size_cb. Fixes: debbugs:13512
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gtkutil.c17
2 files changed, 22 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3c9ea256547..8b1c429e406 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (tb_size_cb): New function.
4 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
5
12013-02-14 Stefan Monnier <monnier@iro.umontreal.ca> 62013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not 8 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4771d34b4a0..d6e4dcebcd3 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4353,6 +4353,21 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4353 x->toolbar_is_packed = true; 4353 x->toolbar_is_packed = true;
4354} 4354}
4355 4355
4356static bool xg_update_tool_bar_sizes (FRAME_PTR f);
4357
4358static void
4359tb_size_cb (GtkWidget *widget,
4360 GdkRectangle *allocation,
4361 gpointer user_data)
4362{
4363 /* When tool bar is created it has one preferred size. But when size is
4364 allocated between widgets, it may get another. So we must update
4365 size hints if tool bar size changes. Seen on Fedora 18 at least. */
4366 FRAME_PTR f = (FRAME_PTR) user_data;
4367 if (xg_update_tool_bar_sizes (f))
4368 x_wm_set_size_hint (f, 0, 0);
4369}
4370
4356/* Create a tool bar for frame F. */ 4371/* Create a tool bar for frame F. */
4357 4372
4358static void 4373static void
@@ -4384,6 +4399,8 @@ xg_create_tool_bar (FRAME_PTR f)
4384 4399
4385 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); 4400 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
4386 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); 4401 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
4402 g_signal_connect (x->toolbar_widget, "size-allocate",
4403 G_CALLBACK (tb_size_cb), f);
4387#if GTK_CHECK_VERSION (3, 3, 6) 4404#if GTK_CHECK_VERSION (3, 3, 6)
4388 gsty = gtk_widget_get_style_context (x->toolbar_widget); 4405 gsty = gtk_widget_get_style_context (x->toolbar_widget);
4389 gtk_style_context_add_class (gsty, "primary-toolbar"); 4406 gtk_style_context_add_class (gsty, "primary-toolbar");