It used to be the default behavior, but then we had problems with some
windows that shouldn't be centered:
https://github.com/qtile/qtile/issues/1140

That being said, I came to that conclusion while working on something else:

> It seems to me that we should only respect PPosition and alike [i.e. not
> center] if the window has never been tiled before.

https://github.com/qtile/qtile/pull/2179#issuecomment-773944338

Until then, you can do this:
https://gist.github.com/ramnes/a9c10e45801a17ef69e172f276629e06

It's really ugly and borrows some code from the libqtile itself, but it
works.

Le mar. 2 févr. 2021 à 21:44, Milkias Yeheyis <[email protected]> a
écrit :

> I wanted to create a hook so that whenever I float a window, it brings it
> to the center of the screen. How would I go about accomplishing this? This
> is what I came up with and this doesn't work.
> @hook.subscribe.float_change
> def center_window():
>     current_window = InteractiveCommandClient().window
>     if current_window.info()['floating']:
>         current_window.set_position_floating(288, 200)
>         current_window.set_size_floating(600, 600)
>
> Any directions would be immense. Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "qtile-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/qtile-dev/6982582f-6266-4c00-81a3-92b92a474798n%40googlegroups.com
> <https://groups.google.com/d/msgid/qtile-dev/6982582f-6266-4c00-81a3-92b92a474798n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Guillaume Gelin

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2Bp2qShP12rgEtS-%2BbYfPzzg90FCUqKRu%2BFjkhQcosH5FA%40mail.gmail.com.

Reply via email to