summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-01-03 21:34:20 +0000
committersabetts <sabetts>2006-01-03 21:34:20 +0000
commit1d3b753b428842fc9c0bdc6d9ccc9e2289239ffa (patch)
tree99e3b68f6d43a05ec936912c1a101eca88584cc6 /src
parent4d51c49a9428837d6adc638f442717178b2d2b2f (diff)
downloadratpoison-1d3b753b428842fc9c0bdc6d9ccc9e2289239ffa.zip
* src/number.c (numset_add_num): store the ret val of
numset_find_empty_cell in a variable and use it as an index into the numbers_taken array. * src/actions.c (cmd_curframe): return the frame number in non-interactive mode. * src/split.c (cleanup_frame): in the maxsize windows are transients check either the width or height must be less than the screen width/height (just like in windows.c).
Diffstat (limited to 'src')
-rw-r--r--src/actions.c16
-rw-r--r--src/main.c4
-rw-r--r--src/number.c8
-rw-r--r--src/split.c4
4 files changed, 17 insertions, 15 deletions
diff --git a/src/actions.c b/src/actions.c
index ff4a5bf..15372be 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -209,7 +209,7 @@ init_user_commands()
"Name: ", arg_STRING);
add_command ("gnext", cmd_gnext, 0, 0, 0);
add_command ("gprev", cmd_gprev, 0, 0, 0);
- add_command ("gravity", cmd_gravity, 1, 0, 1,
+ add_command ("gravity", cmd_gravity, 1, 0, 0,
"Gravity: ", arg_GRAVITY);
add_command ("groups", cmd_groups, 0, 0, 0);
add_command ("gselect", cmd_gselect, 1, 1, 1,
@@ -3036,8 +3036,13 @@ cmd_rathold (int interactive, struct cmdarg **args)
cmdret *
cmd_curframe (int interactive, struct cmdarg **args)
{
- show_frame_indicator();
- return cmdret_new (RET_SUCCESS, NULL);
+ if (interactive)
+ {
+ show_frame_indicator();
+ return cmdret_new (RET_SUCCESS, NULL);
+ }
+ else
+ return cmdret_new(RET_SUCCESS, "%d", current_frame()->number);
}
/* Thanks to Martin Samuelsson <cosis@lysator.liu.se> for the
@@ -3379,11 +3384,8 @@ set_maxsizegravity (struct cmdarg **args)
cmdret *
cmd_msgwait (int interactive, struct cmdarg **args)
{
- if (args[0] == NULL && !interactive)
- return cmdret_new (RET_SUCCESS, "%d", defaults.bar_timeout);
-
if (args[0] == NULL)
- return cmdret_new (RET_FAILURE, "msgwait: one argument required");
+ return cmdret_new (RET_SUCCESS, "%d", defaults.bar_timeout);
if (ARG(0,number) < 0)
return cmdret_new (RET_FAILURE, "msgwait: invalid argument");
diff --git a/src/main.c b/src/main.c
index 7dd1f07..2cf6809 100644
--- a/src/main.c
+++ b/src/main.c
@@ -592,13 +592,9 @@ main (int argc, char *argv[])
/* Set ratpoison specific Atoms. */
rp_command = XInternAtom (dpy, "RP_COMMAND", False);
- PRINT_DEBUG (("RP_COMMAND = %ld\n", rp_command));
rp_command_request = XInternAtom (dpy, "RP_COMMAND_REQUEST", False);
- PRINT_DEBUG (("RP_COMMAND_REQUEST = %ld\n", rp_command_request));
rp_command_result = XInternAtom (dpy, "RP_COMMAND_RESULT", False);
- PRINT_DEBUG (("RP_COMMAND_RESULT = %ld\n", rp_command_result));
rp_selection = XInternAtom (dpy, "RP_SELECTION", False);
- PRINT_DEBUG (("RP_SELECTION = %ld\n", rp_selection));
if (cmd_count > 0)
{
diff --git a/src/number.c b/src/number.c
index 7fb48c9..ee96b42 100644
--- a/src/number.c
+++ b/src/number.c
@@ -71,12 +71,16 @@ numset_find_empty_cell (struct numset *ns)
int
numset_add_num (struct numset *ns, int n)
{
+ int ec;
+
PRINT_DEBUG(("ns=%p add_num %d\n", ns, n));
if (numset_num_is_taken (ns, n))
return 0; /* failed. */
-
- ns->numbers_taken[numset_find_empty_cell(ns)] = n;
+ /* numset_find_empty_cell calls realloc on numbers_taken. So store
+ the ret val in ec then use ec as an index into the array. */
+ ec = numset_find_empty_cell(ns);
+ ns->numbers_taken[ec] = n;
return 1; /* success! */
}
diff --git a/src/split.c b/src/split.c
index e481670..26231c7 100644
--- a/src/split.c
+++ b/src/split.c
@@ -85,8 +85,8 @@ cleanup_frame (rp_frame *frame)
#ifdef MAXSIZE_WINDOWS_ARE_TRANSIENTS
if (!win->transient
&& !(win->hints->flags & PMaxSize
- && win->hints->max_width < win->scr->width
- && win->hints->max_height < win->scr->height))
+ && (win->hints->max_width < win->scr->width
+ || win->hints->max_height < win->scr->height)))
#else
if (!win->transient)
#endif