emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111784: * gtkutil.c (tb_size_cb): Ne


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111784: * gtkutil.c (tb_size_cb): New function.
Date: Thu, 14 Feb 2013 20:01:12 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111784
fixes bug: http://debbugs.gnu.org/13512
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Thu 2013-02-14 20:01:12 +0100
message:
  * gtkutil.c (tb_size_cb): New function.
  (xg_create_tool_bar): Connect size-allocate to tb_size_cb.
modified:
  src/ChangeLog
  src/gtkutil.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-02-14 14:40:54 +0000
+++ b/src/ChangeLog     2013-02-14 19:01:12 +0000
@@ -1,3 +1,8 @@
+2013-02-14  Jan Djärv  <address@hidden>
+
+       * gtkutil.c (tb_size_cb): New function.
+       (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
+
 2013-02-14  Stefan Monnier  <address@hidden>
 
        * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not

=== modified file 'src/gtkutil.c'
--- a/src/gtkutil.c     2013-01-24 05:41:28 +0000
+++ b/src/gtkutil.c     2013-02-14 19:01:12 +0000
@@ -4353,6 +4353,21 @@
   x->toolbar_is_packed = true;
 }
 
+static bool xg_update_tool_bar_sizes (FRAME_PTR f);
+
+static void
+tb_size_cb (GtkWidget    *widget,
+            GdkRectangle *allocation,
+            gpointer      user_data)
+{
+  /* When tool bar is created it has one preferred size.  But when size is
+     allocated between widgets, it may get another.  So we must update
+     size hints if tool bar size changes.  Seen on Fedora 18 at least.  */
+  FRAME_PTR f = (FRAME_PTR) user_data;
+  if (xg_update_tool_bar_sizes (f))
+    x_wm_set_size_hint (f, 0, 0);
+}
+
 /* Create a tool bar for frame F.  */
 
 static void
@@ -4384,6 +4399,8 @@
 
   gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
   toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
+  g_signal_connect (x->toolbar_widget, "size-allocate",
+                    G_CALLBACK (tb_size_cb), f);
 #if GTK_CHECK_VERSION (3, 3, 6)
   gsty = gtk_widget_get_style_context (x->toolbar_widget);
   gtk_style_context_add_class (gsty, "primary-toolbar");


reply via email to

[Prev in Thread] Current Thread [Next in Thread]