qtile icon indicating copy to clipboard operation
qtile copied to clipboard

mpv pushed back to tiling

Open pnotz17 opened this issue 5 years ago • 17 comments

i am trying to make mpv always float, it starts off in floating mode in monadtall but gets pushed back into tiled when maximazed/minimized ,i have been going through the issues and found alot of similar problems but no fix, is there some workaround to minimize and maximize and for the floating window to return as floating?

https://pastebin.com/3qYFb33B

pnotz17 avatar Jan 29 '21 19:01 pnotz17

Did you find a solution? Or was it a non-problem? Please help future readers. :)

relevant xkcd

ramnes avatar Feb 04 '21 16:02 ramnes

no its a non problem but still looking-around for a solution for mpv to stay floating when minimized/maximized

pnotz17 avatar Feb 04 '21 16:02 pnotz17

Can you try #2179? I think it may fix this.

ramnes avatar Feb 04 '21 16:02 ramnes

i have no idea how to patch qtile but it looks like its just like in dwm, il give it a try

pnotz17 avatar Feb 05 '21 09:02 pnotz17

Just follow the steps to install from sources, but run this right before the pip install .:

git checkout -b ramnes-handle-paspect master
git pull https://github.com/ramnes/qtile.git handle-paspect

ramnes avatar Feb 05 '21 10:02 ramnes

Just follow the steps to install from sources, but run this right before the pip install .:

git checkout -b ramnes-handle-paspect master
git pull https://github.com/ramnes/qtile.git handle-paspect

is there a workaround without instaling from source like in this?#1260

pnotz17 avatar Feb 05 '21 13:02 pnotz17

Not really, there isn't any hook available for what we're doing there, yet.

ramnes avatar Feb 05 '21 14:02 ramnes

Not really, there isn't any hook available for what we're doing there, yet.

ok well i got it installed just cant get the xsession working for some reason but then i found the executable in .local/bin for some reason eh i should have it fixed by tomorrow i appreciate your help man

pnotz17 avatar Feb 05 '21 15:02 pnotz17

I still have this issue in Qtile 0.21.0, can anyone confirm? Are there any workarounds to have mpv always as floating?

hanschen avatar Aug 15 '22 13:08 hanschen

I think the solution may have been putting no-keepaspect-window in your mpv config

m-col avatar Aug 17 '22 23:08 m-col

I think the solution may have been putting no-keepaspect-window in your mpv config

Many thanks for the answer. I may have missed something, but using no-keepaspect-window makes mpv tiled by default for me, while I want the opposite, i.e., mpv should always be floating. Without this option mpv starts as floating (what I want) but then reverts to tiled when making the player window fullscreen and then non-fullscreen.

I've also tried to add Match(wm_class="mpv"), to my float_rules but to no avail.

If there is no solution at the moment, maybe this issue could be re-opened to keep track of this problem?

hanschen avatar Aug 18 '22 00:08 hanschen

Did you try both the Match and the mpv.conf option together? This somewhat surprising behaviour is likely a similar to the issue described here: https://github.com/qtile/qtile/issues/2901, which is due to mpv updating its state and hitting some kind of float/tile rule. That said I'm not sure what would make it tile... we don't have a tile_rules. But yep let's re-open this until we get it sorted!

m-col avatar Aug 18 '22 00:08 m-col

Yes, I've tried all sorts of combinations:

  1. *layout.Floating.default_float_rules, Match(wm_class="mpv") and no-keepaspect-window: mpv starts as floating, toggling fullscreen => tiled.
  2. *layout.Floating.default_float_rules, and no-keepaspect-window: mpv starts as tiled, toggling fullscreen => tiled.
  3. Match(wm_class="mpv") without the other two: mpv starts as floating, toggling fullscreen => tiled.

FWIW, I have the same problem with VLC and MPlayer. I didn't have this issue with i3 (or xmonad if I remember correctly).

As a workaround, this seems to work:

@hook.subscribe.float_change
def float_mpv():
    window = qtile.current_window
    wm_class = window.get_wm_class()
    if wm_class and "mpv" in wm_class:
        window.floating = True
        window.cmd_center()

However, it has another issue - cmd_center doesn't seem to work correctly for my second monitor (the window always becomes centered on my left monitor). This is on X11. I can file a separate issue for this if it's not the intended behavior (unless I made a mistake in my code).

EDIT: Quick workaround for the issue with cmd_center before I head to bed...

Replace window.cmd_center() above with the following:

        screen = window.group.screen
        x = screen.x + (screen.width - window.width) // 2
        y = screen.y + (screen.height - window.height) // 2
        window.place(
            x,
            y,
            window.width,
            window.height,
            window.borderwidth,
            window.bordercolor,
            above=True,
            respect_hints=True,
        )

hanschen avatar Aug 18 '22 01:08 hanschen

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Feb 14 '23 04:02 github-actions[bot]

I'm still affected by this bug (qtile 0.22.1), so I think it would be good to keep track of the issue.

hanschen avatar Feb 14 '23 07:02 hanschen

I'm affected by this bug too, along with #2901.

karthink avatar Feb 26 '23 01:02 karthink

Seems related if not identical to #2415

ramnes avatar Oct 14 '23 14:10 ramnes