[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] netwm: client list
From: |
Magnus Henoch |
Subject: |
[STUMP] netwm: client list |
Date: |
Tue, 01 May 2007 17:59:18 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (berkeley-unix) |
This patch adds support for the _NET_CLIENT_LIST property, which makes
"wmctrl -a" happy, and hopefully other tasklist programs as well.
(The most interesting such programs are probably those that want to
run in a dock... I'll come to that later)
The list is updated in add-window, restore-window and withdraw-window;
I think that's all that's needed.
Magnus
cvs diff: Diffing .
Index: core.lisp
===================================================================
RCS file: /cvsroot/stumpwm/stumpwm/core.lisp,v
retrieving revision 1.133
diff -u -r1.133 core.lisp
--- core.lisp 28 Apr 2007 01:41:41 -0000 1.133
+++ core.lisp 1 May 2007 15:55:02 -0000
@@ -692,6 +692,11 @@
window))
(defun add-window (screen xwin)
+ (xlib:change-property (xlib:screen-root (screen-number screen))
+ :_NET_CLIENT_LIST
+ (list xwin) :window 32
+ :transform #'xlib:drawable-id
+ :mode :append)
(push xwin (screen-mapped-windows screen))
(group-add-window (screen-current-group screen) xwin))
@@ -748,7 +753,13 @@
(if (eq (window-group window) (current-group))
(echo-string (window-screen window) (format nil "'~a' denied map
request" (window-name window)))
(echo-string (window-screen window) (format nil "'~a' denied map
request in group ~a" (window-name window) (group-name (window-group window))))))
- (frame-raise-window (window-group window) (window-frame window)
window))))
+ (progn
+ (frame-raise-window (window-group window) (window-frame window)
window)
+ (xlib:change-property (xlib:screen-root (screen-number screen))
+ :_NET_CLIENT_LIST
+ (list (window-xwin window)) :window 32
+ :transform #'xlib:drawable-id
+ :mode :append)))))
(defun withdraw-window (window)
"Withdrawing a window means just putting it in a list til we get a destroy
event."
@@ -773,6 +784,17 @@
(when (window-in-current-group-p window)
;; since the window doesn't exist, it doesn't have focus.
(setf (screen-focus screen) nil))
+ ;; update _NET_CLIENT_LIST
+ (let* ((root-window (xlib:screen-root (screen-number screen)))
+ (client-list (xlib:get-property root-window
+ :_NET_CLIENT_LIST
+ :type :window)))
+ (xlib:change-property root-window
+ :_NET_CLIENT_LIST
+ (remove (xlib:drawable-id (window-xwin window))
+ client-list)
+ :window 32
+ :mode :replace))
;; If the current window was removed, then refocus the frame it
;; was in, since it has a new current window
(when (eq (tile-group-current-frame group) f)
@@ -1726,7 +1748,7 @@
(mapcar (lambda (a)
(xlib:intern-atom *display* a))
(append +netwm-supported+
- (mapcar 'car +netwm-window-types+)))
+ (mapcar #'car +netwm-window-types+)))
:atom 32)
;; _NET_SUPPORTING_WM_CHECK
@@ -1739,9 +1761,13 @@
(xlib:change-property focus-window :_NET_WM_NAME
"stumpwm"
:string 8 :transform #'xlib:char->card8)
-
- ;; _NET_CLIENT_LIST: TODO
-
+
+ ;; _NET_CLIENT_LIST
+ (xlib:change-property root :_NET_CLIENT_LIST
+ () :window 32
+ :transform #'xlib:drawable-id)
+ ;; TODO: _NET_CLIENT_LIST_STACKING
+
;; _NET_NUMBER_OF_DESKTOPS
(xlib:change-property root :_NET_NUMBER_OF_DESKTOPS (list 1) :cardinal 32)
- [STUMP] netwm: client list,
Magnus Henoch <=