Skip to content

Commit

Permalink
hidpi: fix tray icon spacing with window-scaling > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukefromdc committed Mar 21, 2018
1 parent ff04f33 commit 0b15ea1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions applets/notification_area/system-tray/na-tray-child.c
Expand Up @@ -120,6 +120,8 @@ na_tray_child_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
gint *natural_width)
{
gint scale;
scale = gtk_widget_get_scale_factor (widget);
GTK_WIDGET_CLASS (na_tray_child_parent_class)->get_preferred_width (widget,
minimal_width,
natural_width);
Expand All @@ -129,13 +131,18 @@ na_tray_child_get_preferred_width (GtkWidget *widget,

if (*natural_width < 16)
*natural_width = 16;

*minimal_width = *minimal_width / scale;
*natural_width = *natural_width / scale;
}

static void
na_tray_child_get_preferred_height (GtkWidget *widget,
gint *minimal_height,
gint *natural_height)
{
gint scale;
scale = gtk_widget_get_scale_factor (widget);
GTK_WIDGET_CLASS (na_tray_child_parent_class)->get_preferred_height (widget,
minimal_height,
natural_height);
Expand All @@ -145,6 +152,9 @@ na_tray_child_get_preferred_height (GtkWidget *widget,

if (*natural_height < 16)
*natural_height = 16;

*minimal_height = *minimal_height / scale;
*natural_height = *natural_height / scale;
}

static void
Expand Down
3 changes: 2 additions & 1 deletion applets/notification_area/system-tray/na-tray.c
Expand Up @@ -127,7 +127,8 @@ tray_added (NaTrayManager *manager,

na_host_emit_item_added (NA_HOST (tray), NA_ITEM (icon));

gtk_widget_show (GTK_WIDGET (icon));
/*Does not seem to be needed anymore and can cause a render issue with hidpi*/
/*gtk_widget_show (GTK_WIDGET (icon));*/
}

static void
Expand Down

0 comments on commit 0b15ea1

Please sign in to comment.