summaryrefslogtreecommitdiff
path: root/src/communications.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/communications.c')
-rw-r--r--src/communications.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/communications.c b/src/communications.c
index 7705c85..d5e96d0 100644
--- a/src/communications.c
+++ b/src/communications.c
@@ -81,13 +81,23 @@ recieve_command_result (Window w)
}
int
-send_command (unsigned char *cmd)
+send_command (unsigned char *cmd, int screen_num)
{
Window w;
int done = 0;
- w = XCreateSimpleWindow (dpy, DefaultRootWindow (dpy),
- 0, 0, 1, 1, 0, 0, 0);
+ /* 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);
+ }
+ else
+ {
+ w = XCreateSimpleWindow (dpy, DefaultRootWindow (dpy),
+ 0, 0, 1, 1, 0, 0, 0);
+ }
/* Select first to avoid race condition */
XSelectInput (dpy, w, PropertyChangeMask);