[clfswm-cvs] r319 - in clfswm: . src

Philippe Brochard pbrochard at common-lisp.net
Sat Sep 11 21:38:01 UTC 2010


Author: pbrochard
Date: Sat Sep 11 17:38:01 2010
New Revision: 319

Log:
set-hide-unmanaged-window, set-show-unmanaged-window, set-default-hide-unmanaged-window: New functions and menu entry to hide or not unmanaged windows.

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-util.lisp
   clfswm/src/config.lisp
   clfswm/src/menu-def.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sat Sep 11 17:38:01 2010
@@ -1,5 +1,14 @@
 2010-09-11  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-util.lisp (set-hide-unmanaged-window)
+	(set-show-unmanaged-window, set-default-hide-unmanaged-window):
+	New functions and menu entry.
+
+	* src/clfswm-internal.lisp (hide-unmanager-window-p): New
+	function.
+	(show-child): Add a data slot on frame to hide or not unmanaged
+	windows.
+
 	* src/clfswm-corner.lisp (present-clfswm-terminal)
 	(present-virtual-keyboard): Use a function (generic-present-body)
 	instead of a macro (generate-present-body).

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Sat Sep 11 17:38:01 2010
@@ -542,8 +542,18 @@
   (display-frame-info frame))
 
 
+
+(defun hide-unmanager-window-p (parent)
+  (let ((action (frame-data-slot parent :unmanaged-window-action)))
+    (case action
+      (:hide t)
+      (:show nil)
+      (t *hide-unmanaged-window*))))
+
+
 (defmethod show-child ((window xlib:window) parent raise-p)
   (if (or (managed-window-p window parent)
+	  (not (hide-unmanager-window-p parent))
 	  (child-equal-p parent *current-child*))
       (progn
 	(map-window window)

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Sat Sep 11 17:38:01 2010
@@ -1347,3 +1347,23 @@
     (do-run-other-window-manager wm)))
 
 
+;;; Hide or show unmanaged windows utility.
+(defun set-hide-unmanaged-window ()
+  "Hide unmanaged windows when frame is not selected"
+  (when (frame-p *current-child*)
+    (setf (frame-data-slot *current-child* :unmanaged-window-action) :hide)
+    (leave-second-mode)))
+
+(defun set-show-unmanaged-window ()
+  "Show unmanaged windows when frame is not selected"
+  (when (frame-p *current-child*)
+    (setf (frame-data-slot *current-child* :unmanaged-window-action) :show)
+    (leave-second-mode)))
+
+(defun set-default-hide-unmanaged-window ()
+  "Set default behaviour to hide or not unmanaged windows when frame is not selected"
+  (when (frame-p *current-child*)
+    (setf (frame-data-slot *current-child* :unmanaged-window-action) nil)
+    (leave-second-mode)))
+
+

Modified: clfswm/src/config.lisp
==============================================================================
--- clfswm/src/config.lisp	(original)
+++ clfswm/src/config.lisp	Sat Sep 11 17:38:01 2010
@@ -55,6 +55,9 @@
 A list of (predicate-function-on-window expected-string)")
 
 
+(defparameter *hide-unmanaged-window* t
+  "Config(): Hide or not unmanaged windows when a child is deselected.")
+
 ;;; CONFIG - Screen size
 (defun get-fullscreen-size ()
   "Return the size of root child (values rx ry rw rh)

Modified: clfswm/src/menu-def.lisp
==============================================================================
--- clfswm/src/menu-def.lisp	(original)
+++ clfswm/src/menu-def.lisp	Sat Sep 11 17:38:01 2010
@@ -95,6 +95,7 @@
 (add-sub-menu 'frame-menu "m" 'frame-movement-menu "Frame movement menu")
 (add-sub-menu 'frame-menu "f" 'frame-focus-policy "Frame focus policy menu")
 (add-sub-menu 'frame-menu "w" 'frame-managed-window-menu "Managed window type menu")
+(add-sub-menu 'frame-menu "u" 'frame-unmanaged-window-menu "Unmanaged window behaviour")
 (add-sub-menu 'frame-menu "s" 'frame-miscellaneous-menu "Frame miscallenous menu")
 (add-menu-key 'frame-menu "x" 'frame-toggle-maximize)
 
@@ -155,6 +156,10 @@
 (add-menu-key 'frame-managed-window-menu "n" 'current-frame-manage-only-normal-window-type)
 (add-menu-key 'frame-managed-window-menu "u" 'current-frame-manage-no-window-type)
 
+(add-menu-key 'frame-unmanaged-window-menu "s" 'set-show-unmanaged-window)
+(add-menu-key 'frame-unmanaged-window-menu "h" 'set-hide-unmanaged-window)
+(add-menu-key 'frame-unmanaged-window-menu "d" 'set-default-hide-unmanaged-window)
+
 
 (add-menu-key 'frame-miscellaneous-menu "s" 'show-all-frames-info)
 (add-menu-key 'frame-miscellaneous-menu "i" 'hide-all-frames-info)




More information about the clfswm-cvs mailing list