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

Add (un)fullscreen hooks and float-restoring toggleFullFloat action #768

Merged
merged 3 commits into from
Apr 1, 2023

Conversation

liskin
Copy link
Member

@liskin liskin commented Oct 23, 2022

Description

X.H.EwmhDesktops: Add (un)fullscreen hooks

Fairly straightforward, just add two hooks for (un)fullscreening. There are multiple motivations for this:

  • Users are calling for unfullscreened windows to revert back to their original location if they were floating.

  • XMonad.Layout.Fullscreen uses some deprecated exports from XMonad.Hooks.EwmhDesktops and reimplements fullscreenEventHook.

This commit only adds the hooks. Neither of the motivations are dealt with yet, so the docs are a bit terse still.

Add X.A.ToggleFullFloat - state-remembering fullscreen hooks

CHANGES: Document X.A.ToggleFullFloat and setEwmhFullscreenHooks


Related: #456
Related: #394
Related: #626


The second motivation is still TODO: X.L.Fullscreen should be refactored to use this (probably in a separate PR because there's some legacy code I can't be arsed to actually try to use anytime soon).

Checklist

  • I've read CONTRIBUTING.md

  • I've considered how to best test these changes (property, unit, manually, ...) and concluded: I've been running this for a long while.

  • I updated the CHANGES.md file

@PRESFIL
Copy link
Contributor

PRESFIL commented Oct 28, 2022

Interesting. We wait XMonad.Actions.ToggleFullFloat to restore floating
states of windows?

I remember X.L.PositionStoreFloat and X.H.PositionStoreHook which
are both uses X.U.PositionStore. Does ToggleFullFloat also uses it?

@liskin
Copy link
Member Author

liskin commented Oct 28, 2022

We wait XMonad.Actions.ToggleFullFloat to restore floating states of windows?

Yeah, I'll get it finished and pushed here soon-ish.

I remember X.L.PositionStoreFloat and X.H.PositionStoreHook which are both uses X.U.PositionStore. Does ToggleFullFloat also uses it?

I'm aware of that one but didn't use it as a storage backend to avoid conflicts. Although I must admit I can't think of a specific example of how that conflict would actually behave in practice, off the top of my head.

(It's a bit unfortunate that this PositionStore* stuff is split into three modules. It kinda looks like it may be reused by other modules, but X.U.PositionStore is just an implementation detail of X.L.PositionStoreFloat.)

@liskin liskin force-pushed the fullscreen-hooks branch from 23e3d02 to 636c7a2 Compare March 25, 2023 11:34
@liskin liskin changed the title X.H.EwmhDesktops: Add (un)fullscreen hooks Add (un)fullscreen hooks and float-restoring toggleFullFloat action Mar 25, 2023
@liskin liskin force-pushed the fullscreen-hooks branch from 636c7a2 to d19450b Compare March 25, 2023 11:39
@liskin liskin marked this pull request as ready for review March 25, 2023 11:40
@liskin
Copy link
Member Author

liskin commented Mar 25, 2023

soon-ish™ :-)

Anyway, I've done the docs today and pushed it for review. Been running this for months with no trouble. Sorry for the wait.

Copy link
Member

@slotThe slotThe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look fine to me; thank you for getting to it 🎉

XMonad/Actions/ToggleFullFloat.hs Outdated Show resolved Hide resolved
-- The main use-case is to make 'ewmhFullscreen' (re)store the size and
-- position of floating windows instead of just uncontitionally sinking them
-- into the floating layer. To enable this, you'll need this in your
-- @~\/.xmonad\/xmonad.hs@:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this is almost canonical at this point, but with the advent of proper XDG support perhaps we could just speak of an @xmonad.hs@ here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, indeed! Changed here. Feel free to push a change across the entire repo if/when you feel like it. :-)

Comment on lines 98 to 99
gcToggleFullFloat c = c { startupHook = startupHook c <> gcToggleFullFloatStartupHook
, handleEventHook = handleEventHook c <> gcToggleFullFloatEventHook }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an indentation misake?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what you get if you sed and forget that we're formatting stuff manually here :-)

liskin added 3 commits April 1, 2023 12:06
Fairly straightforward, just add two hooks for (un)fullscreening. There
are multiple motivations for this:

* Users are calling for unfullscreened windows to revert back to their
  original location if they were floating.

* XMonad.Layout.Fullscreen uses some deprecated exports from
  XMonad.Hooks.EwmhDesktops and reimplements fullscreenEventHook.

This commit only adds the hooks. Neither of the motivations are dealt
with yet, so the docs are a bit terse still.

Related: xmonad#456
Related: xmonad#394
Related: xmonad#626
@liskin liskin force-pushed the fullscreen-hooks branch from b6c9b62 to 02bd9eb Compare April 1, 2023 10:07
@liskin liskin merged commit 673de11 into xmonad:master Apr 1, 2023
@liskin liskin deleted the fullscreen-hooks branch April 1, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants