-
Notifications
You must be signed in to change notification settings - Fork 203
Add ipc method to send view to workspace #2646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ipc method to send view to workspace #2646
Conversation
plugins/vswitch/vswitch.cpp
Outdated
uint64_t x = wf::ipc::json_get_uint64(data, "x"); | ||
uint64_t y = wf::ipc::json_get_uint64(data, "y"); | ||
uint64_t output_id = wf::ipc::json_get_uint64(data, "output-id"); | ||
std::optional<uint64_t> view_id = wf::ipc::json_get_optional_uint64(data, "view-id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused, if the method is send-view
then why is the view optional? IPC clients can call set-workspace
if they want to switch without a view ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the code from set-workspace, which is why it looks like this.
I just updated it, I'll push it shortly.
plugins/vswitch/vswitch.cpp
Outdated
return wf::ipc::json_error("Cannot grab view on a different output!"); | ||
} | ||
|
||
wf::view_change_workspace_signal signal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that pretty much the same code has been implemented already in the same file, maybe we can have a shared function instead of duplicating the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a suggestion as to where we can do this, I'll try to implement it. For now, I'm leaving it as it is.
plugins/vswitch/vswitch.cpp
Outdated
@@ -24,6 +24,31 @@ class workspace_animation_t : public duration_t | |||
timed_transition_t dy{*this}; | |||
}; | |||
|
|||
/** | |||
* A mall helper function to move a view and it's children to workspace @to_ws. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A mall helper function to move a view and it's children to workspace @to_ws. | |
* A small helper function to move a view and it's children to workspace @to_ws. |
* A mall helper function to move a view and it's children to workspace @to_ws. | |
* A mall helper function to move a view and it's children to workspace @to_ws. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last small change, otherwise lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, needs a code style fix and then we're good to go :)
Just uncrustified. Sorry, I had forgotten about this, been busy with work. :( |
Thanks :) |
No description provided.