aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/Tabbed.hs
diff options
context:
space:
mode:
authorDmitry Astapov <dastapov@gmail.com>2009-06-21 21:52:25 +0200
committerDmitry Astapov <dastapov@gmail.com>2009-06-21 21:52:25 +0200
commit702fd56574d05897934b1fa195c5d02c2593afd2 (patch)
tree4751d9279c39e317815e49c967ff5690dc41be32 /XMonad/Layout/Tabbed.hs
parenta00440a6bf516b55929795dc69a10352bb0dbb6a (diff)
downloadXMonadContrib-702fd56574d05897934b1fa195c5d02c2593afd2.tar.gz
XMonadContrib-702fd56574d05897934b1fa195c5d02c2593afd2.tar.xz
XMonadContrib-702fd56574d05897934b1fa195c5d02c2593afd2.zip
Close tabs by middle click on tab decoration
Ignore-this: e3fb5d78b766f63a20ab4db064d8285c I'd better do it in xmonad.hs, but I can't decide what to expose from Tabbed.hs to make it happed. Suggestions on how to make mouse click handling hook a part of the Tabbed creation interface are very welcome - my attempts turned out to be ugly in extreme. darcs-hash:20090621195225-5701e-dd8b1e35d7afd16fb85c136afdd784d017d18e7e.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Layout/Tabbed.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/XMonad/Layout/Tabbed.hs b/XMonad/Layout/Tabbed.hs
index 0e0a5c6..93ffed2 100644
--- a/XMonad/Layout/Tabbed.hs
+++ b/XMonad/Layout/Tabbed.hs
@@ -151,6 +151,16 @@ data TabbedDecoration a = Tabbed TabbarLocation TabbarShown deriving (Read, Show
instance Eq a => DecorationStyle TabbedDecoration a where
describeDeco (Tabbed Top _ ) = "Tabbed"
describeDeco (Tabbed Bottom _ ) = "Tabbed Bottom"
+ decorationMouseFocusHook _ ds ButtonEvent { ev_window = ew
+ , ev_event_type = et
+ , ev_button = eb }
+ | et == buttonPress
+ , Just ((w,_),_) <-findWindowByDecoration ew ds =
+ if eb == button2
+ then killWindow w
+ else focus w
+ decorationMouseFocusHook _ _ _ = return ()
+
decorationMouseDragHook _ _ _ = return ()
pureDecoration (Tabbed lc sh) _ ht _ s wrs (w,r@(Rectangle x y wh hh))
= if ((sh == Always && numWindows > 0) || numWindows > 1)