Skip to content

Commit

Permalink
applets: Guard against GTK scale-factor fixes on GtkSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
vkareh committed Jul 27, 2018
1 parent 139f183 commit 31930d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions applets/notification_area/system-tray/na-tray-child.c
Expand Up @@ -115,11 +115,11 @@ na_tray_child_style_set (GtkWidget *widget,
*/
}

#if !GTK_CHECK_VERSION (3, 23, 0)
#if !GTK_CHECK_VERSION (3, 22, 31)
static void
na_tray_child_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
gint *natural_width)
gint *natural_width)
{
gint scale;
scale = gtk_widget_get_scale_factor (widget);
Expand Down Expand Up @@ -384,7 +384,7 @@ na_tray_child_class_init (NaTrayChildClass *klass)

widget_class->style_set = na_tray_child_style_set;
widget_class->realize = na_tray_child_realize;
#if !GTK_CHECK_VERSION (3, 23, 0)
#if !GTK_CHECK_VERSION (3, 22, 31)
widget_class->get_preferred_width = na_tray_child_get_preferred_width;
widget_class->get_preferred_height = na_tray_child_get_preferred_height;
#endif
Expand Down
6 changes: 3 additions & 3 deletions applets/wncklet/window-list.c
Expand Up @@ -42,7 +42,7 @@ typedef struct {

GtkOrientation orientation;
int size;
#ifndef WNCKLET_INPROCESS
#if !defined(WNCKLET_INPROCESS) && !GTK_CHECK_VERSION (3, 22, 31)
gboolean needs_hints;
#endif

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

g_assert(len % 2 == 0);

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

tasklist->size = mate_panel_applet_get_size(applet);

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

Expand Down
9 changes: 5 additions & 4 deletions libmate-panel-applet/mate-panel-applet.c
Expand Up @@ -1059,11 +1059,11 @@ mate_panel_applet_get_preferred_width (GtkWidget *widget,
minimum_width,
natural_width);

#if !GTK_CHECK_VERSION (3, 23, 0)
#if !GTK_CHECK_VERSION (3, 22, 31)
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
if (applet->priv->out_of_process) {
/* Out-of-process applets end up scaled up doubly with GTK 3.22.
* For these builds divide by the scale factor to ensure
* For these builds divide by the scale factor to ensure
* they are back at their own intended size.
*/
gint scale;
Expand All @@ -1082,12 +1082,13 @@ mate_panel_applet_get_preferred_height (GtkWidget *widget,
GTK_WIDGET_CLASS (mate_panel_applet_parent_class)->get_preferred_height (widget,
minimum_height,
natural_height);
#if !GTK_CHECK_VERSION (3, 23, 0)

#if !GTK_CHECK_VERSION (3, 22, 31)
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
if (applet->priv->out_of_process) {
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
* 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);
Expand Down

0 comments on commit 31930d0

Please sign in to comment.