[sawfish] Make sure that xa_sawfish_timestamp is interned.



commit 19adce4a275a2e688708d3c587d9cdece6c06356
Author: Timo Korvola <tkorvola iki fi>
Date:   Mon Dec 27 15:35:12 2010 +0200

    Make sure that xa_sawfish_timestamp is interned.
    
    get_server_timestamp is called before events_init.

 src/events.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/events.c b/src/events.c
index 4176d52..9ceaaeb 100644
--- a/src/events.c
+++ b/src/events.c
@@ -69,7 +69,7 @@ static bool pointer_is_grabbed;
 
 static XID event_handler_context;
 
-static Atom xa_sawfish_timestamp, xa_targets, xa_multiple, xa_timestamp,
+static Atom xa_sawfish_timestamp = None, xa_targets, xa_multiple, xa_timestamp,
     xa_version, xa_atom_pair;
 
 /* is there xrand support? */
@@ -1471,6 +1471,8 @@ get_server_timestamp (void)
     /* XXX There must be an easier method.. */
     while (XCheckWindowEvent (dpy, w, PropertyChangeMask, &ev)) ;
     XSelectInput (dpy, w, PropertyChangeMask | NO_FOCUS_EVENTS);
+    if (xa_sawfish_timestamp == None)
+	xa_sawfish_timestamp = XInternAtom (dpy, "_SAWFISH_TIMESTAMP", False);
     XChangeProperty (dpy, w, xa_sawfish_timestamp,
 		     XA_STRING, 8, PropModeReplace, (unsigned char *)"foo", 3);
     XSelectInput (dpy, w, NO_FOCUS_EVENTS);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]