Skip to content

Commit 139f183

Browse files
committed
window-list: Skip setting size hints until WnckTasklist has items to show.
1 parent f2f4d84 commit 139f183

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

‎applets/wncklet/window-list.c‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ typedef struct {
4242

4343
GtkOrientation orientation;
4444
int size;
45+
#ifndef WNCKLET_INPROCESS
46+
gboolean needs_hints;
47+
#endif
4548

4649
GtkIconTheme* icon_theme;
4750

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

320323
g_assert(len % 2 == 0);
321324

322-
mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0);
325+
#ifndef WNCKLET_INPROCESS
326+
/* HACK: When loading the WnckTasklist initially, it reports size hints as though there were
327+
* no elements in the Tasklist. This causes a rendering issue when built out-of-process in
328+
* HiDPI displays. We keep a flag to skip size hinting until WnckTasklist has something to
329+
* show. */
330+
if (!tasklist->needs_hints)
331+
{
332+
int i;
333+
for (i = 0; i < len; i++)
334+
{
335+
if (size_hints[i])
336+
{
337+
tasklist->needs_hints = TRUE;
338+
break;
339+
}
340+
}
341+
}
342+
343+
if (tasklist->needs_hints)
344+
#endif
345+
mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0);
323346
}
324347

325348
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)
404427

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

430+
#ifndef WNCKLET_INPROCESS
431+
tasklist->needs_hints = FALSE;
432+
#endif
433+
407434
switch (mate_panel_applet_get_orient(applet))
408435
{
409436
case MATE_PANEL_APPLET_ORIENT_LEFT:

0 commit comments

Comments
 (0)