Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/canvas/wayland/config/hyprland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,19 @@ void HyprlandSocket::remove_borders(const std::string_view appid)
request(payload);
}

void HyprlandSocket::change_workspace(const std::string_view appid, int workspaceid)
{
const auto payload = fmt::format("/dispatch movetoworkspacesilent {},title:{}", workspaceid, appid);
request(payload);
}

void HyprlandSocket::move_window(const std::string_view appid, int xcoord, int ycoord)
{
auto terminal = get_active_window();
const auto &workspace = terminal.at("workspace");
const int workspaceid = workspace.at("id");
change_workspace(appid, workspaceid);

int res_x = xcoord;
int res_y = ycoord;
if (output_scale > 1.0F) {
Expand Down
1 change: 1 addition & 0 deletions src/canvas/wayland/config/hyprland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class HyprlandSocket : public WaylandConfig
void enable_floating(std::string_view appid);
void remove_borders(std::string_view appid);
void remove_rounding(std::string_view appid);
void change_workspace(std::string_view appid, int workspaceid);
void request(std::string_view payload);
auto request_result(std::string_view payload) -> nlohmann::json;
auto get_active_window() -> nlohmann::json;
Expand Down