The correct way of adding a systray (stalonetray)

Michaël Cadilhac michael at cadilhac.name
Fri Dec 13 22:59:43 UTC 2013


Hi there everyone;

Resuming my question on systrays, I'm searching for the right way
(read: CLFSM way) for such an addition.  I went, as Philippe
suggested, for using a standalone systray program, stalonetray.  Once
launched, it has three defects:
1- Position.  Ideally, it'd be located in the toolbar (the latter
coming from toolbar.lisp).
2- Rotation.  When circulating among windows, it shouldn't be part of the cycle.
3- Membership in a frame.  The systray should be frame agnostic.

For 1 and 3, I have no clue, and require some help :-).  For 1, I just
move the little tray up when I start stalonetray, but a programmatic
way would be better for sure.
As for 2, I modified select-previous|next-child-simple adding:

      (let ((current-head (car child)))
       (loop do (setf child (rotate-list child))
             until (or (not (xlib:window-p (car child)))
                       (eq current-head (car child))
                       (not (eq (window-type (car child)) :dock)))))

but it seems that it requires a little change in window-type so that
the _NET_WM_WINDOW_TYPE is queried *before* the wm-size-hints are
checked (see attached).  It does work then, but is it the right way to
do things?

Thanks!

Unrelated; in the Makefile, shouldn't $(DESTDIR)/man/man.1/clfswm.1
nowadays read $(DESTDIR)/share/man/man1/clfswm.1 ?
-------------- next part --------------
diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp
index 8dae671..55873a2 100644
--- a/src/xlib-util.lisp
+++ b/src/xlib-util.lisp
@@ -515,7 +515,12 @@ they should be windows. So use this function to make a window out of them."
   "Return one of :desktop, :dock, :toolbar, :utility, :splash,
 :dialog, :transient, :maxsize and :normal."
   (when (xlib:window-p window)
-    (or (and (let ((hints (xlib:wm-normal-hints window)))
+    (or (let ((net-wm-window-type (xlib:get-property window :_NET_WM_WINDOW_TYPE)))
+          (when net-wm-window-type
+            (dolist (type-atom net-wm-window-type)
+              (when (assoc (xlib:atom-name *display* type-atom) +netwm-window-types+)
+                (return (cdr (assoc (xlib:atom-name *display* type-atom) +netwm-window-types+)))))))
+	(and (let ((hints (xlib:wm-normal-hints window)))
                (and hints (or (and (xlib:wm-size-hints-max-width hints)
                                    (< (xlib:wm-size-hints-max-width hints) (x-drawable-width *root*)))
                               (and (xlib:wm-size-hints-max-height hints)
@@ -523,11 +528,6 @@ they should be windows. So use this function to make a window out of them."
                               (xlib:wm-size-hints-min-aspect hints)
                               (xlib:wm-size-hints-max-aspect hints))))
              :maxsize)
-        (let ((net-wm-window-type (xlib:get-property window :_NET_WM_WINDOW_TYPE)))
-          (when net-wm-window-type
-            (dolist (type-atom net-wm-window-type)
-              (when (assoc (xlib:atom-name *display* type-atom) +netwm-window-types+)
-                (return (cdr (assoc (xlib:atom-name *display* type-atom) +netwm-window-types+)))))))
         (and (xlib:get-property window :WM_TRANSIENT_FOR)
              :transient)
         :normal)))


More information about the clfswm-devel mailing list