Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
62b66b5
)
An ugly fix for the recent LD_PRELOAD bug.
author
Ryan McBride
<mcbride@countersiege.com>
Fri, 3 Jun 2011 22:51:54 +0000
(22:51 +0000)
committer
Ryan McBride
<mcbride@countersiege.com>
Fri, 3 Jun 2011 22:51:54 +0000
(22:51 +0000)
ok marco
lib/swm_hack.c
patch
|
blob
|
history
diff --git
a/lib/swm_hack.c
b/lib/swm_hack.c
index
5d60d61
..
34550d8
100644
(file)
--- a/
lib/swm_hack.c
+++ b/
lib/swm_hack.c
@@
-77,6
+77,14
@@
MyRoot(Display * dpy)
return root;
}
return root;
}
+
+typedef Atom (XIA) (Display *display, char *atom_name, Bool
+ only_if_exists);
+
+typedef int (XCP) (Display *display, Window w, Atom property,
+ Atom type, int format, int mode, unsigned char *data,
+ int nelements);
+
#define SWM_PROPLEN (16)
void
set_property(Display *dpy, Window id, char *name, char *val)
#define SWM_PROPLEN (16)
void
set_property(Display *dpy, Window id, char *name, char *val)
@@
-84,11
+92,22
@@
set_property(Display *dpy, Window id, char *name, char *val)
Atom atom = 0;
char prop[SWM_PROPLEN];
Atom atom = 0;
char prop[SWM_PROPLEN];
+ static XIA *xia = NULL;
+ static XCP *xcp = NULL;
+
+ /* find the real Xlib and the real X function */
+ if (!lib_xlib)
+ lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
+ if (!xia)
+ xia = (XIA *) dlsym(lib_xlib, "XInternAtom");
+ if (!xcp)
+ xcp = (XCP *) dlsym(lib_xlib, "XChangeProperty");
+
/* Try to update the window's workspace property */
/* Try to update the window's workspace property */
- atom = XInternAtom(dpy, name, False);
+ atom = (*xia)(dpy, name, False);
if (atom)
if (snprintf(prop, SWM_PROPLEN, "%s", val) < SWM_PROPLEN)
if (atom)
if (snprintf(prop, SWM_PROPLEN, "%s", val) < SWM_PROPLEN)
- XChangeProperty(dpy, id, atom, XA_STRING,
+ (*xcp)(dpy, id, atom, XA_STRING,
8, PropModeReplace, prop, SWM_PROPLEN);
}
8, PropModeReplace, prop, SWM_PROPLEN);
}