Skip to content

Commit 5999676

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 5999676

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

DOCS/man/osc.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ 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)
408408

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

419+
``windowcontrols_fullscreen``
420+
Default: no
421+
422+
Whether to show window controls in fullscreen mode. Only applies when
423+
``windowcontrols`` is set to ``auto``.
424+
419425
``windowcontrols_independent``
420426
Default: yes
421427

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)