diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 25 | ||||
-rw-r--r-- | src/actions.h | 2 | ||||
-rw-r--r-- | src/bar.c | 2 | ||||
-rw-r--r-- | src/data.h | 7 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/window.c | 2 |
6 files changed, 28 insertions, 12 deletions
diff --git a/src/actions.c b/src/actions.c index 456abc1..352818c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -115,7 +115,7 @@ static user_command user_commands[] = {"defbgcolor", cmd_defbgcolor, arg_STRING}, {"defbarpadding", cmd_defbarpadding, arg_STRING}, {"defresizeunit", cmd_defresizeunit, arg_STRING}, - {"defwrapwinlist", cmd_defwrapwinlist, arg_STRING}, + {"defwinliststyle", cmd_defwinliststyle, arg_STRING}, /*@end (tag required for genrpbindings) */ /* Commands to help debug ratpoison. */ @@ -3119,16 +3119,29 @@ cmd_verbexec (int interactive, void *data) } char * -cmd_defwrapwinlist (int interactive, void *data) +cmd_defwinliststyle (int interactive, void *data) { if (data == NULL && !interactive) - return xsprintf ("%d", defaults.wrap_window_list); + return xsprintf ("%s", defaults.window_list_style ? "column":"row"); - if (data == NULL - || sscanf (data, "%d", &defaults.wrap_window_list) < 1) + if (data == NULL) { message (" defwrapwinlist: One argument required "); + return NULL; } - + + if (!strcmp ("column", data)) + { + defaults.window_list_style = STYLE_COLUMN; + } + else if (!strcmp ("row", data)) + { + defaults.window_list_style = STYLE_ROW; + } + else + { + message (" defwrapwinlist: Bad argument "); + } + return NULL; } diff --git a/src/actions.h b/src/actions.h index cc22f84..0b0972a 100644 --- a/src/actions.h +++ b/src/actions.h @@ -62,8 +62,8 @@ char *cmd_deftransgravity (int interactive, void *data); char *cmd_defwaitcursor (int interactive, void *data); char *cmd_defwinfmt (int interactive, void *data); char *cmd_defwingravity (int interactive, void *data); +char *cmd_defwinliststyle (int interactive, void *data); char *cmd_defwinname (int interactive, void *data); -char *cmd_defwrapwinlist (int interactive, void *data); char *cmd_delete (int interactive, void *data); char *cmd_echo (int interactive, void *data); char *cmd_escape (int interactive, void *data); @@ -146,7 +146,7 @@ update_window_names (screen_info *s) bar_buffer = sbuf_new (0); - if(!defaults.wrap_window_list) + if(defaults.window_list_style == STYLE_ROW) { get_window_list (defaults.window_fmt, NULL, bar_buffer, &mark_start, &mark_end); marked_message (sbuf_get (bar_buffer), mark_start, mark_end); @@ -37,6 +37,8 @@ window/frame/screen/etc, Use EMPTY to denote a lack there of. */ #define EMPTY -1 +#define STYLE_ROW 0 +#define STYLE_COLUMN 1 typedef struct rp_window rp_window; typedef struct screen_info screen_info; @@ -175,8 +177,9 @@ struct rp_defaults int startup_message; - /* A toggle for wrapping the window list. */ - int wrap_window_list; + /* Decides whether the window list is displayed in a row or a + column. */ + int window_list_style; /* Pointer warping toggle. */ int warp; @@ -482,7 +482,7 @@ init_defaults () defaults.win_name = 0; defaults.startup_message = 1; defaults.warp = 1; - defaults.wrap_window_list = 0; + defaults.window_list_style = STYLE_ROW; } int diff --git a/src/window.c b/src/window.c index 0153704..8815b71 100644 --- a/src/window.c +++ b/src/window.c @@ -666,7 +666,7 @@ get_window_list (char *fmt, char *delim, struct sbuf *buffer, sbuf_concat (buffer, delim); if (w == current_window()) { - if(!defaults.wrap_window_list){ + if(defaults.window_list_style == STYLE_ROW){ *mark_end = strlen (sbuf_get (buffer)); } else { *mark_end = strlen (sbuf_get(buffer)) - *mark_start; |