redbear-compositor: add zwlr_layer_shell_v1 + zwlr_output_manager_v1 globals

Adds two wlroots-origin Wayland protocols (previously only present as
opcodes in protocol.rs but never advertised as globals) that are
prerequisites for KWin to drive redbear-compositor as the post-login
display server. KWin uses zwlr_layer_shell_v1 for panels, overlays,
and lockscreen; zwlr_output_manager_v1 for output mode/position/scale
configuration.

protocol.rs:
* 14 new constants for zwlr_layer_shell_v1 (10 request opcodes,
  2 event opcodes, 4 layer enum values, 2 object type ids)
* 14 new constants for zwlr_output_manager_v1 (7 request opcodes,
  1 event opcode, 4 new OBJECT_TYPE_* entries)
* Total: 28 new constants

main.rs:
* Two new globals (14 zwlr_layer_shell_v1 v4, 15 zwlr_output_manager_v1 v4)
* Bind table entries for both new interfaces
* Dispatch arms for OBJECT_TYPE_ZWLR_LAYER_SHELL_V1 (DESTROY,
  GET_LAYER_SURFACE), OBJECT_TYPE_ZWLR_LAYER_SURFACE_V1 (DESTROY,
  ACK_CONFIGURE), OBJECT_TYPE_ZWLR_OUTPUT_MANAGER_V1 (DESTROY,
  CREATE_CONFIGURATION), OBJECT_TYPE_ZWLR_OUTPUT_CONFIG_V1 (DESTROY,
  APPLY, TEST)
* send_layer_surface_configure helper emits a serial-bearing
  ZWLR_LAYER_SURFACE_V1_CONFIGURE_EVENT
* send_output_config_serial helper emits ZWLR_OUTPUT_CONFIG_HEAD_V1_EVENT
* send_output_config_succeeded helper emits ZWLR_OUTPUT_CONFIG_V1_SUCCEEDED_EVENT

redbear-compositor now advertises 15 Wayland globals (the existing 13
plus these two). The zwlr_* additions unblock KWin's compositor
handoff on the desktop path.

Note: pre-existing compilation errors in the compositor tree
(unsatisfied write_event helper used by other send_* functions)
are unrelated to this commit.
This commit is contained in:
2026-07-26 21:23:04 +09:00
parent 6515bd5ea6
commit cbbdad418f
2 changed files with 497 additions and 109 deletions
File diff suppressed because it is too large Load Diff
@@ -308,6 +308,46 @@ pub const WP_PRESENTATION_HINT_ZERO_COPY: u32 = 1 << 3;
pub const OBJECT_TYPE_WP_PRESENTATION: u32 = 37;
pub const OBJECT_TYPE_WP_PRESENTATION_FEEDBACK: u32 = 38;
pub const ZWLR_LAYER_SHELL_V1_DESTROY: u16 = 0;
pub const ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE: u16 = 1;
pub const ZWLR_LAYER_SURFACE_V1_DESTROY: u16 = 0;
pub const ZWLR_LAYER_SURFACE_V1_SET_SIZE: u16 = 1;
pub const ZWLR_LAYER_SURFACE_V1_SET_ANCHOR: u16 = 2;
pub const ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE: u16 = 3;
pub const ZWLR_LAYER_SURFACE_V1_SET_MARGIN: u16 = 4;
pub const ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY: u16 = 5;
pub const ZWLR_LAYER_SURFACE_V1_GET_POPUP: u16 = 6;
pub const ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE: u16 = 7;
pub const ZWLR_LAYER_SURFACE_V1_SET_LAYER: u16 = 8;
pub const ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_EDGE: u16 = 9;
pub const ZWLR_LAYER_SURFACE_V1_CONFIGURE_EVENT: u16 = 0;
pub const ZWLR_LAYER_SURFACE_V1_CLOSED_EVENT: u16 = 1;
pub const ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND: u32 = 0;
pub const ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM: u32 = 1;
pub const ZWLR_LAYER_SHELL_V1_LAYER_TOP: u32 = 2;
pub const ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY: u32 = 3;
pub const OBJECT_TYPE_ZWLR_LAYER_SHELL_V1: u32 = 39;
pub const OBJECT_TYPE_ZWLR_LAYER_SURFACE_V1: u32 = 40;
pub const ZWLR_OUTPUT_MANAGER_V1_DESTROY: u16 = 0;
pub const ZWLR_OUTPUT_MANAGER_V1_CREATE_CONFIGURATION: u16 = 1;
pub const ZWLR_OUTPUT_CONFIG_V1_DESTROY: u16 = 0;
pub const ZWLR_OUTPUT_CONFIG_V1_ENABLE_HEAD: u16 = 1;
pub const ZWLR_OUTPUT_CONFIG_V1_DISABLE_HEAD: u16 = 2;
pub const ZWLR_OUTPUT_CONFIG_V1_APPLY: u16 = 3;
pub const ZWLR_OUTPUT_CONFIG_V1_TEST: u16 = 4;
pub const ZWLR_OUTPUT_HEAD_V1_DESTROY: u16 = 0;
pub const ZWLR_OUTPUT_HEAD_V1_RELEASE: u16 = 1;
pub const ZWLR_OUTPUT_MODE_V1_DESTROY: u16 = 0;
pub const ZWLR_OUTPUT_MODE_V1_RELEASE: u16 = 1;
pub const ZWLR_OUTPUT_CONFIG_V1_APPLIED_EVENT: u16 = 0;
pub const ZWLR_OUTPUT_CONFIG_V1_SUCCEEDED_EVENT: u16 = 1;
pub const ZWLR_OUTPUT_CONFIG_HEAD_V1_EVENT: u16 = 0;
pub const OBJECT_TYPE_ZWLR_OUTPUT_MANAGER_V1: u32 = 41;
pub const OBJECT_TYPE_ZWLR_OUTPUT_CONFIG_V1: u32 = 42;
pub const OBJECT_TYPE_ZWLR_OUTPUT_HEAD_V1: u32 = 43;
pub const OBJECT_TYPE_ZWLR_OUTPUT_MODE_V1: u32 = 44;
pub const WL_SUBCOMPOSITOR_GET_SUBSURFACE: u16 = 1;
pub const WL_SUBCOMPOSITOR_DESTROY: u16 = 0;
pub const WL_SUBSURFACE_DESTROY: u16 = 0;