From 82fce2e0ff11f494cc1e5815733d912c17fd8852 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 1 Mar 2016 16:17:08 +0100 Subject: [PATCH] universal-access: Fix empty panel with newer GTK+ There's very few chances that the universal-access will fit in the minimum height of the shell for panels, so just nuke that. This also fixes the panel taking 1px in height until we switch away from it and back to it. https://bugzilla.gnome.org/show_bug.cgi?id=761939 --- panels/universal-access/cc-ua-panel.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c index 71ce67b3b..0a138f96d 100644 --- a/panels/universal-access/cc-ua-panel.c +++ b/panels/universal-access/cc-ua-panel.c @@ -852,22 +852,6 @@ cc_ua_panel_init_mouse (CcUaPanel *self) G_CALLBACK (gtk_widget_hide_on_delete), NULL); } -static void -on_content_size_changed (GtkWidget *content, GtkAllocation *allocation, GtkWidget *panel) -{ - if (allocation->height < SCROLL_HEIGHT) - { - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (panel), - GTK_POLICY_NEVER, GTK_POLICY_NEVER); - } - else - { - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (panel), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (panel), SCROLL_HEIGHT); - } -} - static void cc_ua_panel_init (CcUaPanel *self) { @@ -905,8 +889,7 @@ cc_ua_panel_init (CcUaPanel *self) panel = WID ("universal_access_panel"); content = WID ("universal_access_content"); - g_signal_connect (content, "size-allocate", - G_CALLBACK (on_content_size_changed), panel); + gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (panel), SCROLL_HEIGHT); priv->focus_adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (panel)); gtk_container_set_focus_vadjustment (GTK_CONTAINER (content), priv->focus_adjustment);