From 776f0cf4b665cf58bde5558b95d4d96fae7a9c53 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Fri, 28 Sep 2007 02:22:41 +0200 Subject: Add setLayout to the core darcs-hash:20070928002241-a5988-68aacebdf64cab00c7c68bf3c91fb55210c31e99 --- Config.hs | 1 + Operations.hs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Config.hs b/Config.hs index f3269d0..5356cb0 100644 --- a/Config.hs +++ b/Config.hs @@ -142,6 +142,7 @@ keys = M.fromList $ , ((modMask .|. shiftMask, xK_c ), kill) -- %! Close the focused window , ((modMask, xK_space ), sendMessage NextLayout) -- %! Rotate through the available layout algorithms + , ((modMask .|. shiftMask, xK_space ), setLayout $ SomeLayout $ LayoutSelection defaultLayouts) -- %! Reset the layouts on the current workspace to default , ((modMask, xK_n ), refresh) -- %! Resize viewed windows to the correct size diff --git a/Operations.hs b/Operations.hs index 128c4ad..ee1fd80 100644 --- a/Operations.hs +++ b/Operations.hs @@ -326,6 +326,13 @@ runOnWorkspaces job = do ws <- gets windowset instance Message Event +-- | Set the layout of the currently viewed workspace +setLayout :: SomeLayout Window -> X () +setLayout l = do + sendMessage ReleaseResources + windows $ \ss@(W.StackSet { W.current = c@(W.Screen { W.workspace = ws })}) + -> ss {W.current = c { W.workspace = ws { W.layout = l } } } + -- Layout selection manager -- This is a layout that allows users to switch between various layout -- cgit v1.2.3