Skip to content

Conversation

@xMAC94x
Copy link

@xMAC94x xMAC94x commented Nov 27, 2025

No description provided.

@Ph4ntomas
Copy link
Contributor

Just my 2 cents (you might want to wait for ottatop input on this):
I think the RPC should be called "MoveToOutput", since it's similar to the one on Window

Could you add the lua side as well ?

@xMAC94x xMAC94x force-pushed the xMAC94x/tag_switch_output branch from 8e46a66 to f17cb71 Compare November 27, 2025 22:02
@xMAC94x xMAC94x force-pushed the xMAC94x/tag_switch_output branch 3 times, most recently from eb36df7 to 312a70d Compare November 28, 2025 08:41
Copy link
Contributor

@Ph4ntomas Ph4ntomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! Lua side looks good !

(I can't mark the comments as resolved, feel free to do so)

Copy link
Collaborator

@Ottatop Ottatop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far!

I'd like this feature to be named move_to_output seeing as it moves tags from one output to another.

Also, this currently doesn't have any special handling for windows with multiple tags. If you move a tag, some windows may end up with tags on two different outputs, which will mess with layouting. I can see two options here:

  1. Remove the moved tag from windows that have it and at least one other tag, or
  2. Remove all tags except the moved tag on all windows with that tag.

I guess just add a boolean flag to let people choose which behavior they want, though input on how this API should be shaped is welcome.

---
---@param output pinnacle.output.OutputHandle The output to add tags to.
---@param tags pinnacle.tag.TagHandle The names of the new tags.
function tag.switch_output(output, tags)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of being a function in this module, I'd like this to be a method on TagHandle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ottatop could we have both ?

IMO the module level function is useful if an output disconnect and you want to retrieve some or all tags.

With the module level function, you can simply call OutputHandle:tags() and forward its return value directly (or after filtering the array)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I suppose with the module-level function you could move multiple tags at once and windows with all those tags wouldn't have any removed. Yea, we can have both.

/// let tag_to_move = tag::get("1")?;
/// tag::switch_output(&output, tag_to_move);
/// ```
pub fn switch_output<I>(output: &OutputHandle, tag_handles: I)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as lua comment above

@xMAC94x xMAC94x force-pushed the xMAC94x/tag_switch_output branch from 312a70d to a025000 Compare December 1, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants