Skip to content

Commit a493d15

Browse files
committed
osc.lua: fix window controls showing in fullscreen
If `no-border` or `no-title-bar` was used, window controls would enable also in fullscreen, this was inconsistent, as window decorations are not visible ragardless of those options in fullscreen mode.
1 parent 88ac54b commit a493d15

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

DOCS/man/osc.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ Configurable Options
404404
render OSD into the unscaled video.
405405

406406
``windowcontrols``
407-
Default: auto (Show window controls if there is no window border)
407+
Default: auto (Show window controls if there is no window border/title-bar or
408+
in the fullscreen mode.)
408409

409410
Whether to show window management controls over the video, and if so,
410411
which side of the window to place them. This may be desirable when the
@@ -416,6 +417,12 @@ Configurable Options
416417
and ``quit``. Not all platforms implement ``minimize`` and ``maximize``,
417418
but ``quit`` will always work.
418419

420+
``windowcontrols_fullscreen``
421+
Default: no
422+
423+
Whether to show window controls in fullscreen mode. Only applies when
424+
``windowcontrols`` is set to ``auto``.
425+
419426
``windowcontrols_independent``
420427
Default: yes
421428

player/lua/osc.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ local user_opts = {
4949
boxmaxchars = 80, -- title crop threshold for box layout
5050
boxvideo = false, -- apply osc_param.video_margins to video
5151
windowcontrols = "auto", -- whether to show window controls
52+
windowcontrols_fullscreen = false, -- show window controls in fullscreen
5253
windowcontrols_alignment = "right", -- which side to show window controls on
5354
windowcontrols_title = "${media-title}", -- same as title but for windowcontrols
5455
windowcontrols_independent = true, -- show window controls and bottom bar independently
@@ -650,7 +651,10 @@ end
650651
local function window_controls_enabled()
651652
local val = user_opts.windowcontrols
652653
if val == "auto" then
653-
return not (state.border and state.title_bar)
654+
if state.fullscreen then
655+
return user_opts.windowcontrols_fullscreen
656+
end
657+
return not state.border or not state.title_bar
654658
else
655659
return val ~= "no"
656660
end

0 commit comments

Comments
 (0)