Merge pull request #3143 from tomben13/fix_workspaces
Fixes for hyprland/workspaces
This commit is contained in:
commit
dd092a5fc1
|
@ -194,6 +194,10 @@ void Workspaces::doUpdate() {
|
||||||
for (auto &[workspaceData, clientsData] : m_workspacesToCreate) {
|
for (auto &[workspaceData, clientsData] : m_workspacesToCreate) {
|
||||||
createWorkspace(workspaceData, clientsData);
|
createWorkspace(workspaceData, clientsData);
|
||||||
}
|
}
|
||||||
|
if (!m_workspacesToCreate.empty()) {
|
||||||
|
updateWindowCount();
|
||||||
|
sortWorkspaces();
|
||||||
|
}
|
||||||
m_workspacesToCreate.clear();
|
m_workspacesToCreate.clear();
|
||||||
|
|
||||||
// get all active workspaces
|
// get all active workspaces
|
||||||
|
@ -318,7 +322,7 @@ void Workspaces::onEvent(const std::string &ev) {
|
||||||
onWorkspaceCreated(payload);
|
onWorkspaceCreated(payload);
|
||||||
} else if (eventName == "focusedmon") {
|
} else if (eventName == "focusedmon") {
|
||||||
onMonitorFocused(payload);
|
onMonitorFocused(payload);
|
||||||
} else if (eventName == "moveworkspace" && !allOutputs()) {
|
} else if (eventName == "moveworkspace") {
|
||||||
onWorkspaceMoved(payload);
|
onWorkspaceMoved(payload);
|
||||||
} else if (eventName == "openwindow") {
|
} else if (eventName == "openwindow") {
|
||||||
onWindowOpened(payload);
|
onWindowOpened(payload);
|
||||||
|
@ -387,6 +391,12 @@ void Workspaces::onWorkspaceCreated(std::string const &workspaceName,
|
||||||
|
|
||||||
void Workspaces::onWorkspaceMoved(std::string const &payload) {
|
void Workspaces::onWorkspaceMoved(std::string const &payload) {
|
||||||
spdlog::debug("Workspace moved: {}", payload);
|
spdlog::debug("Workspace moved: {}", payload);
|
||||||
|
|
||||||
|
// Update active workspace
|
||||||
|
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
|
||||||
|
|
||||||
|
if (allOutputs()) return;
|
||||||
|
|
||||||
std::string workspaceName = payload.substr(0, payload.find(','));
|
std::string workspaceName = payload.substr(0, payload.find(','));
|
||||||
std::string monitorName = payload.substr(payload.find(',') + 1);
|
std::string monitorName = payload.substr(payload.find(',') + 1);
|
||||||
|
|
||||||
|
@ -826,8 +836,6 @@ void Workspaces::init() {
|
||||||
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
|
m_activeWorkspaceName = (gIPC->getSocket1JsonReply("activeworkspace"))["name"].asString();
|
||||||
|
|
||||||
initializeWorkspaces();
|
initializeWorkspaces();
|
||||||
updateWindowCount();
|
|
||||||
sortWorkspaces();
|
|
||||||
dp.emit();
|
dp.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue