0

I resize a floating window, let's say to some size WxH pixels. Then I change to tiling mode, so the window gets resized automatically to some new size, let's say W'xH' pixels. Now suppose I switch the window back to floating mode.

What I Want: The window automatically resizes to the last size, i.e., WxH.

Current Situation: The window just becomes floating, but still has the size W'xH'.

Is there any way of making this happen? Like some way we can save the dimenisons of a window everytime it's resized, and whenever a window enters floating mode, apply the last known size from that application?

I know it probably sounds very dumb, I'm so sorry.

2 Answers2

1

There is multiple ways. The "simple" way is to use client.connect("property::floating", function(c) if c.floating then restore(c) else save(c) end) where you implement both save and restore yourself by calling c:geometry().

The more advanced way would be to use request::geometry and awful.placement built-in geometry memento support. That's preferred since it allows to prevent the client from flickering between 2 sizes. However it is much more complicated to pull off.

1

You can use awesome-remember-geometry from berlam.

https://github.com/berlam/awesome-remember-geometry

anakha
  • 980
  • 6
  • 9