c5638cb9dcb355a569f48042cbea4cdc93503af9 — Hugo Machet 1 year, 1 month ago f7cd883
Protocol: Update to latest version
2 files changed, 20 insertions(+), 4 deletions(-)

M protocol/river-layout-v3.xml
M src/main.zig
M protocol/river-layout-v3.xml => protocol/river-layout-v3.xml +17 -2
@@ 38,7 38,7 @@
    can only be done by creating a new major version of the extension.

  <interface name="river_layout_manager_v3" version="1">
  <interface name="river_layout_manager_v3" version="2">
    <description summary="manage river layout objects">
      A global factory for river_layout_v3 objects.

@@ 71,7 71,7 @@

  <interface name="river_layout_v3" version="1">
  <interface name="river_layout_v3" version="2">
    <description summary="receive and respond to layout demands">
      This interface allows clients to receive layout demands from the
      compositor for a specific output and subsequently propose positions and

@@ 174,8 174,23 @@

        A layout_demand will be sent after this event if the compositor is
        currently using this layout object to arrange the output.

        If version 2 or higher of the river_layout_v3 object is bound, the
        user_command_tags event is guaranteed to be sent directly before the
        user_command event.
      <arg name="command" type="string"/>

    <event name="user_command_tags" since="2">
      <description summary="a command sent by the user">
        If version 2 or higher of the river_layout_v3 object is bound, this
        event will be sent directly before every user_command event. This allows
        layout generators to be aware of the active tags when a user command is
        sent. This is necessary for generators wanting to keep settings on a
        per-tag basis.
      <arg name="tags" type="uint" summary="tags of the output, 32-bit bitfield"/>

M src/main.zig => src/main.zig +3 -2
@@ 227,6 227,7 @@ const Output = struct {
            .user_command_tags => {},

            .layout_demand => |ev| {
                const main_count: u31 = math.clamp(output.cfg.main_count, 1, @truncate(u31, ev.view_count));

@@ 510,9 511,9 @@ fn registry_event(context: *Context, registry: *wl.Registry, event: wl.Registry.
    switch (event) {
        .global => |ev| {
            if (std.cstr.cmp(ev.interface, river.LayoutManagerV3.getInterface().name) == 0) {
                context.layout_manager = try registry.bind(ev.name, river.LayoutManagerV3, 1);
                context.layout_manager = try registry.bind(ev.name, river.LayoutManagerV3, 2);
            } else if (std.cstr.cmp(ev.interface, wl.Output.getInterface().name) == 0) {
                const wl_output = try registry.bind(ev.name, wl.Output, 3);
                const wl_output = try registry.bind(ev.name, wl.Output, 4);
                errdefer wl_output.release();

                const node = try gpa.create(std.SinglyLinkedList(Output).Node);