From a220f086486563bf27110013fc3f2322bbb198c7 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Tue, 26 Nov 2019 08:50:14 +0800 Subject: osc: implement pseudo client side decorations via OSC Today, if window decorations are not present, either because they were disabled, or because the platform doesn't support them (eg: gnome-shell on wayland), there are no window controls, meaning it is not possible to minimize/maximize/close a window without knowing keyboard shortcuts. While you can imagine various ways of offering client side decorations, it is attractive to consider using OSC because that is functionality that we already have. The main work here is defining a separate input area from the main OSC box with its own buttons, etc. While we could probably handle auto-detection based on whether decorations are present or not, it's manually controlled for now. The window control logic is mostly disconnected from the OSC itself, except in the case of the `topbar` layout, where there has to be coordination so that the controls don't get drawn on top of each other. I had to do fine-positioning of the buttons based on the font on my system, so don't be surprised if it looks wrong elsewhere. You could also argue that window controls should be unscaled, even if the main OSC box is scaled, but I've not tried to do this. --- DOCS/man/osc.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'DOCS/man') diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index d9c3b3fe96..c0b3760a2e 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -341,6 +341,22 @@ Configurable Options ``--sub-use-margins`` option is set to ``yes``, the default). This may be fixed later. +``windowcontrols`` + Default: no (Do not show window controls) + + Whether to show window management controls over the video, and if so, + which side of the window to place them. This may be desirable when the + window has no decorations, either because they have been explicitly + disabled (``border=no``) or because the current platform doesn't support + them (eg: gnome-shell with wayland). + + The set of window controls is fixed, offering ``minimze``, ``maximize``, + and ``quit``. Not all platforms implement ``minimize`` and ``maximize``, + but ``quit`` will always work. + + Supports ``left`` and ``right`` which will place the controls on those + respective sides. + Script Commands ~~~~~~~~~~~~~~~ -- cgit v1.2.3