From 6cad66e67a68f2f57c0faf159a6e0412b67f55e0 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 20 Dec 2009 01:47:33 +0100 Subject: Fix MultiToggle crashes with decorated layouts Ignore-this: 9208f5da9f0de95464ea62cb45e8f291 The problem was that certain layouts keep their "world" state in their value, which was thrown away and forgotten after ReleaseResources during toggle. In particular, decorated layouts store some X11 handles in them and allocate/deallocate it as appropriate. If any modification to their state is ignored, they may try to deallocate already deallocated memory, which results in a crash somewhere inside Xlib. This patch makes Transformers reversible so that nothing is ever ignored. As a side effect, layout transformers now do receive messages and messages for the base layout do not need the undo/reapply cycle -- we just pass messages to the current transformed layout and unapply the transformer when needed. (This, however, doesn't mean that the base layout is not asked to release resources on a transformer change -- we still need the transformer to release its resources and there's no way to do this without asking the base layout as well.) darcs-hash:20091220004733-c9ff5-34670f3db8ab715d8f334973d6ea2a3e7f3aed7a.gz --- XMonad/Layout/Reflect.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'XMonad/Layout/Reflect.hs') diff --git a/XMonad/Layout/Reflect.hs b/XMonad/Layout/Reflect.hs index aed67ac..03fd6b6 100644 --- a/XMonad/Layout/Reflect.hs +++ b/XMonad/Layout/Reflect.hs @@ -105,7 +105,7 @@ data REFLECTX = REFLECTX deriving (Read, Show, Eq, Typeable) data REFLECTY = REFLECTY deriving (Read, Show, Eq, Typeable) instance Transformer REFLECTX Window where - transform REFLECTX x k = k (reflectHoriz x) + transform REFLECTX x k = k (reflectHoriz x) (\(ModifiedLayout _ x') -> x') instance Transformer REFLECTY Window where - transform REFLECTY x k = k (reflectVert x) \ No newline at end of file + transform REFLECTY x k = k (reflectVert x) (\(ModifiedLayout _ x') -> x') -- cgit v1.2.3