[empathy] Simplify filter adding code by just using gdk_x11 functions instead of hoops
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Simplify filter adding code by just using gdk_x11 functions instead of hoops
- Date: Wed, 29 Dec 2010 12:20:59 +0000 (UTC)
commit 53a5a7f37188ffaf3e050c5ad2e0852095a85c4b
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Sat Dec 25 20:47:24 2010 +0100
Simplify filter adding code by just using gdk_x11 functions instead of hoops
libempathy-gtk/empathy-avatar-image.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/libempathy-gtk/empathy-avatar-image.c b/libempathy-gtk/empathy-avatar-image.c
index a11627d..3fb7969 100644
--- a/libempathy-gtk/empathy-avatar-image.c
+++ b/libempathy-gtk/empathy-avatar-image.c
@@ -148,24 +148,22 @@ avatar_image_filter_func (GdkXEvent *gdkxevent,
static void
avatar_image_add_filter (EmpathyAvatarImage *avatar_image)
{
+ Display *display;
Window window;
- GdkWindow *gdkwindow;
gint mask;
+ XWindowAttributes attrs;
mask = PropertyChangeMask;
- window = GDK_ROOT_WINDOW ();
- gdkwindow = gdk_x11_window_lookup_for_display (gdk_display_get_default (),
- window);
+ window = gdk_x11_get_default_root_xwindow ();
+ display = gdk_x11_get_default_xdisplay ();
gdk_error_trap_push ();
- if (gdkwindow) {
- XWindowAttributes attrs;
- XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, &attrs);
- mask |= attrs.your_event_mask;
- }
- XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, mask);
+ XGetWindowAttributes (display, window, &attrs);
+ mask |= attrs.your_event_mask;
+
+ XSelectInput (display, window, mask);
gdk_error_trap_pop_ignored ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]