diff options
author | sabetts <sabetts> | 2003-04-14 02:30:14 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-04-14 02:30:14 +0000 |
commit | 65963a411c7b8f32ff9936ab477943d9c54e0442 (patch) | |
tree | 553c9407a4cd4f4813890e222c741963240b7196 | |
parent | 3a1b9f4a566bb8292481eb1d059713f48f185317 (diff) | |
download | ratpoison-65963a411c7b8f32ff9936ab477943d9c54e0442.zip |
* src/main.c (main): if the screen was specified on the
command-line, send the command to the correct screen.
* src/communications.c (send_command): new argument,
screen_num. Get the root window for the specified
screen. prototype updated.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/communications.c | 16 | ||||
-rw-r--r-- | src/communications.h | 2 | ||||
-rw-r--r-- | src/main.c | 6 |
4 files changed, 26 insertions, 5 deletions
@@ -1,5 +1,12 @@ 2003-04-13 Shawn Betts <sabetts@sfu.ca> + * src/main.c (main): if the screen was specified on the + command-line, send the command to the correct screen. + + * src/communications.c (send_command): new argument, + screen_num. Get the root window for the specified + screen. prototype updated. + * src/main.c (init_screen): print the display string for debugging. (ratpoison_opts): fix -c option by adding a : after it. 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); diff --git a/src/communications.h b/src/communications.h index 0fd7937..6ece873 100644 --- a/src/communications.h +++ b/src/communications.h @@ -22,6 +22,6 @@ #ifndef _RATPOISON_COMMUNICATIONS_H #define _RATPOISON_COMMUNICATIONS_H 1 -int send_command (unsigned char *cmd); +int send_command (unsigned char *cmd, int screen_num); #endif /* ! _RATPOISON_COMMUNICATIONS_H */ @@ -568,7 +568,11 @@ main (int argc, char *argv[]) for (i=0; i<cmd_count; i++) { - send_command (command[i]); + if (screen_arg) + send_command (command[i], screen_num); + else + send_command (command[i], -1); + free (command[i]); } |