Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make extensibleState primarily keyed by TypeRep instead of type names #326

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 2, 2021

  1. Make extensibleState primarily keyed by TypeRep instead of type names

    We've been using the String we get out of `show . typeOf` as key in
    `extensibleState`, but that has a somewhat serious bug: it shows
    unqualified type names, so if two modules use the same type name, their
    extensible states will be stored in one place and get overwritten all
    the time.
    
    To fix this, the `extensibleState` map is now primarily keyed by the
    TypeRep themselves, with fallback to String for not yet deserialized
    data. XMonad.Core now exports `showExtType` which serializes type names
    qualified, and this is used in `writeStateToFile`.
    
    A simpler fix would be to just change the serialization of type names in
    `XMonad.Util.ExtensibleState`, but I'm afraid that might slows things
    down: Most types used here will start with "XMonad.", and that's a lot
    of useless linked-list pointer jumping.
    
    Fixes: xmonad/xmonad-contrib#94
    Related: xmonad/xmonad-contrib#600
    liskin committed Sep 2, 2021
    Configuration menu
    Copy the full SHA
    6a507c6 View commit details
    Browse the repository at this point in the history