mpv-player / mpv-player/mpv

`--window-maximized` opens mpv's window on the wrong screen on kwin/wayland

Open
#8,576 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

down-upstream:wayland os:linux vo:gpu:wayland
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Important Information

Provide following Information:

  • mpv version
    mpv 1:0.33.0-4
  • Linux Distribution and Version
    Arch (rolling - up2date)
  • Source of the mpv binary
    Arch community repo
  • If known which version of mpv introduced the problem
    n/a
  • Window Manager and version
    KWin 5.21.0, using wayland
  • GPU driver and version
    linux-git 5.11.r0.gf40ddce88593-2 / mesa 20.3.4-1
  • Possible screenshot or video of visual glitches
    n/a
Reproduction steps

Just gave kwin on wayland another shot today and noticed an issue in mpv regarding its window position.

I'm using a dual-screen setup, with the right hand one being the primary one. On X11, this screen could be set as "primary" one, but on wayland, there doesn't seem to be an equivalent of primary/secondary screens.

The issue I'm seeing with this is that mpv will always open on the left screen when --window-maximized is set, even if the window position is supposed to be on a different screen, eg. when --screen or --geometry are set, or when kwin would usually manage it on its own, depending on the mouse cursor position (or when a custom window rule is set). This can be reliably reproduced:

# this opens the window on the screen where the mouse cursor is currently at
mpv --no-config video.mp4

# this always opens the window on the left hand screen (my secondary screen)
mpv --no-config --window-maximized video.mp4
mpv --no-config --window-maximized --screen=0 video.mp4
mpv --no-config --window-maximized --screen=1 video.mp4
Log file
  1. https://gist.github.com/bastimeyer/075a91d2db75edad66d8ebf351a70272#file-log-default-txt
  2. https://gist.github.com/bastimeyer/075a91d2db75edad66d8ebf351a70272#file-log-window-maximized-txt
  3. https://gist.github.com/bastimeyer/075a91d2db75edad66d8ebf351a70272#file-log-window-maximized-0-txt
  4. https://gist.github.com/bastimeyer/075a91d2db75edad66d8ebf351a70272#file-log-window-maximized-1-txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the listed mpv commands on a dual-screen KWin/Wayland setup, comparing the default, --screen, and --geometry cases with and without --window-maximized. Read the linked logs and trace the existing window placement and maximization handling. Done means maximized mpv opens on the intended screen instead of always choosing the left screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.