[gnumeric] GUI: fix growing-windows problem.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: fix growing-windows problem.
- Date: Wed, 27 Jan 2016 23:14:21 +0000 (UTC)
commit aa8dd954ca0538ad2a02c71313939f178219e8ee
Author: Morten Welinder <terra gnome org>
Date: Wed Jan 27 18:12:01 2016 -0500
GUI: fix growing-windows problem.
This appears to be caused by a since-fixed gtk+ css styling bug.
Parts (and only parts) of gtk+ was seeing a border of 6px when no
border was specified in gnumeric.css.
ChangeLog | 5 ++++
NEWS | 1 +
src/wbc-gtk.c | 58 +++++++++++++++++++++++++++++++++++---------------------
3 files changed, 42 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d8708a7..b878469 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-27 Morten Welinder <terra gnome org>
+
+ * src/wbc-gtk.c (cb_add_menus_toolbars): Work around gtk+ bug with
+ css styling.
+
2016-01-23 Morten Welinder <terra gnome org>
* src/parser.y (yylex): Be careful about overflowing numeric
diff --git a/NEWS b/NEWS
index f30b9ab..4cf7764 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Morten:
* Fix R.DBINOM extreme-value case. [#760230]
* New function AGM.
* Fix canvas problem leaving grab in place. [#760639]
+ * Work around gtk+ bug causing growing windows. [#761142]
--------------------------------------------------------------------------
Gnumeric 1.12.26
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 85cd4e9..fd1f888 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2192,10 +2192,41 @@ cb_statusbox_focus (GtkEntry *entry, GdkEventFocus *event,
/******************************************************************************/
static void
+dump_size_tree (GtkWidget *w, gpointer indent_)
+{
+ int indent = GPOINTER_TO_INT (indent_);
+ int h1, h2;
+ GtkAllocation a;
+
+ g_printerr ("%*s", indent, "");
+ if (gtk_widget_get_name (w))
+ g_printerr ("\"%s\" ", gtk_widget_get_name (w));
+
+ gtk_widget_get_preferred_height (w, &h1, &h2);
+ gtk_widget_get_allocation (w, &a);
+
+ g_printerr ("%s %p viz=%d act=%dx%d minheight=%d natheight=%d\n",
+ g_type_name_from_instance ((GTypeInstance *)w), w,
+ gtk_widget_get_visible (w),
+ a.width, a.height,
+ h1, h2);
+
+ if (GTK_IS_CONTAINER (w)) {
+ gtk_container_foreach (GTK_CONTAINER (w),
+ dump_size_tree,
+ GINT_TO_POINTER (indent + 2));
+ }
+}
+
+
+static void
cb_workbook_debug_info (WBCGtk *wbcg)
{
Workbook *wb = wb_control_get_workbook (GNM_WBC (wbcg));
+ if (gnm_debug_flag ("notebook-size"))
+ dump_size_tree (GTK_WIDGET (wbcg_toplevel (wbcg)), GINT_TO_POINTER (0));
+
if (gnm_debug_flag ("deps")) {
dependents_dump (wb);
}
@@ -2818,7 +2849,8 @@ wbc_gtk_create_edit_area (WBCGtk *wbcg)
/* Dependency debugger */
debug_button = GET_GUI_ITEM ("debug_button");
- if (gnm_debug_flag ("deps") ||
+ if (gnm_debug_flag ("notebook-size") ||
+ gnm_debug_flag ("deps") ||
gnm_debug_flag ("expr-sharer") ||
gnm_debug_flag ("style-optimize") ||
gnm_debug_flag ("name-collections")) {
@@ -3549,27 +3581,6 @@ cb_tcm_hide (GtkWidget *widget, GtkWidget *box)
}
static void
-dump_size_tree (GtkWidget *w, gpointer indent_)
-{
- int indent = GPOINTER_TO_INT (indent_);
- int h1, h2;
-
- g_printerr ("%*s", indent, "");
- if (gtk_widget_get_name (w))
- g_printerr ("\"%s\" ", gtk_widget_get_name (w));
-
- gtk_widget_get_preferred_height (w, &h1, &h2);
- g_printerr ("%s %p %d %d\n", g_type_name_from_instance ((GTypeInstance *)w), w, h1, h2);
-
- if (GTK_IS_CONTAINER (w)) {
- gtk_container_foreach (GTK_CONTAINER (w),
- dump_size_tree,
- GINT_TO_POINTER (indent + 2));
- }
-}
-
-
-static void
toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEvent *event)
{
GtkWidget *box = gtk_widget_get_parent (GTK_WIDGET (tb));
@@ -3704,6 +3715,9 @@ cb_add_menus_toolbars (G_GNUC_UNUSED GtkUIManager *ui,
GtkWidget *box;
GtkPositionType pos = gnm_conf_get_toolbar_position (name);
+ // See bug 761142. This isn't supposed to be necessary.
+ gtk_style_context_invalidate (gtk_widget_get_style_context (w));
+
if (gnm_conf_get_detachable_toolbars ()) {
box = gtk_handle_box_new ();
g_object_connect (box,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]