Skip to content

Commit 31930d0

Browse files
committed
applets: Guard against GTK scale-factor fixes on GtkSocket
1 parent 139f183 commit 31930d0

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

applets/notification_area/system-tray/na-tray-child.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ na_tray_child_style_set (GtkWidget *widget,
115115
*/
116116
}
117117

118-
#if !GTK_CHECK_VERSION (3, 23, 0)
118+
#if !GTK_CHECK_VERSION (3, 22, 31)
119119
static void
120120
na_tray_child_get_preferred_width (GtkWidget *widget,
121121
gint *minimal_width,
122-
gint *natural_width)
122+
gint *natural_width)
123123
{
124124
gint scale;
125125
scale = gtk_widget_get_scale_factor (widget);
@@ -384,7 +384,7 @@ na_tray_child_class_init (NaTrayChildClass *klass)
384384

385385
widget_class->style_set = na_tray_child_style_set;
386386
widget_class->realize = na_tray_child_realize;
387-
#if !GTK_CHECK_VERSION (3, 23, 0)
387+
#if !GTK_CHECK_VERSION (3, 22, 31)
388388
widget_class->get_preferred_width = na_tray_child_get_preferred_width;
389389
widget_class->get_preferred_height = na_tray_child_get_preferred_height;
390390
#endif

applets/wncklet/window-list.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct {
4242

4343
GtkOrientation orientation;
4444
int size;
45-
#ifndef WNCKLET_INPROCESS
45+
#if !defined(WNCKLET_INPROCESS) && !GTK_CHECK_VERSION (3, 22, 31)
4646
gboolean needs_hints;
4747
#endif
4848

@@ -322,7 +322,7 @@ static void applet_size_allocate(GtkWidget *widget, GtkAllocation *allocation, T
322322

323323
g_assert(len % 2 == 0);
324324

325-
#ifndef WNCKLET_INPROCESS
325+
#if !defined(WNCKLET_INPROCESS) && !GTK_CHECK_VERSION (3, 22, 31)
326326
/* HACK: When loading the WnckTasklist initially, it reports size hints as though there were
327327
* no elements in the Tasklist. This causes a rendering issue when built out-of-process in
328328
* HiDPI displays. We keep a flag to skip size hinting until WnckTasklist has something to
@@ -427,7 +427,7 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
427427

428428
tasklist->size = mate_panel_applet_get_size(applet);
429429

430-
#ifndef WNCKLET_INPROCESS
430+
#if !defined(WNCKLET_INPROCESS) && !GTK_CHECK_VERSION (3, 22, 31)
431431
tasklist->needs_hints = FALSE;
432432
#endif
433433

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,11 +1059,11 @@ mate_panel_applet_get_preferred_width (GtkWidget *widget,
10591059
minimum_width,
10601060
natural_width);
10611061

1062-
#if !GTK_CHECK_VERSION (3, 23, 0)
1062+
#if !GTK_CHECK_VERSION (3, 22, 31)
10631063
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
10641064
if (applet->priv->out_of_process) {
10651065
/* Out-of-process applets end up scaled up doubly with GTK 3.22.
1066-
* For these builds divide by the scale factor to ensure
1066+
* For these builds divide by the scale factor to ensure
10671067
* they are back at their own intended size.
10681068
*/
10691069
gint scale;
@@ -1082,12 +1082,13 @@ mate_panel_applet_get_preferred_height (GtkWidget *widget,
10821082
GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_height (widget,
10831083
minimum_height,
10841084
natural_height);
1085-
#if !GTK_CHECK_VERSION (3, 23, 0)
1085+
1086+
#if !GTK_CHECK_VERSION (3, 22, 31)
10861087
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
10871088
if (applet->priv->out_of_process) {
10881089
gint scale;
10891090
/* Out-of-process applets end up scaled up doubly with GTK 3.22.
1090-
* For these builds divide by the scale factor to ensure
1091+
* For these builds divide by the scale factor to ensure
10911092
* they are back at their own intended size.
10921093
*/
10931094
scale = gtk_widget_get_scale_factor (widget);

0 commit comments

Comments
 (0)