summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-07-26 14:05:17 -0400
committerraveit65 <[email protected]>2018-07-28 11:28:47 +0200
commit015cc7472baa8bfbcf7549ea54e92a5087955079 (patch)
tree27668ba86ad6286a16b2aa128a6685c000c331ee /applets
parent19bfc3da12cf08c50b738c9d37b046b305aed142 (diff)
downloadmate-panel-015cc7472baa8bfbcf7549ea54e92a5087955079.tar.bz2
mate-panel-015cc7472baa8bfbcf7549ea54e92a5087955079.tar.xz
window-list: Skip setting size hints until WnckTasklist has items to show.
Diffstat (limited to 'applets')
-rw-r--r--applets/wncklet/window-list.c29
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: