ssokolow / quicktile

Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)
https://ssokolow.com/quicktile/
GNU General Public License v2.0
860 stars 78 forks source link

Xfwm4 integration / size restoration #136

Open robozewa opened 1 year ago

robozewa commented 1 year ago

Hello!

This is a great tool I'm currently playing with to improve tiling on my desktop with the Xfwm4 WM. Thanks for creating it!

Xfwm4 supports some basic edge/corner tiling itself. One thing I do notice is that Xfwm4 seems to remember the window size before it was tiled, i.e. if you have a window sized XxY and tile it to a screen edge, then drag it back again from that edge, it is restored to its original XxY size. This is super useful IMO.

The same doesn't work when the window was tiled using quicktile.

I'm not sure if this size restoration is a generic X property or an Xfwm4-internal feature. Would it be possible to support Xfwm4's size restoration feature in quicktile?

Thanks a lot!

ssokolow commented 1 year ago

I'm not sure if this size restoration is a generic X property or an Xfwm4-internal feature.

To the best of my knowledge, it's an Xfwm4-internal feature, similar to how QuickTile can't un-set KWin's edge/corner tiling because, when a Window is tiled in KWin, it ignores attempts by random applications to un-tile it on the assumption that it's probably the application itself trying to veto the user's decision.

Would it be possible to support Xfwm4's size restoration feature in quicktile?

Unlikely. It's probably implemented as a variation on how maximization works, where the window manager leaves the old dimensions intact in its records and just adds some new "maximized to ___ tile" status field.

If that's how it works, there'd be fundamentally no way to extend the behaviour beyond the existing set of tiling positions without patching Xfwm4, because there would be no way to describe "maximized to... " tiles outside the hard-coded set.

Heck, if I can ever get around to it, I want to do a similar "define an internal grid and just specify which cell the window is in" rework for QuickTile because it enables stuff like hotkeys for grow/shrink colum/row and makes it easier to make "cycle window to next monitor" behave intuitively when monitors aren't the same shape.

robozewa commented 1 year ago

Hey, thanks for the answer. That's unfortunate, I found Xfwm4's size restoration to be quite useful.

Maybe Xfwm4's feature can't be extended, but Quicktile might be able to hack it. Remember window size before tiling, then listen for resize/move events on that window. When it's being modified outside of Quicktile, instantly restore the old size. That would be WM-agnostic too ^^

ssokolow commented 1 year ago

Possibly, but it could also result in an unpleasant conflict with the WM as it and QuickTile fight over what should happen.

I'll leave this open for that but, given how much of a pit I have to climb out of on TODOs, I want to focus on things that are less of a gamble first.