[ghc-xmonad-contrib] make PositionStore only rescale windows that are larger than new screen; allow X11-1.6

Jens Petersen petersen at fedoraproject.org
Mon Jun 11 02:05:11 UTC 2012


commit f494c9ce349e83b080d11886b3ad8d35d6f92e27
Author: Jens Petersen <petersen at redhat.com>
Date:   Mon Jun 11 11:05:05 2012 +0900

    make PositionStore only rescale windows that are larger than new screen; allow X11-1.6

 ghc-xmonad-contrib.spec                            |   11 +++++-
 ...10-PositionStore-dont-rescale-with-screen.patch |   37 ++++++++++++++++++++
 xmonad-contrib-0.10-X11-1.6.patch                  |   12 ++++++
 3 files changed, 59 insertions(+), 1 deletions(-)
---
diff --git a/ghc-xmonad-contrib.spec b/ghc-xmonad-contrib.spec
index 1e2f42a..ee30294 100644
--- a/ghc-xmonad-contrib.spec
+++ b/ghc-xmonad-contrib.spec
@@ -19,7 +19,7 @@ your own extensions.
 
 Name:           ghc-%{pkg_name}
 Version:        0.10
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        %{common_summary}
 
 Group:          System Environment/Libraries
@@ -47,6 +47,8 @@ BuildRequires:  ghc-xmonad-devel
 Patch1:         xmonad-contrib-0.10-xft-fonts.patch
 Patch2:         xmonad-contrib-0.10-ewmh-set-NET_WM_STATE.patch
 Patch3:         xmonad-contrib-0.10-BorderResize-smaller.patch
+Patch4:         xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch
+Patch5:         xmonad-contrib-0.10-X11-1.6.patch
 
 %description
 %{common_description}
@@ -57,6 +59,8 @@ Patch3:         xmonad-contrib-0.10-BorderResize-smaller.patch
 %patch1 -p1 -b .orig-misc-fixed
 %patch2 -p1 -b .orig-NET_WM_STATE
 %patch3 -p1 -b .orig-mouseborder
+%patch4 -p1 -b .orig-rescale
+%patch5 -p1 -b .orig-X11
 
 
 %build
@@ -81,6 +85,11 @@ Patch3:         xmonad-contrib-0.10-BorderResize-smaller.patch
 
 
 %changelog
+* Sun May 13 2012 Jens Petersen <petersen at redhat.com> - 0.10-5
+- patch XMonad.Util.PositionStore to not scale the size of windows
+  when changing screen unless the window is now larger than the monitor
+- allow building with X11-1.6
+
 * Fri Mar 23 2012 Jens Petersen <petersen at redhat.com> - 0.10-4
 - add license to ghc_files
 
diff --git a/xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch b/xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch
new file mode 100644
index 0000000..96fb3c8
--- /dev/null
+++ b/xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch
@@ -0,0 +1,37 @@
+diff -rN -u old-XMonadContrib/XMonad/Util/PositionStore.hs new-XMonadContrib/XMonad/Util/PositionStore.hs
+--- old-XMonadContrib/XMonad/Util/PositionStore.hs	2012-05-13 20:21:34.785720303 +0900
++++ new-XMonadContrib/XMonad/Util/PositionStore.hs	2012-05-13 20:21:34.814720213 +0900
+@@ -36,7 +36,7 @@
+ 
+ data PositionStore = PS (M.Map Window PosStoreRectangle)
+                             deriving (Read,Show,Typeable)
+-data PosStoreRectangle = PSRectangle Double Double Double Double
++data PosStoreRectangle = PSRectangle Double Double Dimension Dimension
+                             deriving (Read,Show,Typeable)
+ 
+ instance ExtensionClass PositionStore where
+@@ -55,8 +55,7 @@
+         offsetY = y - srY
+     in PS $ M.insert w (PSRectangle (fromIntegral offsetX / fromIntegral srWh)
+                                                (fromIntegral offsetY / fromIntegral srHt)
+-                                               (fromIntegral wh / fromIntegral srWh)
+-                                               (fromIntegral ht / fromIntegral srHt)) posStoreMap
++                                               (min wh srWh) (min ht srHt)) posStoreMap
+ 
+ posStoreRemove :: PositionStore -> Window -> PositionStore
+ posStoreRemove (PS posStoreMap) w = PS $ M.delete w posStoreMap
+@@ -64,12 +63,9 @@
+ posStoreQuery :: PositionStore -> Window -> Rectangle -> Maybe Rectangle
+ posStoreQuery (PS posStoreMap) w (Rectangle srX srY srWh srHt) = do
+     (PSRectangle x y wh ht) <- M.lookup w posStoreMap
+-    let realWh = fromIntegral srWh * wh
+-        realHt = fromIntegral srHt * ht
+-        realOffsetX = fromIntegral srWh * x
++    let realOffsetX = fromIntegral srWh * x
+         realOffsetY = fromIntegral srHt * y
+-    return (Rectangle (srX + round realOffsetX) (srY + round realOffsetY)
+-                        (round realWh) (round realHt))
++    return (Rectangle (srX + round realOffsetX) (srY + round realOffsetY) wh ht)
+ 
+ posStoreMove :: PositionStore -> Window -> Position -> Position -> Rectangle -> Rectangle -> PositionStore
+ posStoreMove posStore w x y oldSr newSr =
diff --git a/xmonad-contrib-0.10-X11-1.6.patch b/xmonad-contrib-0.10-X11-1.6.patch
new file mode 100644
index 0000000..2bfa0da
--- /dev/null
+++ b/xmonad-contrib-0.10-X11-1.6.patch
@@ -0,0 +1,12 @@
+diff -uxmonad-contrib-0.10/xmonad-contrib.cabal\~xmonad-contrib-0.10/xmonad-contrib.cabal
+---xmonad-contrib-0.10/xmonad-contrib.cabal~	2011-11-19 08:26:06.000000000 +0900
++++xmonad-contrib-0.10/xmonad-contrib.cabal	2012-06-11 10:59:49.665575897 +0900
+@@ -61,7 +61,7 @@
+         extensions: ForeignFunctionInterface
+         cpp-options: -DXFT
+ 
+-    build-depends:      mtl >= 1 && < 3, unix, X11>=1.5.0.0 && < 1.6, xmonad>=0.10, xmonad<0.11, utf8-string
++    build-depends:      mtl >= 1 && < 3, unix, X11>=1.5.0.0 && < 1.7, xmonad>=0.10, xmonad<0.11, utf8-string
+ 
+     if true
+         ghc-options:    -fwarn-tabs -Wall


More information about the scm-commits mailing list