summaryrefslogtreecommitdiff
path: root/src/communications.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-10-05 03:07:22 +0000
committersabetts <sabetts>2004-10-05 03:07:22 +0000
commitad1da50e94819e8e79da1fc0246f247bfdbc99a9 (patch)
tree991682c6b11919bb5fd29eee85631bd95c1aa459 /src/communications.c
parent442b8d1ae2f4419ca2e2e4d76ad06ae38d18d1c7 (diff)
downloadratpoison-ad1da50e94819e8e79da1fc0246f247bfdbc99a9.zip
* src/screen.h (is_a_root_window): new prototype
* src/screen.c (is_a_root_window): new function * src/events.c (property_notify): check for ratpoison commands on every root window, not just the default root window. * src/communications.c (send_command): store the root window in a variable, root. and use it whenever the root window is needed.
Diffstat (limited to 'src/communications.c')
-rw-r--r--src/communications.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/communications.c b/src/communications.c
index 79af600..4356dfa 100644
--- a/src/communications.c
+++ b/src/communications.c
@@ -83,7 +83,7 @@ receive_command_result (Window w)
int
send_command (unsigned char interactive, unsigned char *cmd, int screen_num)
{
- Window w;
+ Window w, root;
int done = 0;
struct sbuf *s;
@@ -94,15 +94,11 @@ send_command (unsigned char interactive, unsigned char *cmd, int screen_num)
/* If the user specified a specific screen, then send the event to
that screen. */
if (screen_num >= 0)
- {
- w = XCreateSimpleWindow (dpy, RootWindow (dpy, screen_num),
- 0, 0, 1, 1, 0, 0, 0);
- }
+ root = RootWindow (dpy, screen_num);
else
- {
- w = XCreateSimpleWindow (dpy, DefaultRootWindow (dpy),
- 0, 0, 1, 1, 0, 0, 0);
- }
+ root = DefaultRootWindow (dpy);
+
+ w = XCreateSimpleWindow (dpy, root, 0, 0, 1, 1, 0, 0, 0);
/* Select first to avoid race condition */
XSelectInput (dpy, w, PropertyChangeMask);
@@ -110,7 +106,7 @@ send_command (unsigned char interactive, unsigned char *cmd, int screen_num)
XChangeProperty (dpy, w, rp_command, XA_STRING,
8, PropModeReplace, sbuf_get(s), strlen (cmd) + 2);
- XChangeProperty (dpy, DefaultRootWindow (dpy),
+ XChangeProperty (dpy, root,
rp_command_request, XA_WINDOW,
8, PropModeAppend, (unsigned char *)&w, sizeof (Window));