summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-04-06 10:28:09 +0000
committersabetts <sabetts>2003-04-06 10:28:09 +0000
commit0034ffb7605fdb3f569e98aca86097f6e480fa8b (patch)
tree410b9d8109eb60c2e3d56e87336ac4621de1f3d1
parent7dad9dd35ea39dbe3faa727cc0c0d074a5ea1abe (diff)
downloadratpoison-0034ffb7605fdb3f569e98aca86097f6e480fa8b.zip
* src/bar.c (marked_wrapped_message): make the marked line span
the whole line. * src/actions.c (cmd_number): update any frames pointing to the windows that have changed.
-rw-r--r--ChangeLog8
-rw-r--r--doc/sample.ratpoisonrc5
-rw-r--r--src/actions.c17
-rw-r--r--src/bar.c62
4 files changed, 60 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f896c4..0e99e81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-06 Shawn Betts <sabetts@sfu.ca>
+
+ * src/bar.c (marked_wrapped_message): make the marked line span
+ the whole line.
+
+ * src/actions.c (cmd_number): update any frames pointing to the
+ windows that have changed.
+
2003-04-05 Shawn Betts <sabetts@sfu.ca>
* src/window.c (get_window_list): if window_list_style is STYLE_COLUMN then
diff --git a/doc/sample.ratpoisonrc b/doc/sample.ratpoisonrc
index 0fc2d67..93a0c72 100644
--- a/doc/sample.ratpoisonrc
+++ b/doc/sample.ratpoisonrc
@@ -1,6 +1,6 @@
# This is a sample .ratpoisonrc file
#
-# $Id: sample.ratpoisonrc,v 1.4 2003/04/05 04:02:17 sabetts Exp $
+# $Id: sample.ratpoisonrc,v 1.5 2003/04/06 10:28:10 sabetts Exp $
# Set the prefix key to that of screen's default
escape C-a
@@ -21,6 +21,9 @@ bind s colon exec xterm -e freshmeat
# bind b (`b' for browse) to interactively ask for an URL to open
bind b colon exec mozilla http://www.
+# Use the name of the program rather than the title in the window list
+defwinname name
+
# bind M-! to store the current frame layout in slot #1
bind M-exclam exec ratpoison -c "setenv fs1 `ratpoison -c 'fdump'`"
diff --git a/src/actions.c b/src/actions.c
index 352818c..e287b4d 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1112,6 +1112,7 @@ cmd_time (int interactive, void *data)
char *
cmd_number (int interactive, void *data)
{
+ rp_window_frame *frame;
int old_number, new_number;
rp_window *other_win, *win;
char *str;
@@ -1180,7 +1181,14 @@ cmd_number (int interactive, void *data)
old_number = win->number;
other_win->number = old_number;
- /* Resort the the window in the list */
+ /* Update the frame containing the window. */
+ if (other_win->frame_number != EMPTY)
+ {
+ frame = screen_get_frame (other_win->scr, other_win->frame_number);
+ frame->win_number = old_number;
+ }
+
+ /* Resort the window in the list */
list_del (&other_win->node);
insert_into_list (other_win, &rp_mapped_window);
}
@@ -1192,6 +1200,13 @@ cmd_number (int interactive, void *data)
win->number = new_number;
numset_add_num (rp_window_numset, new_number);
+ /* Update the frame containing the window. */
+ if (win->frame_number != EMPTY)
+ {
+ frame = screen_get_frame (win->scr, win->frame_number);
+ frame->win_number = new_number;
+ }
+
/* resort the the window in the list */
list_del (&win->node);
insert_into_list (win, &rp_mapped_window);
diff --git a/src/bar.c b/src/bar.c
index 0f2fc64..c084775 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -255,18 +255,13 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end)
int num_lines;
int line_no=0;
char tmp_buf[100];
-
-
-
int width = defaults.bar_x_padding * 2 + max_line_length(msg);
- /* XTextWidth (defaults.font, msg, strlen (msg)); */
- int line_height = (FONT_HEIGHT (defaults.font) + defaults.bar_y_padding * 2);
+ int line_height = (FONT_HEIGHT (defaults.font));
int height;
PRINT_DEBUG (("msg = %s\n", msg));
PRINT_DEBUG (("mark_start = %d, mark_end = %d\n", mark_start, mark_end));
-
num_lines = count_lines(msg, strlen(msg));
height = line_height * num_lines;
@@ -284,33 +279,35 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end)
XMoveResizeWindow (dpy, s->bar_window,
bar_x (s, width), bar_y (s, height),
width,
- height);
+ height + defaults.bar_y_padding * 2);
XRaiseWindow (dpy, s->bar_window);
XClearWindow (dpy, s->bar_window);
XSync (dpy, False);
/* if(!defaults.wrap_window_list){
- XDrawString (dpy, s->bar_window, s->normal_gc,
- defaults.bar_x_padding,
- defaults.bar_y_padding + defaults.font->max_bounds.ascent,
- msg, strlen (msg));
- } else { */
+ XDrawString (dpy, s->bar_window, s->normal_gc,
+ defaults.bar_x_padding,
+ defaults.bar_y_padding + defaults.font->max_bounds.ascent,
+ msg, strlen (msg));
+ } else { */
for(i=0; i<=strlen(msg); ++i) {
- if (msg[i]!='\0' && msg[i]!='\n') {
- tmp_buf[j]=msg[i];
- j++;
- }
- else {
- tmp_buf[j]='\0';
- XDrawString (dpy, s->bar_window, s->normal_gc,
- defaults.bar_x_padding,
- defaults.bar_y_padding + defaults.font->max_bounds.ascent
- + line_no * line_height,
- tmp_buf, strlen(tmp_buf));
- j=0;
- line_no++;
- }
+ if (msg[i]!='\0' && msg[i]!='\n')
+ {
+ tmp_buf[j]=msg[i];
+ j++;
+ }
+ else
+ {
+ tmp_buf[j]='\0';
+ XDrawString (dpy, s->bar_window, s->normal_gc,
+ defaults.bar_x_padding,
+ defaults.bar_y_padding + defaults.font->max_bounds.ascent
+ + line_no * line_height,
+ tmp_buf, strlen(tmp_buf));
+ j=0;
+ line_no++;
+ }
}
@@ -360,7 +357,7 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end)
PRINT_DEBUG (("start_line = %d, end_line = %d\n", start_line, end_line));
if (mark_start == 0 || start_pos_in_line == 0)
- start = 0;
+ start = defaults.bar_x_padding;
else
start = XTextWidth (defaults.font,
&msg[start_line_beginning],
@@ -373,7 +370,8 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end)
if (mark_end != strlen (msg)) end -= defaults.bar_x_padding;
- width = end - start;
+/* width = end - start; */
+ width = max_line_length(msg);
PRINT_DEBUG (("start = %d, end = %d, width = %d\n", start, end, width));
@@ -382,12 +380,16 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end)
mask = GCForeground | GCFunction;
lgc = XCreateGC(dpy, s->root, mask, &lgv);
- XFillRectangle (dpy, s->bar_window, lgc, start, (start_line-1)*line_height, width, (end_line-start_line+1)*line_height);
+ XFillRectangle (dpy, s->bar_window, lgc,
+ start, (start_line-1)*line_height + defaults.bar_y_padding,
+ width, (end_line-start_line+1)*line_height);
lgv.foreground = s->bg_color;
lgc = XCreateGC(dpy, s->root, mask, &lgv);
- XFillRectangle (dpy, s->bar_window, lgc, start, (start_line-1)*line_height, width, (end_line-start_line+1)*line_height);
+ XFillRectangle (dpy, s->bar_window, lgc,
+ start, (start_line-1)*line_height + defaults.bar_y_padding,
+ width, (end_line-start_line+1)*line_height);
}
/* Keep a record of the message. */