diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-24 18:36:31 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-24 18:36:31 +0100 |
| commit | 69f1d7b3607bb088512420052b9e0d48e529772d (patch) | |
| tree | c2e272ce748f90812abf2a1b0b6e322c43924d13 /src/Compositor.cpp | |
| parent | e0bc952c8382992c2e9621865b94c904e728a8c3 (diff) | |
Rework workspace rules
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 8441e1bc..d811b8d5 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1875,3 +1875,17 @@ bool CCompositor::cursorOnReservedArea() { return !VECINRECT(CURSORPOS, XY1.x, XY1.y, XY2.x, XY2.y); } + +CWorkspace* CCompositor::createNewWorkspace(const int& id, const int& monid, const std::string& name) { + const auto NAME = name == "" ? std::to_string(id) : name; + const auto PWORKSPACE = m_vWorkspaces.emplace_back(std::make_unique<CWorkspace>(monid, NAME, id == SPECIAL_WORKSPACE_ID)).get(); + + // We are required to set the name here immediately + if (id != SPECIAL_WORKSPACE_ID) + wlr_ext_workspace_handle_v1_set_name(PWORKSPACE->m_pWlrHandle, NAME.c_str()); + + PWORKSPACE->m_iID = id; + PWORKSPACE->m_iMonitorID = monid; + + return PWORKSPACE; +} |
