From 702fd56574d05897934b1fa195c5d02c2593afd2 Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Sun, 21 Jun 2009 21:52:25 +0200 Subject: 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 --- XMonad/Layout/Tabbed.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'XMonad/Layout/Tabbed.hs') 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) -- cgit v1.2.3