Raise window only if there is no maxsize fullscreenned windows (ex: SDL windows in...
authorPhilippe Brochard <pbrochard@common-lisp.net>
Thu, 10 Jan 2013 08:53:29 +0000 (10 09:53 +0100)
committerPhilippe Brochard <pbrochard@common-lisp.net>
Thu, 10 Jan 2013 08:53:29 +0000 (10 09:53 +0100)
src/clfswm-internal.lisp
src/xlib-util.lisp

index 819a420..72240f3 100644 (file)
@@ -1071,7 +1071,9 @@ XINERAMA version 1.1 opcode: 150
   (lower-window window (frame-window child)))
 
 (defmethod set-child-stack-order (window child)
-  (declare (ignore window child)))
+  (declare (ignore child))
+  (unless (maxmin-size-equal-window-in-tree)
+    (raise-window window)))
 
 
 
index 97ff700..6210c6e 100644 (file)
@@ -328,6 +328,31 @@ they should be windows. So use this function to make a window out of them."
 
 
 
+(defun maxmin-size-equal-p (window)
+  (when (xlib:window-p window)
+    (let ((hints (xlib:wm-normal-hints window)))
+      (when hints
+        (let ((hint-x (xlib:wm-size-hints-x hints))
+              (hint-y (xlib:wm-size-hints-y hints))
+              (user-specified-position-p (xlib:wm-size-hints-user-specified-position-p hints))
+              (min-width (xlib:wm-size-hints-min-width hints))
+              (min-height (xlib:wm-size-hints-min-height hints))
+              (max-width (xlib:wm-size-hints-max-width hints))
+              (max-height (xlib:wm-size-hints-max-height hints)))
+          (and hint-x hint-y min-width max-width min-height max-height
+               user-specified-position-p
+               (= hint-x 0) (= hint-y 0)
+               (= min-width max-width)
+               (= min-height max-height)))))))
+
+(defun maxmin-size-equal-window-in-tree ()
+  (dolist (win (xlib:query-tree *root*))
+    (when (maxmin-size-equal-p win)
+      (return win))))
+
+
+
+
 (defun window-state (win)
   "Get the state (iconic, normal, withdrawn) of a window."
   (first (xlib:get-property win :WM_STATE)))