diff options
author | lukefromdc <[email protected]> | 2017-01-09 23:16:46 -0500 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-01-09 23:16:46 -0500 |
commit | d06d561dfca50f269c6113bf72fd10e063713942 (patch) | |
tree | f5e8e36dee3a8b1a2bdc8460081d83cea077296e /applets | |
parent | 5bdda73212808452a1355906b4b47615a2cb7024 (diff) | |
download | mate-panel-d06d561dfca50f269c6113bf72fd10e063713942.tar.bz2 mate-panel-d06d561dfca50f269c6113bf72fd10e063713942.tar.xz |
GTK 3.20/3.22: fix warnings from show-desktop button
Force zero padding, margin, border to stop underallocation warnings.
*Note: few themes deliberately use a border here, some (notably Adwaita) inherit it from generic buttons
Diffstat (limited to 'applets')
-rw-r--r-- | applets/wncklet/showdesktop.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/applets/wncklet/showdesktop.c b/applets/wncklet/showdesktop.c index e23ea361..a4fe766b 100644 --- a/applets/wncklet/showdesktop.c +++ b/applets/wncklet/showdesktop.c @@ -387,9 +387,7 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet) GtkActionGroup* action_group; gchar* ui_path; AtkObject* atk_obj; -#if !GTK_CHECK_VERSION (3, 20, 0) GtkCssProvider *provider; -#endif mate_panel_applet_set_flags(applet, MATE_PANEL_APPLET_EXPAND_MINOR); @@ -419,8 +417,20 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet) sdd->button = gtk_toggle_button_new (); gtk_widget_set_name (sdd->button, "showdesktop-button"); -#if !GTK_CHECK_VERSION (3, 20, 0) - provider = gtk_css_provider_new (); + provider = gtk_css_provider_new (); +#if GTK_CHECK_VERSION (3, 20, 0) + gtk_css_provider_load_from_data (provider, + "#showdesktop-button {\n" + "border-width: 0px; \n" /*a border here causes GTK warnings */ + " padding: 0px;\n" + " margin: 0px; }", + -1, NULL); + + gtk_style_context_add_provider (gtk_widget_get_style_context (sdd->button), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (provider); +#else gtk_css_provider_load_from_data (provider, "#showdesktop-button {\n" " -GtkWidget-focus-line-width: 0px;\n" |