Skip to content

Commit a673336

Browse files
lukefromdcraveit65
authored andcommitted
GTK 3.23: fix applet size allocation
Limit workaround for GTK 3.22 double width/height allocation to GTK 3.22 builds only
1 parent b8c0dde commit a673336

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎libmate-panel-applet/mate-panel-applet.c‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,43 +1054,46 @@ mate_panel_applet_get_preferred_width (GtkWidget *widget,
10541054
int *minimum_width,
10551055
int *natural_width)
10561056
{
1057-
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
1058-
gint scale;
1059-
10601057
GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_width (widget,
10611058
minimum_width,
10621059
natural_width);
10631060

1061+
#if !GTK_CHECK_VERSION (3, 23, 0)
1062+
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
10641063
if (applet->priv->out_of_process) {
1065-
/* Out-of-process applets end up scaled up doubly. We divide by the scale factor to ensure
1064+
/* Out-of-process applets end up scaled up doubly with GTK 3.22.
1065+
* For these builds divide by the scale factor to ensure
10661066
* they are back at their own intended size.
10671067
*/
1068+
gint scale;
10681069
scale = gtk_widget_get_scale_factor (widget);
10691070
*minimum_width /= scale;
10701071
*natural_width /= scale;
10711072
}
1073+
#endif
10721074
}
10731075

10741076
static void
10751077
mate_panel_applet_get_preferred_height (GtkWidget *widget,
10761078
int *minimum_height,
10771079
int *natural_height)
10781080
{
1079-
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
1080-
gint scale;
1081-
10821081
GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_height (widget,
10831082
minimum_height,
10841083
natural_height);
1085-
1084+
#if !GTK_CHECK_VERSION (3, 23, 0)
1085+
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
10861086
if (applet->priv->out_of_process) {
1087-
/* Out-of-process applets end up scaled up doubly. We divide by the scale factor to ensure
1087+
gint scale;
1088+
/* Out-of-process applets end up scaled up doubly with GTK 3.22.
1089+
* For these builds divide by the scale factor to ensure
10881090
* they are back at their own intended size.
10891091
*/
10901092
scale = gtk_widget_get_scale_factor (widget);
10911093
*minimum_height /= scale;
10921094
*natural_height /= scale;
10931095
}
1096+
#endif
10941097
}
10951098

10961099
static GtkSizeRequestMode

0 commit comments

Comments
 (0)