[xmonad] patch: ShowWName flash window fixes

Rohan Jain crodjer at gmail.com
Mon Mar 5 19:32:58 CET 2012


Hi,

Please find the two patches in the attachment with this mail

2 patches for repository http://code.haskell.org/XMonadContrib:

Mon Mar  5 21:42:40 IST 2012  crodjer at gmail.com
  * ShowWName: Fix flash location by screen rectangle
  
  In case of using this hook with multiple monitors, the Tag flash was not
  following the screen's coordinates. This patch shifts the new window created
  for flash according to the Rectangle defined by the screen.

Mon Mar  5 22:15:17 IST 2012  crodjer at gmail.com
  * ShowWName: Increase horizontal padding for flash
  
  Currently the flash window width leaves a very small amount of padding. This
  patch adds some extra horizontal width, governed by text width and length.

--
Rohan
-------------- next part --------------
2 patches for repository http://code.haskell.org/XMonadContrib:

Mon Mar  5 21:42:40 IST 2012  crodjer at gmail.com
  * ShowWName: Fix flash location by screen rectangle
  
  In case of using this hook with multiple monitors, the Tag flash was not
  following the screen's coordinates. This patch shifts the new window created for
  flash according to the Rectangle defined by the screen.

Mon Mar  5 22:15:17 IST 2012  crodjer at gmail.com
  * ShowWName: Increase horizontal padding for flash
  
  Currently the flash window width leaves a very small amount of padding. This
  patch adds some extra horizontal width, governed by text width and length.


New patches:

[ShowWName: Fix flash location by screen rectangle
crodjer at gmail.com**20120305161240
 Ignore-this: 83ec4cce2297efc6736a1fe55f44ee73
 
 In case of using this hook with multiple monitors, the Tag flash was not
 following the screen's coordinates. This patch shifts the new window created for
 flash according to the Rectangle defined by the screen.
] {
hunk ./XMonad/Layout/ShowWName.hs 89
 doShow (SWN False _  _          ) _ wrs = return (wrs, Nothing)
 
 flashName :: SWNConfig -> Rectangle -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (ShowWName a))
-flashName c (Rectangle _ _ wh ht) wrs = do
+flashName c (Rectangle sx sy wh ht) wrs = do
   d <- asks display
   n <- withWindowSet (return . S.currentTag)
   f <- initXMF (swn_font c)
hunk ./XMonad/Layout/ShowWName.hs 96
   width   <- textWidthXMF d f n
   (as,ds) <- textExtentsXMF f n
   let hight = as + ds
-      y     = (fi ht - hight + 2) `div` 2
-      x     = (fi wh - width + 2) `div` 2
+      y     = fi sy + (fi ht - hight + 2) `div` 2
+      x     = fi sx + (fi wh - width + 2) `div` 2
   w <- createNewWindow (Rectangle (fi x) (fi y) (fi width) (fi hight)) Nothing "" True
   showWindow w
   paintAndWrite w f (fi width) (fi hight) 0 "" "" (swn_color c) (swn_bgcolor c) [AlignCenter] [n]
}
[ShowWName: Increase horizontal padding for flash
crodjer at gmail.com**20120305164517
 Ignore-this: de5fd30fad2630875c5c78091f07c324
 
 Currently the flash window width leaves a very small amount of padding. This
 patch adds some extra horizontal width, governed by text width and length.
] hunk ./XMonad/Layout/ShowWName.hs 93
   d <- asks display
   n <- withWindowSet (return . S.currentTag)
   f <- initXMF (swn_font c)
-  width   <- textWidthXMF d f n
+  width <- fmap (\w -> w + w `div` length n) $ textWidthXMF d f n
   (as,ds) <- textExtentsXMF f n
   let hight = as + ds
       y     = fi sy + (fi ht - hight + 2) `div` 2

Context:

