mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 20:06:00 +01:00
windowrules: Monitor rule fix (#3157)
* fix monitor rules modified: src/events/Windows.cpp * exec on workspace as silent when special is open modified: src/events/Windows.cpp
This commit is contained in:
parent
5126bfab72
commit
8fefb180b1
1 changed files with 4 additions and 1 deletions
|
@ -142,11 +142,11 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
|
|
||||||
const auto PMONITORFROMID = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
const auto PMONITORFROMID = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
||||||
|
|
||||||
PWINDOW->m_iWorkspaceID = PMONITOR->specialWorkspaceID ? PMONITOR->specialWorkspaceID : PMONITOR->activeWorkspace;
|
|
||||||
if (PWINDOW->m_iMonitorID != PMONITOR->ID) {
|
if (PWINDOW->m_iMonitorID != PMONITOR->ID) {
|
||||||
g_pKeybindManager->m_mDispatchers["focusmonitor"](std::to_string(PWINDOW->m_iMonitorID));
|
g_pKeybindManager->m_mDispatchers["focusmonitor"](std::to_string(PWINDOW->m_iMonitorID));
|
||||||
PMONITOR = PMONITORFROMID;
|
PMONITOR = PMONITORFROMID;
|
||||||
}
|
}
|
||||||
|
PWINDOW->m_iWorkspaceID = PMONITOR->specialWorkspaceID ? PMONITOR->specialWorkspaceID : PMONITOR->activeWorkspace;
|
||||||
|
|
||||||
Debug::log(ERR, "Rule monitor, applying to window %lx -> mon: %i, workspace: %i", PWINDOW, PWINDOW->m_iMonitorID, PWINDOW->m_iWorkspaceID);
|
Debug::log(ERR, "Rule monitor, applying to window %lx -> mon: %i, workspace: %i", PWINDOW, PWINDOW->m_iMonitorID, PWINDOW->m_iWorkspaceID);
|
||||||
} catch (std::exception& e) { Debug::log(ERR, "Rule monitor failed, rule: %s -> %s | err: %s", r.szRule.c_str(), r.szValue.c_str(), e.what()); }
|
} catch (std::exception& e) { Debug::log(ERR, "Rule monitor failed, rule: %s -> %s | err: %s", r.szRule.c_str(), r.szValue.c_str(), e.what()); }
|
||||||
|
@ -248,6 +248,9 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
PWINDOW->m_iWorkspaceID = pWorkspace->m_iID;
|
PWINDOW->m_iWorkspaceID = pWorkspace->m_iID;
|
||||||
PWINDOW->m_iMonitorID = pWorkspace->m_iMonitorID;
|
PWINDOW->m_iMonitorID = pWorkspace->m_iMonitorID;
|
||||||
|
|
||||||
|
if (g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID)->specialWorkspaceID && !pWorkspace->m_bIsSpecialWorkspace)
|
||||||
|
workspaceSilent = true;
|
||||||
|
|
||||||
if (!workspaceSilent) {
|
if (!workspaceSilent) {
|
||||||
if (pWorkspace->m_bIsSpecialWorkspace)
|
if (pWorkspace->m_bIsSpecialWorkspace)
|
||||||
g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID)->setSpecialWorkspace(pWorkspace);
|
g_pCompositor->getMonitorFromID(pWorkspace->m_iMonitorID)->setSpecialWorkspace(pWorkspace);
|
||||||
|
|
Loading…
Reference in a new issue