[PATCH 3/4] "mark-window-as-dockapp" function - turn window into dockapp



Signed-off-by: Alexey I. Froloff <raorn altlinux org>
---
 lisp/sawfish/wm/windows.jl |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl
index 46a8a9a..a7998f3 100644
--- a/lisp/sawfish/wm/windows.jl
+++ b/lisp/sawfish/wm/windows.jl
@@ -33,6 +33,8 @@
 	     mark-window-as-desktop
 	     dock-window-p
 	     mark-window-as-dock
+	     dockapp-window-p
+	     mark-window-as-dockapp
 	     window-in-cycle-p
 	     window-class
 	     window-pid
@@ -110,6 +112,12 @@
 		       sticky-viewport placed)
     "List of properties set (to true) on windows when they are marked as docks.")
 
+  (defvar dockapp-window-properties
+    '(never-focus cycle-skip window-list-skip task-list-skip avoid sticky
+		  sticky-viewport ignore-program-position never-iconify
+		  never-maximize no-history)
+    "List of properties set (to true) on windows when they are marked as dockapps.")
+
   (defvar desktop-window-properties
     '(fixed-position sticky sticky-viewport)
     "List of properties set (to true) on windows when they are marked as desktops.")
@@ -120,6 +128,9 @@
   (defvar dock-window-depth 0
     "The stacking depth of dock windows.")
 
+  (defvar dockapp-window-depth -1
+    "The stacking depth of dockapp windows.")
+
 ;;; finding windows, reading properties
 
   (define (get-window-by-name name)
@@ -204,6 +215,23 @@ then be the numeric id of its parent window."
     (set-window-type w 'dock)
     (set-window-depth w dock-window-depth))
 
+  (define (dockapp-window-p arg)
+    "Return true if ARG represents a dockapp window."
+    (and (windowp arg) (window-get arg 'dockapp-type)))
+
+  (define (mark-window-as-dockapp w)
+    "Mark that the window associated with object W is a dockapp window."
+    (require 'sawfish.wm.stacking)
+    (require 'sawfish.wm.frames)
+    (require 'sawfish.wm.util.groups)
+    (window-put w 'dockapp-type t)
+    (mapc (lambda (p)
+	    (window-put w p t)) dockapp-window-properties)
+    (set-window-type w 'dockapp)
+    (set-window-depth w dockapp-window-depth)
+    (add-window-to-group w 'dockapps)
+    (window-put w 'place-mode 'dockapp))
+
   (define (window-in-cycle-p w #!key ignore-cycle-skip)
     "Returns true if the window W should be included when cycling between
 windows."
-- 
1.7.0.4



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