Commit f2fa461
committed
wayland: only reuse old size if both width and height are 0
The protocol states that "If the width or height arguments are zero, it
means the client should decide its own window dimension." Key point here
is the omission of plurality from "dimension." This means a compositor
could theoretically set width OR height to 0 and a specific size for the
other dimension. There is no compositor out in the wild that does it but
this is one proposed solution to mpv technically violating the letter of
the protocol on Wayland when resizing while trying to keep the aspect
ratio.
mpv isn't allowed to make the window larger than size it receives in the
configure event while the resizing event is set, but this means that it
is impossible for the mpv window to grow if the user tries to resize
from any side of the window (as opposed to corners). When the user
attempts to grow the window from sides, mpv cannot keep the same aspect
ratio without also growing on the other dimension. This is a protocol
violation, though no compositor actually checks or enforces this. The
solution to this is compositors setting the required size on one
dimension to 0, so mpv can freely grow in that dimension to keep up with
interactive resize.
Related: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/331 parent 5ba7ee5 commit f2fa461
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
1310 | | - | |
1311 | | - | |
| 1310 | + | |
| 1311 | + | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1318 | 1326 | | |
1319 | 1327 | | |
1320 | 1328 | | |
| |||
0 commit comments