Merge pull request #242 from liskin/layoutclass-typeable

Make layouts Typeable
This commit is contained in:
Brent Yorgey 2020-11-09 14:14:13 -06:00 committed by GitHub
commit c3e032e08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,10 @@
causing some floating windows to be smaller/larger than the size they
requested.
* Added `Typeable layout` constraint to `LayoutClass`, making it possible to
cast `Layout` back into a concrete type and extract current layout state
from it.
## 0.15 (September 30, 2018)
* Reimplement `sendMessage` to deal properly with windowset changes made

View File

@ -271,7 +271,7 @@ readsLayout (Layout l) s = [(Layout (asTypeOf x l), rs) | (x, rs) <- reads s]
-- 'runLayout', 'handleMessage', and so on. This ensures that the
-- proper methods will be used, regardless of the particular methods
-- that any 'LayoutClass' instance chooses to define.
class Show (layout a) => LayoutClass layout a where
class (Show (layout a), Typeable layout) => LayoutClass layout a where
-- | By default, 'runLayout' calls 'doLayout' if there are any
-- windows to be laid out, and 'emptyLayout' otherwise. Most