From 958903d3e524dc78fe97898fb19aed6f5d3e5e99 Mon Sep 17 00:00:00 2001 From: James Wright Date: Fri, 14 Nov 2008 10:01:24 -0800 Subject: [PATCH] MAKE-SCREEN-HEADS now sorts heads by size before deleting duplicates. This ensures that the largest overlapping head will be retained (since DELETE-DUPLICATES is guaranteed to remove the duplicate that occurs earlier in the list). That in turn means that people like me who mirror their laptop screen to a larger monitor are able to use all of the larger monitor's real estate. --- screen.lisp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/screen.lisp b/screen.lisp index 19eebdb..852d66f 100644 --- a/screen.lisp +++ b/screen.lisp @@ -491,7 +491,6 @@ FOCUS-WINDOW is an extra window used for _NET_SUPPORTING_WM_CHECK." :height height) (parse-error () nil)))) - (defun make-screen-heads (screen root) "or use xdpyinfo to query the xinerama extension, if it's enabled." (or (and (xlib:query-extension *display* "XINERAMA") @@ -501,10 +500,12 @@ FOCUS-WINDOW is an extra window used for _NET_SUPPORTING_WM_CHECK." for i = 0 then (1+ i) for h in (delete-duplicates - (loop for i in (split-string (run-shell-command "xdpyinfo -ext XINERAMA" t)) - for head = (parse-xinerama-head i) - when head - collect head) + (sort + (loop for i in (split-string (run-shell-command "xdpyinfo -ext XINERAMA" t)) + for head = (parse-xinerama-head i) + when head + collect head) + '< :key (lambda (f) (* (frame-width f) (frame-height f)))) :test #'frames-overlap-p) do (setf (head-number h) i) collect h))) -- 1.5.4.3