Skip to content

[FEAT] Add option to disable all window control buttons #186

Description

@alandooz

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Add an option to disable all window control buttons (minimize/iconify, maximize/restore, and close), rather than only the close button.

Currently HARDEN_OPENBOX=true sets DISABLE_CLOSE_BUTTON=true, which removes only the close button.

It would be useful to have these two:

  • add a new environment variable such as DISABLE_WINDOW_BUTTONS=true, which removes minimize, maximize/restore, and close;
  • extend the existing hardening behavior so HARDEN_OPENBOX=true removes all three window control buttons.

Ideally this should behave consistently on both Openbox/Xorg and labwc/Wayland.

Reason for change

When using Selkies containers as a locked-down application interface, removing only the close button still allows users to minimize or change the maximized state of the application.

For hardened/single-application deployments, users should not be able to manipulate the application window through any of the standard title-bar controls.

Removing all three controls would make HARDEN_OPENBOX more complete and would prevent users from minimizing, restoring/unmaximizing, or closing the application from the title bar while still keeping the window decoration/title bar itself.

Proposed code change

A possible implementation would be to introduce DISABLE_WINDOW_BUTTONS.

For Openbox, the current close-button handling:

if [[ "${DISABLE_CLOSE_BUTTON,,}" == "true" ]]; then
  echo "[ls.io-init] Disabling close button"
  sed -i '/<titleLayout>/s/C//' "$SYS_RC_XML"
fi

could be extended with something like:

if [[ "${DISABLE_WINDOW_BUTTONS,,}" == "true" ]]; then
  echo "[ls.io-init] Disabling window buttons"
  sed -i '/<titleLayout>/s/[IMC]//g' "$SYS_RC_XML"
fi

where I, M, and C correspond to iconify/minimize, maximize, and close.

For labwc/Wayland, the default titlebar layout is:

<layout>icon:iconify,max,close</layout>

so the same option could remove iconify, max, and close, while retaining the application icon/titlebar.

HARDEN_OPENBOX=true could then set:

export DISABLE_WINDOW_BUTTONS="true"

instead of, or in addition to, DISABLE_CLOSE_BUTTON="true".

Keeping DISABLE_CLOSE_BUTTON separately may be preferable for backwards compatibility and for users who only want to hide Close.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions