summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-11-18 21:39:19 +0000
committersabetts <sabetts>2004-11-18 21:39:19 +0000
commit09221a12124bd6c3b13d23c85932a26cae57edac (patch)
treece98c974aa3ec769b336e420e3a876c9cace4ce2
parent07e74dea708687fca0e51412c64c944163758d95 (diff)
downloadratpoison-09221a12124bd6c3b13d23c85932a26cae57edac.zip
* src/window.c (unhide_transient_for): add a newline to debugging
output. (hide_transient_for_between): likewise. * src/manage.c (get_wmname): typecast name when passing to xstrdup. * src/main.c (main): typecast command[i] when passing to send_command. * src/events.c (execute_remote_command): typecast req[1] when passing to command. (receive_command): typecast result when passing to XChangeProperty. * src/editor.c (editor_history_previous): Add newline to debugging output. (editor_history_next): likewise. (paste_primary_selection): typecast data when passing to editor_insert. * src/communications.c (receive_command_result): typecast result when passing to strlen. (send_command): typecast cmd when passing the XChangeProperty. * src/actions.c (user_commands): add focusprev (cmd_prev): clean up (cmd_next): likewise (cmd_prev_frame): call find_frame_prev instead of find_frame_next. (cmd_frestore): grab the frame's number first when processing the frames.
-rw-r--r--ChangeLog33
-rw-r--r--src/actions.c63
-rw-r--r--src/communications.c4
-rw-r--r--src/editor.c6
-rw-r--r--src/events.c4
-rw-r--r--src/main.c4
-rw-r--r--src/manage.c2
-rw-r--r--src/number.c2
-rw-r--r--src/window.c4
9 files changed, 72 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index 387579c..a90b8c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2004-11-18 Shawn Betts <katia_dilkina@verizon.net>
+
+ * src/window.c (unhide_transient_for): add a newline to debugging
+ output.
+ (hide_transient_for_between): likewise.
+
+ * src/manage.c (get_wmname): typecast name when passing to
+ xstrdup.
+
+ * src/main.c (main): typecast command[i] when passing to
+ send_command.
+
+ * src/events.c (execute_remote_command): typecast req[1] when
+ passing to command.
+ (receive_command): typecast result when passing to
+ XChangeProperty.
+
+ * src/editor.c (editor_history_previous): Add newline to
+ debugging output.
+ (editor_history_next): likewise.
+ (paste_primary_selection): typecast data when passing to editor_insert.
+
+ * src/communications.c (receive_command_result): typecast result
+ when passing to strlen.
+ (send_command): typecast cmd when passing the XChangeProperty.
+
+ * src/actions.c (user_commands): add focusprev
+ (cmd_prev): clean up
+ (cmd_next): likewise
+ (cmd_prev_frame): call find_frame_prev instead of find_frame_next.
+ (cmd_frestore): grab the frame's number first when processing the
+ frames.
+
2004-11-17 Shawn Betts <sabetts@vcn.bc.ca>
* src/actions.c (user_commands): add rathold
diff --git a/src/actions.c b/src/actions.c
index 06a16d3..df2ae02 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -51,6 +51,7 @@ static user_command user_commands[] =
{"exec", cmd_exec, arg_STRING},
{"fdump", cmd_fdump, arg_STRING},
{"focus", cmd_next_frame, arg_VOID},
+ {"focusprev", cmd_prev_frame, arg_VOID},
{"focusdown", cmd_focusdown, arg_VOID},
{"focuslast", cmd_focuslast, arg_VOID},
{"focusleft", cmd_focusleft, arg_VOID},
@@ -851,22 +852,16 @@ cmd_meta (int interactive, char *data)
char *
cmd_prev (int interactive, char *data)
{
- if (!current_window())
- {
- set_active_window (group_prev_window (rp_current_group, NULL));
- if (!current_window())
- message (MESSAGE_NO_MANAGED_WINDOWS);
- }
- else
- {
- rp_window *win;
+ rp_window *cur, *win;
+ cur = current_window();
+ win = group_prev_window (rp_current_group, cur);
- win = group_prev_window (rp_current_group, current_window());
- if (win == NULL)
- message (MESSAGE_NO_OTHER_WINDOW);
- else
- set_active_window (win);
- }
+ if (win)
+ set_active_window (win);
+ else if (cur)
+ message (MESSAGE_NO_OTHER_WINDOW);
+ else
+ message (MESSAGE_NO_MANAGED_WINDOWS);
return NULL;
}
@@ -876,7 +871,7 @@ cmd_prev_frame (int interactive, char *data)
{
rp_frame *frame;
- frame = find_frame_next (current_frame());
+ frame = find_frame_prev (current_frame());
if (!frame)
message (MESSAGE_NO_OTHER_FRAME);
else
@@ -888,22 +883,16 @@ cmd_prev_frame (int interactive, char *data)
char *
cmd_next (int interactive, char *data)
{
- if (!current_window())
- {
- set_active_window (group_next_window (rp_current_group, NULL));
- if (!current_window())
- message (MESSAGE_NO_MANAGED_WINDOWS);
- }
- else
- {
- rp_window *win;
+ rp_window *cur, *win;
+ cur = current_window();
+ win = group_next_window (rp_current_group, cur);
- win = group_next_window (rp_current_group, current_window());
- if (win == NULL)
- message (MESSAGE_NO_OTHER_WINDOW);
- else
- set_active_window (win);
- }
+ if (win)
+ set_active_window (win);
+ else if (cur)
+ message (MESSAGE_NO_OTHER_WINDOW);
+ else
+ message (MESSAGE_NO_MANAGED_WINDOWS);
return NULL;
}
@@ -3756,6 +3745,12 @@ cmd_frestore (int interactively, char *data)
PRINT_DEBUG (("restore %d %d\n", cur->number, cur->win_number));
+ /* Grab the frame's number, but if it already exists request a
+ new one. */
+ if (!numset_add_num (s->frames_numset, cur->number)) {
+ cur->number = numset_request (s->frames_numset);
+ }
+
/* Find the current frame based on last_access. */
if (cur->last_access > max)
{
@@ -3763,12 +3758,6 @@ cmd_frestore (int interactively, char *data)
max = cur->last_access;
}
- /* Grab the frame's number, but if it already exists request a
- new one. */
- if (!numset_add_num (s->frames_numset, cur->number)) {
- cur->number = numset_request (s->frames_numset);
- }
-
/* Update the window the frame points to. */
if (cur->win_number != EMPTY)
{
diff --git a/src/communications.c b/src/communications.c
index 4356dfa..58a6841 100644
--- a/src/communications.c
+++ b/src/communications.c
@@ -73,7 +73,7 @@ receive_command_result (Window w)
}
/* If result is not the empty string, print it. */
- if (strlen (result))
+ if (strlen ((char *)result))
printf ("%s\n", result);
/* Free the result. */
@@ -104,7 +104,7 @@ send_command (unsigned char interactive, unsigned char *cmd, int screen_num)
XSelectInput (dpy, w, PropertyChangeMask);
XChangeProperty (dpy, w, rp_command, XA_STRING,
- 8, PropModeReplace, sbuf_get(s), strlen (cmd) + 2);
+ 8, PropModeReplace, sbuf_get(s), strlen ((char *)cmd) + 2);
XChangeProperty (dpy, root,
rp_command_request, XA_WINDOW,
diff --git a/src/editor.c b/src/editor.c
index c5c3560..3828d2f 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -330,7 +330,7 @@ editor_history_previous (rp_input_line *line)
}
else
{
- PRINT_DEBUG (("- do nothing -"));
+ PRINT_DEBUG (("- do nothing -\n"));
return EDIT_NO_OP;
}
@@ -364,7 +364,7 @@ editor_history_next (rp_input_line *line)
}
else
{
- PRINT_DEBUG (("- do nothing -"));
+ PRINT_DEBUG (("- do nothing -\n"));
return EDIT_NO_OP;
}
@@ -515,7 +515,7 @@ paste_primary_selection (rp_input_line *line)
offset += nitems;
/* editor_insert (line, data, nitems); */
- editor_insert (line, data);
+ editor_insert (line, (char *)data);
PRINT_DEBUG (("bytes_after = %ld, nitems = %ld, data = '%s'\n", bytes_after, nitems, data));
diff --git a/src/events.c b/src/events.c
index 7e05a7e..98f3a17 100644
--- a/src/events.c
+++ b/src/events.c
@@ -471,7 +471,7 @@ execute_remote_command (Window w)
}
PRINT_DEBUG (("command: %s\n", req));
- result = command (req[0], &req[1]);
+ result = command (req[0], (char *)&req[1]);
XFree (req);
return result;
@@ -542,7 +542,7 @@ receive_command (Window root)
if (result)
{
XChangeProperty (dpy, w, rp_command_result, XA_STRING,
- 8, PropModeReplace, result, strlen (result));
+ 8, PropModeReplace, (unsigned char *)result, strlen (result));
free (result);
}
else
diff --git a/src/main.c b/src/main.c
index 193f60d..cfee3a6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -584,9 +584,9 @@ main (int argc, char *argv[])
for (i=0; i<cmd_count; i++)
{
if (screen_arg)
- send_command (interactive, command[i], screen_num);
+ send_command (interactive, (unsigned char *)command[i], screen_num);
else
- send_command (interactive, command[i], -1);
+ send_command (interactive, (unsigned char *)command[i], -1);
free (command[i]);
}
diff --git a/src/manage.c b/src/manage.c
index 3a303de..3ee8b21 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -250,7 +250,7 @@ get_wmname (Window w)
/* duplicate the string into our own buffer, and free the one given
to us by X. */
- ret = xstrdup (name);
+ ret = xstrdup ((char *)name);
XFree (name);
return ret;
diff --git a/src/number.c b/src/number.c
index b71d0de..37e0293 100644
--- a/src/number.c
+++ b/src/number.c
@@ -107,7 +107,7 @@ numset_release (struct numset *ns, int n)
PRINT_DEBUG(("ns=%p release %d\n", ns, n));
if (n < 0)
- PRINT_ERROR(("ns=%p Attempt to release %d!", ns, n));
+ PRINT_ERROR(("ns=%p Attempt to release %d!\n", ns, n));
for (i=0; i<ns->num_taken; i++)
{
diff --git a/src/window.c b/src/window.c
index a286676..0ce8239 100644
--- a/src/window.c
+++ b/src/window.c
@@ -363,7 +363,7 @@ unhide_transient_for (rp_window *win)
transient_for = find_window (win->transient_for);
if (transient_for == NULL)
{
- PRINT_DEBUG (("Can't find transient_for for '%s'", win->name ));
+ PRINT_DEBUG (("Can't find transient_for for '%s'\n", win->name ));
return;
}
@@ -403,7 +403,7 @@ hide_transient_for_between (rp_window *win, rp_window *last)
transient_for = find_window (win->transient_for);
if (transient_for == last)
{
- PRINT_DEBUG (("Can't find transient_for for '%s'", win->name ));
+ PRINT_DEBUG (("Can't find transient_for for '%s'\n", win->name ));
return;
}