diff options
author | lukefromdc <[email protected]> | 2018-07-20 17:36:49 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-07-21 14:25:23 -0400 |
commit | a130fb0379a270f6ed80fa21ba2a69e184b4cc2a (patch) | |
tree | 4d2e677eccf340f90d1d87aaf5c21cf3bba2b1d2 | |
parent | 7369482f848486c5e35f2883346b23b1cacc6f37 (diff) | |
download | mate-panel-a130fb0379a270f6ed80fa21ba2a69e184b4cc2a.tar.bz2 mate-panel-a130fb0379a270f6ed80fa21ba2a69e184b4cc2a.tar.xz |
GTK 3.23: fix applet size allocation
Limit workaround for GTK 3.22 double width/height allocation to GTK 3.22 builds only
-rw-r--r-- | libmate-panel-applet/mate-panel-applet.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c index 5adf7bb4..def9b4b5 100644 --- a/libmate-panel-applet/mate-panel-applet.c +++ b/libmate-panel-applet/mate-panel-applet.c @@ -1055,21 +1055,23 @@ mate_panel_applet_get_preferred_width (GtkWidget *widget, int *minimum_width, int *natural_width) { - MatePanelApplet *applet = MATE_PANEL_APPLET (widget); - gint scale; - GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_width (widget, minimum_width, natural_width); +#if !GTK_CHECK_VERSION (3, 23, 0) + MatePanelApplet *applet = MATE_PANEL_APPLET (widget); if (applet->priv->out_of_process) { - /* Out-of-process applets end up scaled up doubly. We divide by the scale factor to ensure + /* Out-of-process applets end up scaled up doubly with GTK 3.22. + * For these builds divide by the scale factor to ensure * they are back at their own intended size. */ + gint scale; scale = gtk_widget_get_scale_factor (widget); *minimum_width /= scale; *natural_width /= scale; } +#endif } static void @@ -1077,21 +1079,22 @@ mate_panel_applet_get_preferred_height (GtkWidget *widget, int *minimum_height, int *natural_height) { - MatePanelApplet *applet = MATE_PANEL_APPLET (widget); - gint scale; - GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_height (widget, minimum_height, natural_height); - +#if !GTK_CHECK_VERSION (3, 23, 0) + MatePanelApplet *applet = MATE_PANEL_APPLET (widget); if (applet->priv->out_of_process) { - /* Out-of-process applets end up scaled up doubly. We divide by the scale factor to ensure + gint scale; + /* Out-of-process applets end up scaled up doubly with GTK 3.22. + * For these builds divide by the scale factor to ensure * they are back at their own intended size. */ scale = gtk_widget_get_scale_factor (widget); *minimum_height /= scale; *natural_height /= scale; } +#endif } static GtkSizeRequestMode |