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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 18b907e..566da0f 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -31,6 +31,11 @@
#include <X11/extensions/Xrender.h>
#include <X11/Xregion.h>
+/* This must be included before the GDK_DISABLE_DEPRECATED definition
+ * in order to avoid QA issues on amd64 arch (see Gentoo bug 344293).
+ */
+#include <gdk/gdkgc.h>
+
#ifndef GDK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATED
#endif
@@ -2659,6 +2664,7 @@ get_window_prop (Window xwindow,
Atom atom,
Window *val)
{
+ Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
Atom type;
int format;
gulong nitems;
@@ -2671,7 +2677,7 @@ get_window_prop (Window xwindow,
gdk_error_trap_push ();
type = None;
- result = XGetWindowProperty (gdk_display,
+ result = XGetWindowProperty (dpy,
xwindow,
atom,
0, G_MAXLONG,
@@ -4966,7 +4972,7 @@ force_quit_dialog_realize (GtkWidget *dialog,
WnckWindow *win = data;
gdk_error_trap_push ();
- XSetTransientForHint (gdk_display,
+ XSetTransientForHint (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XID (dialog->window),
wnck_window_get_xid (win));
gdk_display_sync (gdk_display_get_default ());
@@ -4976,17 +4982,18 @@ force_quit_dialog_realize (GtkWidget *dialog,
static char *
get_client_machine (Window xwindow)
{
- Atom atom, type;
- gulong nitems, bytes_after;
- guchar *str = NULL;
- int format, result;
- char *retval;
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+ Atom atom, type;
+ gulong nitems, bytes_after;
+ guchar *str = NULL;
+ int format, result;
+ char *retval;
- atom = XInternAtom (gdk_display, "WM_CLIENT_MACHINE", FALSE);
+ atom = XInternAtom (xdisplay, "WM_CLIENT_MACHINE", FALSE);
gdk_error_trap_push ();
- result = XGetWindowProperty (gdk_display,
+ result = XGetWindowProperty (xdisplay,
xwindow, atom,
0, G_MAXLONG,
FALSE, XA_STRING, &type, &format, &nitems,
@@ -5013,6 +5020,8 @@ get_client_machine (Window xwindow)
static void
kill_window (WnckWindow *win)
{
+ GdkDisplay *gdk_display = gdk_display_get_default ();
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display);
WnckApplication *app;
app = wnck_window_get_application (win);
@@ -5038,8 +5047,8 @@ kill_window (WnckWindow *win)
}
gdk_error_trap_push ();
- XKillClient (gdk_display, wnck_window_get_xid (win));
- gdk_display_sync (gdk_display_get_default ());
+ XKillClient (xdisplay, wnck_window_get_xid (win));
+ gdk_display_sync (gdk_display);
gdk_error_trap_pop ();
}
@@ -5623,9 +5632,9 @@ static int
update_shadow (void)
{
decor_shadow_options_t opt;
- Display *xdisplay = gdk_display;
- GdkDisplay *display = gdk_display_get_default ();
- GdkScreen *screen = gdk_display_get_default_screen (display);
+ GdkDisplay *display = gdk_display_get_default ();
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
+ GdkScreen *screen = gdk_display_get_default_screen (display);
opt.shadow_radius = shadow_radius;
opt.shadow_opacity = shadow_opacity;
|