[clfswm-devel] Request for comments: changing the meaning of group in CLFSWM.

Philippe Brochard pbrochard at common-lisp.net
Tue Mar 25 22:23:19 UTC 2008


Cyrille Thouvenin writes:

>>>>>> "PB" == Philippe Brochard <pbrochard at common-lisp.net> writes:
> Hi,
>
>     PB> Cyrille propose to change the meaning of groups in CLFSWM:
>
>     PB> "I am trying to make a case to change  the meaning of group in
>     PB> CLFSWM. For   me, group is   a better  word  for  an arbitrary
>     PB> ensemble. In CLFSWM, groups are not so arbitrary as it is link
>     PB> to a geometry inclusion  relation. So, I  would prefer to  use
>     PB> frame in that particular  case as this  word has a geometrical
>     PB> sounding."
>
>     PB> You can see the thread on the trac:
>     PB> http://trac.common-lisp.net/clfswm/wiki/UserAPI
>
>     PB> For actions on children   with no geometry relationship   (ie:
>     PB> children  in arbitrary groups)  I  propose a tag based system.
>     PB> Each group have a list of tags and we can perform actions from
>     PB> those tags.
>
>     PB> And  you, what is   your   prefered system  to   interact with
>     PB> arbitrary children?
>
>     PB> I'd like to have some comments before doing anything so brutal
>     PB> on the code :)
>
> Here is a comparison I make between a tag system and this group system:
>
> Definition:
> - Group:
>   - An item  is a group  that contains itself.   A group can also be a
>     member of another group. So we have a DAG representation.
>   - An extension  so as to have a  namespace organisation:  Each group
>     has a name that  must be unique   in any membership it takes  part
>     to. That could be also  the number in  the list of member for each
>     membership (relaxed   constraint  on the  uniqueness).   So, it is
>     possible to identify the group thanks to a  path in the DAG. There
>     is a special group which is the root.
> - Tag: 
>   - Each item  can   hold multiple  tag.  So,  we   also have  a   DAG
>     representation.
>   - A tag is a name. A set is directly named by its  tag. So, there is
>     one namespace.
>
> Similarities:
> - The model  behind the tag system is  the  same as the group  system,
>   that is a DAG; Each item can be a member of multiple set.
>
> Particularity of a tag system:
> - Tag are position on a item by item basis
> - No operation on set
> - Simpler to implement
>
> Particularity of the group system:
> - Problem with group containing itself: This constraint must be enforced.
> - With path, multiple namespace can be represented. Need for a current
>   group a la "cd" (the Unix command) to ease navigation.
> - Set operation  (inclusion). A whole  group of item can become member
>   of group and if   an item is added  to  the first group, it   become
>   automaticaly  member  of   the second   group.  While  performing  a
>   new membership, the uniqueness of the name must be enforced.
> - More features, but more complexity in the implementation.
>
> Finally, if you have a group system, you have a tag system: In a group
> system,  you could have  the groups that  are a direct children of the
> root group. Those child groups are the tag.
>
> Feel free to comment,
>
Ok, nice comparision. But what do you want to do with groups (your
definition) in the window manager?

In all cases, I think frame is a better name. And it follow the naming
from stumpwm or ion. So I'll rename all group in frame in the clfswm
code (thanks tag-query-replace :)

For a particular implementation of groups or tags, I let you free to
do what you want. Just place your code in contrib/.

For example, the tags system is nearlly already there because as I
can't think to all possibilities with groups (hmm, frames) each frame
has a frame-data slot for arbitrary storage.

A pseudo-code may look like this:

--------------------------------------------------
(defun add-tag (tag frame)
  (setf (frame-data-slot frame :tags) 
        (append (frame-data-slot frame :tags) (list tag))))

(defun remove-tag (tag frame)
  (setf (frame-data-slot frame :tags) 
        (remove tag (frame-data-slot frame :tags))))

(defun action-from-tag (tag root fn-action)
  (with-all-frames (root frame)
    (when (member tag (frame-data-slot frame :tags))
      (funcall fn-action frame))))

* And here a function to graphically define a tag for a frame 
(with query-input or something like this) *
--------------------------------------------------

Maybe I'll put this in the contrib directory.
For now I stay with windows and frames only. But maybe the need for
groups will pop up soon :)


Regards,

Philippe

-- 
Philippe Brochard    <pbrochard at common-lisp.net>
                      http://hocwp.free.fr




More information about the clfswm-devel mailing list