1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
From 36bc6c82f97d36efc3740f837e7e241ee1529559 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 15 Oct 2014 14:37:25 -0400
Subject: [PATCH] Revert "gtktrayicon-x11: Stop using set_double_buffered"
This reverts commit 4a72563c7b801052f4291a4757bd1011946677b9.
It turns out that this commit broke statusicons under Xfce when
not using a compositor.
https://bugzilla.gnome.org/show_bug.cgi?id=737986
---
gtk/deprecated/gtktrayicon-x11.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gtk/deprecated/gtktrayicon-x11.c b/gtk/deprecated/gtktrayicon-x11.c
index 503d64b..371cd0e 100644
--- a/gtk/deprecated/gtktrayicon-x11.c
+++ b/gtk/deprecated/gtktrayicon-x11.c
@@ -355,6 +355,27 @@ gtk_tray_icon_draw (GtkWidget *widget,
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
}
+ else
+ {
+ GdkRectangle clip;
+
+ if (gdk_cairo_get_clip_rectangle (cr, &clip))
+ {
+ /* Clear to parent-relative pixmap
+ * We need to use direct X access here because GDK doesn't know about
+ * the parent realtive pixmap. */
+ cairo_surface_flush (target);
+
+ XClearArea (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window),
+ clip.x, clip.y,
+ clip.width, clip.height,
+ False);
+ cairo_surface_mark_dirty_rectangle (target,
+ clip.x, clip.y,
+ clip.width, clip.height);
+ }
+ }
if (GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->draw)
retval = GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->draw (widget, cr);
@@ -480,6 +501,11 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
icon->priv->manager_visual_rgba = FALSE;
}
+ /* For the background-relative hack we use when we aren't
+ * using a real RGBA visual, we can't be double-buffered
+ */
+ gtk_widget_set_double_buffered (GTK_WIDGET (icon), icon->priv->manager_visual_rgba);
+
if (type != None)
XFree (prop.prop);
}
--
2.1.0
|