Skip to content
Permalink
Browse files

window-list: Skip setting size hints until WnckTasklist has items to …

…show.
  • Loading branch information...
vkareh authored and raveit65 committed Jul 26, 2018
1 parent 19bfc3d commit 015cc7472baa8bfbcf7549ea54e92a5087955079
Showing with 28 additions and 1 deletion.
  1. +28 −1 applets/wncklet/window-list.c
@@ -42,6 +42,9 @@ typedef struct {

GtkOrientation orientation;
int size;
#ifndef WNCKLET_INPROCESS
gboolean needs_hints;
#endif

GtkIconTheme* icon_theme;

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

g_assert(len % 2 == 0);

mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0);
#ifndef WNCKLET_INPROCESS
/* 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
* show. */
if (!tasklist->needs_hints)
{
int i;
for (i = 0; i < len; i++)
{
if (size_hints[i])
{
tasklist->needs_hints = TRUE;
break;
}
}
}

if (tasklist->needs_hints)
#endif
mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0);
}

static GdkPixbuf* icon_loader_func(const char* icon, int size, unsigned int flags, void* data)
@@ -404,6 +427,10 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)

tasklist->size = mate_panel_applet_get_size(applet);

#ifndef WNCKLET_INPROCESS
tasklist->needs_hints = FALSE;
#endif

switch (mate_panel_applet_get_orient(applet))
{
case MATE_PANEL_APPLET_ORIENT_LEFT:

0 comments on commit 015cc74

Please sign in to comment.
You can’t perform that action at this time.