Skip to content

Commit

Permalink
window-list: Skip setting size hints until WnckTasklist has items to …
Browse files Browse the repository at this point in the history
…show.
  • Loading branch information
vkareh authored and raveit65 committed Jul 28, 2018
1 parent 19bfc3d commit 015cc74
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion applets/wncklet/window-list.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ typedef struct {


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


GtkIconTheme* icon_theme; GtkIconTheme* icon_theme;


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


g_assert(len % 2 == 0); 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) static GdkPixbuf* icon_loader_func(const char* icon, int size, unsigned int flags, void* data)
Expand Down Expand Up @@ -404,6 +427,10 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)


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


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

switch (mate_panel_applet_get_orient(applet)) switch (mate_panel_applet_get_orient(applet))
{ {
case MATE_PANEL_APPLET_ORIENT_LEFT: case MATE_PANEL_APPLET_ORIENT_LEFT:
Expand Down

0 comments on commit 015cc74

Please sign in to comment.