From 393a3d6cd2e88b9792d328f8fa2e2b796451fb7c Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sun, 25 Nov 2012 16:09:07 +0100 Subject: [PATCH] Remove hidden monitor heads at xinerama sizes construction time --- contrib/contrib-example.lisp | 41 ++++++++++++++++++++++++++++++++++++++--- src/clfswm-internal.lisp | 19 +++++++++---------- 2 files changed, 47 insertions(+), 13 deletions(-) rewrite contrib/contrib-example.lisp (68%) diff --git a/contrib/contrib-example.lisp b/contrib/contrib-example.lisp dissimilarity index 68% index 006497c..7c77536 100644 --- a/contrib/contrib-example.lisp +++ b/contrib/contrib-example.lisp @@ -1,3 +1,38 @@ -(in-package :clfswm) - -(format t "My contribution code start here~%") +;;; -------------------------------------------------------------------------- +;;; CLFSWM - FullScreen Window Manager +;;; +;;; -------------------------------------------------------------------------- +;;; Documentation: A contrib example. +;;; -------------------------------------------------------------------------- +;;; +;;; (C) 2012 Philippe Brochard +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;; +;;; Documentation: A contrib example. +;;; If you want to use this file, just add this line in +;;; your configuration file: +;;; +;;; (load-contrib "contrib-example.lisp") +;;; +;;; -------------------------------------------------------------------------- + +(in-package :clfswm) + +(format t "Loading Contrib Example code... ") + +(format t "~&My contribution code start here~%") + +(format t "done~%") diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index 90a75a0..ea0a3eb 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -814,7 +814,7 @@ (parse-integer string :junk-allowed t)) (split-string (substitute #\space #\x (substitute #\space #\, line)))))) -(defun get-connected-heads-size (&optional (fake (string= (getenv "DISPLAY") ":1"))) +(defun get-connected-heads-size (&optional fake) (labels ((heads-info () (if (not fake) (do-shell "xdpyinfo -ext XINERAMA") @@ -836,20 +836,19 @@ XINERAMA version 1.1 opcode: 150 do (when (search " head " line) (destructuring-bind (w h x y) (parse-xinerama-info line) - (push (list x y w h) sizes)))) - (remove-if (lambda (size) - (destructuring-bind (x y w h) size - (dolist (s sizes) - (unless (eq s size) + (let ((found + (dolist (s sizes) (destructuring-bind (x1 y1 w1 h1) s (when (and (>= x x1) (>= y y1) (<= (+ x w) (+ x1 w1)) (<= (+ y h) (+ y1 h1))) - (return t))))))) - sizes))))) - ;;'((10 10 500 300) (550 50 400 400) (100 320 400 270)))))) - ;;'((10 10 500 580) (540 50 470 500)))))) + (return t)))))) + (unless found + (push (list x y w h) sizes)))))) + sizes)))) +;;'((10 10 500 300) (550 50 400 400) (100 320 400 270)))))) +;;'((10 10 500 580) (540 50 470 500)))))) (let ((last-sizes nil)) -- 2.11.4.GIT