summaryrefslogtreecommitdiff
path: root/libsn/sn-xmessages.c
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2009-01-28 15:29:16 +0100
committerJulien Danjou <julien@danjou.info>2009-04-03 12:57:27 +0200
commit7f0c6f7f7485b53b23656fbaa5f28e73b35c5e0e (patch)
tree41e1432cbe807553316f3fb32363434ddd00f030 /libsn/sn-xmessages.c
parentef217766704890668a425b8b792f51f7e2d80662 (diff)
Anonymize display type into an generic id
This allows to handle identification of the connection without using any Xlib defined type. Signed-off-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'libsn/sn-xmessages.c')
-rw-r--r--libsn/sn-xmessages.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libsn/sn-xmessages.c b/libsn/sn-xmessages.c
index 3c328c8..c2fc8d1 100644
--- a/libsn/sn-xmessages.c
+++ b/libsn/sn-xmessages.c
@@ -28,7 +28,7 @@
typedef struct
{
- Display *xdisplay;
+ void *xid;
Window root;
Atom type_atom;
Atom type_atom_begin;
@@ -63,7 +63,7 @@ sn_internal_add_xmessage_func (SnDisplay *display,
handler = sn_new0 (SnXmessageHandler, 1);
- handler->xdisplay = sn_display_get_x_display (display);
+ handler->xid = sn_internal_display_get_id (display);
handler->root = sn_internal_display_get_root_window (display, screen);
handler->type_atom = sn_internal_atom_get (display, message_type);
handler->type_atom_begin = sn_internal_atom_get (display, message_type_begin);
@@ -226,7 +226,7 @@ sn_internal_broadcast_xmessage (SnDisplay *display,
typedef struct
{
- Display *xdisplay;
+ void *xid;
Atom atom;
Window xwindow;
sn_bool_t found_handler;
@@ -239,7 +239,7 @@ handler_for_atom_foreach (void *value,
SnXmessageHandler *handler = value;
HandlerForAtomData *hfad = data;
- if (handler->xdisplay == hfad->xdisplay &&
+ if (handler->xid == hfad->xid &&
(handler->type_atom == hfad->atom ||
handler->type_atom_begin == hfad->atom))
{
@@ -261,7 +261,7 @@ some_handler_handles_event (SnDisplay *display,
NULL);
hfad.atom = xevent->xclient.message_type;
- hfad.xdisplay = sn_display_get_x_display (display);
+ hfad.xid = sn_internal_display_get_id (display);
hfad.xwindow = xevent->xclient.window;
hfad.found_handler = FALSE;
@@ -394,7 +394,7 @@ dispatch_message_foreach (void *value,
MessageDispatchData *mdd = data;
if (handler->type_atom_begin == mdd->message->type_atom_begin &&
- sn_display_get_x_display (mdd->display) == handler->xdisplay)
+ sn_internal_display_get_id (mdd->display) == handler->xid)
(* handler->func) (mdd->display,
handler->message_type,
mdd->message->message,