summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-05-20 05:23:02 +0000
committersabetts <sabetts>2004-05-20 05:23:02 +0000
commit6f0409e582148c7611133cb1116c934ff312b204 (patch)
tree450e445a0c4241b01adb6835d55ce3a615b551a9
parentf8ad8356936498a6ade16bc5d55ea6af4c1e33bc (diff)
downloadratpoison-6f0409e582148c7611133cb1116c934ff312b204.zip
(format_window_name): add %f format option
-rw-r--r--ChangeLog4
-rw-r--r--NEWS5
-rw-r--r--doc/ratpoison.texi3
-rw-r--r--src/window.c12
4 files changed, 23 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ec11ad7..1457aae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-19 Shawn Betts <sabetts@vcn.bc.ca>
+
+ * src/window.c (format_window_name): add %f format option
+
2004-05-05 Shawn Betts <sabetts@vcn.bc.ca>
* src/input.c (grab_key): use keysym_to_keycode_mod to get the
diff --git a/NEWS b/NEWS
index da1f219..bb30f0a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
ratpoison NEWS --- history of user-visible changes. -*- outline -*-
+* Changes since 1.3.0-rc2-beta2
+** new format option %f
+This options displays the frame number the window is in or a space if
+it is not in a window.
+
* Changes since 1.3.0-rc2-beta1
** New command 'set'
set replaces the def* commands. For example 'defwinliststyle column'
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index db2c0a7..6061d70 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -369,6 +369,9 @@ X11 Window ID
@item %l
A unique number based on when the window was last accessed. The higher
the number, the more recently it was accessed.
+@item %f
+The frame number the window is displayed in or a space if it is not in
+a frame.
@end table
When called non-interactively with no arguments, the current setting is
diff --git a/src/window.c b/src/window.c
index c39142a..8e71afb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -329,7 +329,6 @@ give_window_focus (rp_window *win, rp_window *last_win)
counter++;
win->last_access = counter;
-
unhide_window (win);
if (defaults.warp)
@@ -544,6 +543,7 @@ print_window_information (rp_window *win)
%c - resource class
%i - X11 Window ID
%l - last access number
+ %f - print the frame number the window is in
*/
static void
@@ -607,6 +607,16 @@ format_window_name (char *fmt, rp_window_elem *win_elem, rp_window *other_win,
sbuf_concat (buffer, dbuf);
break;
+ case 'f':
+ if (win_elem->win->frame_number != EMPTY)
+ {
+ snprintf (dbuf, 9, "%d", win_elem->win->frame_number);
+ sbuf_concat (buffer, dbuf);
+ }
+ else
+ sbuf_concat (buffer, " ");
+ break;
+
case '%':
sbuf_concat (buffer, "%");
break;