summaryrefslogtreecommitdiffstats
path: root/mpbswap.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-07-26 14:26:51 -0500
committerDudemanguy <random342@airmail.cc>2021-07-26 15:05:33 -0500
commite2c24adebede2d269b0fa2df3f1a05a44343e8c0 (patch)
treef9fd2c579da51b9e626aa84df91579fa523f0236 /mpbswap.h
parentf8e62d3d82dd0a3d06f9a557d756f0ad78118cc7 (diff)
downloadmpv-e2c24adebede2d269b0fa2df3f1a05a44343e8c0.tar.bz2
mpv-e2c24adebede2d269b0fa2df3f1a05a44343e8c0.tar.xz
wayland: unset hidden state in frame callback
More wayland weirdness. So previously, flipping a hidden state from true to false was done in vo_wayland_wait_frame. In theory, this would be after you get the frame callback and all those events so there's no problem. However since the function also does a bunch of flushing/dispatching/etc. to the default display queue so a lot of unknown things can happen before we actually set the hidden variable back to false. For example if a single image was paused and left on another virtual desktop long enough (~5 minutes) while also not having focus, switching back to that desktop could render it a black frame. This edge case was supposed to be handled by the surface being activated again in the toplevel event but apparently that doesn't always work. The fix is to just delete all of that junk and set wl->hidden = false in the frame callback. What's actually happening is kind of a mystery honestly. Probably the compositor drops the buffers after a while as an optimization (sensible) and forces a repaint if you switch back to the virtual desktop. Somehow wl->hidden not being set to false would not properly trigger a repaint (likely because it also sends a toplevel event which does stuff) thus you just get a black window. If you just make sure to set hidden in the frame callback, it appears like all of these problems and edge cases are solved. Since this event must happen first, that makes sense. That simplifies a lot of stuff and fixes some subtle bugs at the same time so just go with this approach.
Diffstat (limited to 'mpbswap.h')
0 files changed, 0 insertions, 0 deletions