stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] Patch: Consistent behavior of group commands


From: Ramkumar R
Subject: [STUMP] Patch: Consistent behavior of group commands
Date: Tue, 23 Jun 2009 16:47:32 +0530

Hi,

I would like to humbly contribute a small patch to ensure consistent
behavior of gnew and gnew-float. Additionally, I've created a
gnewbg-float command corresponding to the gnewbg command and suitably
modified stumpwm.texi.in to include the new commands.

p.s- I think we should advertise the fact that we have floating groups
now. The online documentation at http://nongnu.org/stumpwm/manual
(generated from stumpwm.texi) is outdated and needs to be updated with
this information.


diff --git a/floating-group.lisp b/floating-group.lisp
index b143caa..2d025ee 100644
--- a/floating-group.lisp
+++ b/floating-group.lisp
@@ -220,5 +220,10 @@
   (declare (ignore x y where))
   )

-(defcommand gnew-float (name) ((:rest "Name: "))
-  (add-group (current-screen) name 'float-group))
+(defcommand gnew-float (name) ((:rest "Group Name: "))
+"Create a floating window group with the specified name and switch to it."
+  (add-group (current-screen) name nil 'float-group))
+
+(defcommand gnewbg-float (name) ((:rest "Group Name: "))
+"Create a floating window group with the specified name, but do not
switch to it."
+  (add-group (current-screen) name t 'float-group))
diff --git a/group.lisp b/group.lisp
index 26f1a4b..f4365d3 100644
--- a/group.lisp
+++ b/group.lisp
@@ -258,7 +258,7 @@ Groups are known as \"virtual desktops\" in the
NETWM standard."
       (netwm-update-groups screen)
       (netwm-set-group-properties screen))))

-(defun add-group (screen name &optional (type *default-group-type*))
+(defun add-group (screen name &optional bg-flag (type *default-group-type*))
   "Create a new group in SCREEN with the supplied name. group names
     starting with a . are considered hidden groups. Hidden groups are
     skipped by gprev and gnext and do not show up in the group
@@ -278,6 +278,9 @@ Groups are known as \"virtual desktops\" in the
NETWM standard."
           (setf (screen-groups screen) (append (screen-groups screen)
(list ng)))
           (netwm-set-group-properties screen)
           (netwm-update-groups screen)
+         (if bg-flag
+             nil
+             (switch-to-group ng))
           ng))))

 (defun find-group (screen name)
@@ -313,15 +316,11 @@ current group. If @var{name} begins with a dot
(``.'') the group new
 group will be created in the hidden state. Hidden groups have group
 numbers less than one and are invisible to from gprev, gnext, and, optionally,
 groups and vgroups commands."
-  (let ((group (add-group (current-screen) name)))
-    (if group
-        (switch-to-group group)
-        (message "^B^3*Groups must have a name!"))))
+  (add-group (current-screen) name nil))

 (defcommand gnewbg (name) ((:string "Group Name: "))
 "Create a new group but do not switch to it."
-  (unless (find-group (current-screen) name)
-    (add-group (current-screen) name)))
+  (add-group (current-screen) name t))

 (defcommand gnext () ()
 "Cycle to the next group in the group list."
diff --git a/stumpwm.texi.in b/stumpwm.texi.in
index 9e0ee7f..e5c0751 100644
--- a/stumpwm.texi.in
+++ b/stumpwm.texi.in
@@ -13,7 +13,7 @@
 @ifinfo
 This is the Stump Window Manager user manual.

-Copyright @copyright{} 2000-2008 Shawn Betts
+Copyright @copyright{} 2000-2009 Shawn Betts

 Permission is granted to make and distribute verbatim
 copies of this manual provided the copyright notice and
@@ -1102,7 +1102,9 @@ Groups in StumpWM are more commonly known as
@dfn{virtual desktops} or
 @dfn{workspaces}. Why not create a new term for it?

 !!! gnew
+!!! gnew-float
 !!! gnewbg
+!!! gnewbg-float
 !!! gnext
 !!! gprev
 !!! gnext-with-window


-- 
Artagnon (.com)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]