summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2020-01-11 09:45:47 -0800
committerPhilip Langdale <github.philipl@overt.org>2020-01-12 08:43:19 -0800
commit9f7c2710870f0e2e863871b666cb225f0f773e03 (patch)
tree2ebe9db5100133af55682905cc23cf3d8f847f56
parenta870145fb9c3ecdb2a5daf09e24586ca16b1e58a (diff)
downloadmpv-9f7c2710870f0e2e863871b666cb225f0f773e03.tar.bz2
mpv-9f7c2710870f0e2e863871b666cb225f0f773e03.tar.xz
osc: when fullscreened, un-maximise window control should un-fullscreen
It's a bit unintuitive today when you use the un-maximise control while fullscreened. Depending on the VO in use, this might silently change the maximise state without any visible effect, or it might do nothing. It's less surprising if the control exits the fullscreen state. Note that the exact behaviour is still VO dependent. If the window was maximised before being fullscreened, it might exit fullscreen back to maximised or back to regular window mode. I thought about trying to explicitly control that behaviour but it makes the osc code weird and probably wouldn't work all the time.
-rw-r--r--player/lua/osc.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 651bb58e74..9f9ee8adf8 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1065,13 +1065,19 @@ function window_controls(topbar)
-- Maximize: 🗖 /🗗
ne = new_element("maximize", "button")
- if state.maximized then
+ if state.maximized or state.fullscreen then
ne.content = "\238\132\148"
else
ne.content = "\238\132\147"
end
ne.eventresponder["mbtn_left_up"] =
- function () mp.commandv("cycle", "window-maximized") end
+ function ()
+ if state.fullscreen then
+ mp.commandv("cycle", "fullscreen")
+ else
+ mp.commandv("cycle", "window-maximized")
+ end
+ end
lo = add_layout("maximize")
lo.geometry = alignment == "left" and third_geo or second_geo
lo.style = osc_styles.wcButtons