diff options
author | Victor Kareh <[email protected]> | 2018-07-26 14:05:17 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2018-07-26 14:05:17 -0400 |
commit | 139f1837cea61ddf9971c3f7f1530de9247121d3 (patch) | |
tree | da7a066bac3cb9fd770ade2d291ddd0a61043318 /applets/wncklet | |
parent | f2f4d84492425428806e0b2d940b6b270c0d3bd5 (diff) | |
download | mate-panel-139f1837cea61ddf9971c3f7f1530de9247121d3.tar.bz2 mate-panel-139f1837cea61ddf9971c3f7f1530de9247121d3.tar.xz |
window-list: Skip setting size hints until WnckTasklist has items to show.
Diffstat (limited to 'applets/wncklet')
-rw-r--r-- | applets/wncklet/window-list.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index 602f6ecf..f6055e43 100644 --- a/applets/wncklet/window-list.c +++ b/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: |