summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2002-01-10 12:03:54 +0000
committersabetts <sabetts>2002-01-10 12:03:54 +0000
commit822fb64e44df92197e3705dfced24720a4a9f8d1 (patch)
treeb7bb8098a32a3366718d5d0da179228c123a313d /src
parent42a60a8766fad28daab030f799756ea1ef535467 (diff)
downloadratpoison-822fb64e44df92197e3705dfced24720a4a9f8d1.zip
* src/events.c (delegate_event): ignore the CirculateRequest event.
* src/actions.c (cmd_rename): Allows the user to specify a second argument which is the number of the window whose number will be set to the first argument.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c63
-rw-r--r--src/events.c5
2 files changed, 54 insertions, 14 deletions
diff --git a/src/actions.c b/src/actions.c
index 4553ecc..da6e6e0 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1040,10 +1040,9 @@ char *
cmd_number (int interactive, void *data)
{
int old_number, new_number;
- rp_window *other_win;
+ rp_window *other_win, *win;
char *str;
-
- if (current_window() == NULL) return NULL;
+ char *tmp;
if (data == NULL)
{
@@ -1055,13 +1054,57 @@ cmd_number (int interactive, void *data)
str = xstrdup ((char *) data);
}
- if ((new_number = string_to_window_number (str)) >= 0)
+ tmp = strtok (str, " ");
+ if (tmp)
+ {
+ new_number = string_to_window_number (tmp);
+ if (new_number < 0)
+ {
+ message (" number: Bad argument ");
+ free (str);
+ return NULL;
+ }
+ }
+ else
+ {
+ /* Impossible, but we'll live with it. */
+ print_window_information (current_window());
+ free (str);
+ return NULL;
+ }
+
+ /* Get the rest of the string and see if the user specified a target
+ window. */
+ tmp = strtok (NULL, "");
+ if (tmp)
+ {
+ int win_number;
+
+ PRINT_DEBUG ("2nd: '%s'\n", tmp);
+
+ win_number = string_to_window_number (tmp);
+ if (win_number < 0)
+ {
+ message (" number: Bad argument ");
+ free (str);
+ return NULL;
+ }
+
+ win = find_window_number (win_number);
+ }
+ else
+ {
+ PRINT_DEBUG ("2nd: NULL\n");
+ win = current_window();
+ }
+
+ if ( new_number >= 0 && win)
{
/* Find other window with same number and give it old number. */
other_win = find_window_number (new_number);
if (other_win != NULL)
{
- old_number = current_window()->number;
+ old_number = win->number;
other_win->number = old_number;
/* Resort the the window in the list */
@@ -1070,18 +1113,18 @@ cmd_number (int interactive, void *data)
}
else
{
- return_window_number (current_window()->number);
+ return_window_number (win->number);
}
- current_window()->number = new_number;
+ win->number = new_number;
add_window_number (new_number);
/* resort the the window in the list */
- remove_from_list (current_window());
- insert_into_list (current_window(), rp_mapped_window_sentinel);
+ remove_from_list (win);
+ insert_into_list (win, rp_mapped_window_sentinel);
/* Update the window list. */
- update_window_names (current_screen());
+ update_window_names (win->scr);
}
free (str);
diff --git a/src/events.c b/src/events.c
index ddc0993..a289d93 100644
--- a/src/events.c
+++ b/src/events.c
@@ -693,10 +693,6 @@ delegate_event (XEvent *ev)
configure_request (&ev->xconfigurerequest);
break;
- case CirculateRequest:
- PRINT_DEBUG ("--- Handling CirculateRequest ---\n");
- break;
-
case CreateNotify:
PRINT_DEBUG ("--- Handling CreateNotify ---\n");
new_window (&ev->xcreatewindow);
@@ -766,6 +762,7 @@ delegate_event (XEvent *ev)
case SelectionRequest:
case SelectionNotify:
case SelectionClear:
+ case CirculateRequest:
/* Ignore these events. */
break;