[L.WorkspaceDir: cleanup redundant {definitions,imports}
Steffen Schuldenzucker <sschuldenzucker at uni-bonn.de>**20120229112124
 Ignore-this: 7a796b18a64e693e071e9ea3a6a01aa3
] 
[Fix typo in tabbed layout link for font utils docs
crodjer at gmail.com**20120229070022
 Ignore-this: 2f7e90269e08ce08264d7b1d05bb16f9
] 
[fix L.WorkspaceDir special char handling: remove "echo -n" processing
Steffen Schuldenzucker <sschuldenzucker at uni-bonn.de>**20120227122004
 Ignore-this: ab48687eb4c9018312089a13fd25ecd8
] 
[Add BorderUrgencyHook to XMonad.Hooks.UrgencyHook
allbery.b at gmail.com**20120225082616
 Ignore-this: 9fac77914ff28a6e9eb830e8c9c7e21e
 BorderUrgencyHook is a new UrgencyHook usable with withUrgencyHook or
 withUrgencyHookC; it allows an urgent window to be given a different
 border color.  This may not always work as intended, since UrgencyHook
 likes to assume that a window being visible is sufficient to disable
 urgency notification; but with suppressWhen = Never it may work well
 enough.
 
 There is a report that if a new window is created at the wrong time,
 the wrong window may be marked urgent somehow.  I seem to once again
 be revealing bugs in underlying packages, although a quick examination
 of X.H.UrgencyHook doesn't seem to show any way for the wrong window
 to be selected.
] 
[Adding use case for namedScratchpad.
nicolas.dudebout at gatech.edu**20120122235843
 Ignore-this: 44201e82bcd708cd7098f060345400f1
] 
[Actions.WindowGo: typo fix - trim 's' per cub.uanic https://code.google.com/p/xmonad/issues/detail?id=491
gwern0 at gmail.com**20120116224244
 Ignore-this: fb1d55c1b4609069c55f13523c091260
] 
[XMonad.Actions.PhysicalScreens: fix typo spotted by Chris Pick <haskell at chrispick.com>
gwern0 at gmail.com**20120115223013
 Ignore-this: eb73b33b07dc58a36d3aa00bc8ac31c2
] 
[roll back previous incorrect fix
Daniel Wagner <daniel at wagner-home.com>**20120111214133
 Ignore-this: 91496faef411e6ae3442498b528d119b
] 
[Extending: fix http://code.google.com/p/xmonad/issues/detail?id=490
gwern0 at gmail.com**20120111211907
 Ignore-this: 515afbed507c070d60ab547e98682f12
] 
[another documentation patch: XMonadContrib.UpdatePointer -> XMonad.Actions.UpdatePointer
Daniel Wagner <daniel at wagner-home.com>**20120111211226
 Ignore-this: 1444e4a3f20ba442602ef1811d0b32c7
] 
[documentation patch, fixes issue 490
Daniel Wagner <daniel at wagner-home.com>**20120111210832
 Ignore-this: 8d899e15f9d1a657e9fc687e2f649f45
] 
[X.H.EwmhDesktops note that fullscreenEventHook is not included in ewmh
Adam Vogt <vogt.adam at gmail.com>**20120102211404
 Ignore-this: 92f15fa93877c165158c8fbd24aa2360
 
 Just a documentation fix (nomeata's suggestion at issue 339).
] 
[X.H.EwmhDesktops haddock formatting.
Adam Vogt <vogt.adam at gmail.com>**20120102211203
 Ignore-this: cfff985e4034e06a0fe27c52c9971901
] 
[X.A.Navigation2D
Norbert Zeh <nzeh at cs.dal.ca>**20111208205842
 Ignore-this: 3860cc71bfc08d99bd8279c2e0945186
 
 This is a new module to support directional navigation across multiple screens.
 As such it is related to X.A.WindowNavigation and X.L.WindowNavigation, but it
 is more general.  For a detailed discussion of the differences, see
 http://www.cs.dal.ca/~nzeh/xmonad/Navigation2D.pdf.
] 
[documentation patch: mention PostfixOperators
Daniel Wagner <daniel at wagner-home.com>**20111210234820
 Ignore-this: 20a05b1f396f18a742346d6e3daea9a8
] 
[P.Shell documentation and add missing unsafePrompt export
Adam Vogt <vogt.adam at gmail.com>**20111207163951
 Ignore-this: a03992ffdc9c1a0f5bfa6dafc453b587
 
 Haddock (version 2.9.2 at least) does not attach documentation to any of a b or
 c when given:
 
     -- | documentation
     a,b,c :: X
 
] 
[Paste: 3 more escaped characters from alistra
gwern0 at gmail.com**20111129160335
 Ignore-this: 46f5b86a25bcd2b26d2e07ed33ffad68
] 
[unfuck X.U.Paste
Daniel Wagner <daniel at wagner-home.com>**20111129032331
 Ignore-this: d450e23ca026143bb6ca9d744dcdd906
] 
[XMonad.Util.Paste: +alistra's patch for fixing his pasting of things like email address (@)
gwern0 at gmail.com**20111128215648
 Ignore-this: 4af1af27637fe056792aa4f3bb0403eb
] 
[XMonad.Util.Paste: rm myself from maintainer field; I don't know how to fix any of it even if I wanted
gwern0 at gmail.com**20111128213001
 Ignore-this: 87a4996aaa5241428ccb13851c5eb455
] 
[XMonad.Prompt.Shell: improve 'env' documentation to cover goodgrue's problem
gwern0 at gmail.com**20111127231507
 Ignore-this: 7b652a280960cbdf99c236496ca091b0
] 
[Fix spelling 'prefered' -> 'preferred'.
Erik de Castro Lopo <erikd at mega-nerd.com>**20111125010229
 Ignore-this: f2eac1728b5e023399188becf867a14d
] 
[Restore TrackFloating behavior to an earlier version.
Adam Vogt <vogt.adam at gmail.com>**20111120045538
 Ignore-this: 1a1367b4171c3ad23b0553766021629f
 
 Thanks for liskni_si for pressing the matter: without this change it is very
 broken, with the patch it is still not perfect but still useful.
] 
[Explicitly list test files in .cabal
Adam Vogt <vogt.adam at gmail.com>**20111118232511
 Ignore-this: ac48a0d388293cc6c771d676aaf142e3
 
 In the future, require Cabal >= 1.6 to be able to just write tests/*.hs
] 
[TAG 0.10
Adam Vogt <vogt.adam at gmail.com>**20111118225640
 Ignore-this: 8f81b175b902e985d584160fc41ab7d1
] 
Patch bundle hash:
c9fbc5d49ea5fcc508c5c256ab7fa84141c5b918


More information about the xmonad mailing list