core: Wayland: Utilize Client Side Decorations when Server Side Decorations are not supported #1298

Open
opened 2024-11-01 02:40:26 +00:00 by ronald-mz · 0 comments
ronald-mz commented 2024-11-01 02:40:26 +00:00 (Migrated from github.com)

As discussed in https://github.com/hexops/mach/issues/1275, not all window managers support Server Side Decorations.

Work to be done

On Integrating LibDecor

As discussed here: LibDecor should be the default.

  • If LibDecor is not found, we use SSD.
  • If we can't use SSD, we throw an error

There are two cases where SSD won't be available:

  1. Compositor has not implemented zxdg_decoration_manager_v1_get_toplevel_decoration

    • Mutter, Weston, Gamescope, etc. etc.
  2. or when zxdg_decoration_manager_v1_get_toplevel_decoration is implemented, but the compositor signals CSD.

    • Even if we tell the compositor we prefer SSD, it can still use CSD.
    • Cosmic (at time of writing) is the only compositor I know of that does this. Even if they do add SSD support as they work through their Alpha, we should still support this case because it's what the protocol expects.
    • It'll tell us with a configure event. We should respect the mode specified during the event.
As discussed in https://github.com/hexops/mach/issues/1275, not all window managers support Server Side Decorations. ## Work to be done * [x] - As a stopgap, raise and error when SSD is not supported. (Will cause Mach to fallback to X11) * https://github.com/hexops/mach/pull/1292 * [x] - Add LibDecor as a dependency * https://github.com/hexops/mach/pull/1294 * [ ] - Integrate LibDecor into `src/core/linux/Wayland.zig` ### On Integrating LibDecor As discussed [here](https://github.com/hexops/mach/issues/1275#issuecomment-2433416159): LibDecor should be the default. * If LibDecor is not found, we use SSD. * If we can't use SSD, we throw an error #### There are two cases where SSD won't be available: 1. Compositor has not implemented `zxdg_decoration_manager_v1_get_toplevel_decoration` - Mutter, Weston, Gamescope, etc. etc. 2. or when `zxdg_decoration_manager_v1_get_toplevel_decoration` is implemented, but the compositor signals CSD. - Even if we tell the compositor we prefer SSD, it can still use CSD. - Cosmic (at time of writing) is the only compositor I know of that does this. Even if they do add SSD support as they work through their Alpha, we should still support this case because it's what the protocol expects. - It'll tell us with a [configure event](https://wayland.app/protocols/xdg-decoration-unstable-v1#zxdg_toplevel_decoration_v1:event:configure). We should respect the mode specified during the event.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#1298
No description provided.