Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:29:02+00:00 2026-05-29T09:29:02+00:00

I prefer to use the keyboard to float or sink windows. Unfortunately, when floated,

  • 0

I prefer to use the keyboard to float or sink windows. Unfortunately, when floated, windows aren’t moved or resized, so there is little visual indication that they aren’t still tiled. Ideally, upon shifting to the float layer, I’d have them move to the center of the screen and/or resize.

The best solution would work together with the function below (or something similar), which I call with a keybind — I’d like floating via mouse click to still work normally.

toggleFloat = withFocused (\windowId -> do
                              { floats <- gets (W.floating . windowset);
                                if windowId `M.member` floats
                                then withFocused $ windows . W.sink
                                else float windowId })

(Code stolen, I still have no grasp of Haskell :c)

Edit: the keysMoveWindowTo stuff in the modified code below can actually just replace “float windowId”, which it makes superfluous.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:29:03+00:00Added an answer on May 29, 2026 at 9:29 am

    I suppose you’ve xmonad-contrib package installed. Then you should take a look at XMonad.Actions.FloatKeys

    I guess modified function will be:

    ...
    import XMonad.Actions.FloatKeys
    ...
    
    toggleFloat = withFocused (\windowId -> do
                                  { floats <- gets (W.floating . windowset);
                                    if windowId `M.member` floats
                                    then withFocused $ windows . W.sink
                                    else do
                                         keysMoveWindowTo (x, y) (gx1, gy1) windowId
                                         keysResizeWindow (dx, dy) (gx2, gy2) windowId
                                  }
                              ) 
    

    where x,y,dx,dy,gx1,gy1,gx2,gy2 are your settings.
    Operator % mentioned in docs is from Data.Ratio; a % b means rational number with numerator a and denominator b. You have to import if you want to use it:

    import Data.Ratio ((%))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any way to do so? I prefer to use VB.NET or Java
What's the best way to implement Meebo-style floating windows? I'd prefer to use Prototype
I'm writing logger file. I'd prefer to use macros __FUNCTION__ there. I don't like
I prefer the use of external css and javascript files. There are however many
Alright so to start this is strictly for Windows and I'd prefer to use
I prefer to use tab than white space (may be a little different from
I prefer to use OOP in large scale projects like the one I'm working
Do you have a default type that you prefer to use in your dealings
I am a web and mobile application developer and I prefer to use MVC
Is it possible to develop iphone apps with java? I'd prefer to use alchemo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.