summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorEpilepsy Gatherings <73647246+phonetic112@users.noreply.github.com>2024-02-13 13:07:19 -0500
committerGitHub <noreply@github.com>2024-02-13 18:07:19 +0000
commit2a3429d4cfdc01794b9d6fc1b49be1da019b5606 (patch)
tree046d1995e8ff8c8f14eeac584e1a95c029c014a3 /src/debug/HyprCtl.cpp
parent95abf1220f56acbe88517799fc4b92be2e908575 (diff)
internal: add `forcenofocus` prop (#4672)
* add forcenofocus * change nofocus to overridable var
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index de2aaeb8..08957750 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -1084,7 +1084,8 @@ std::string dispatchSetProp(eHyprCtlOutputFormat format, std::string request) {
if (vars.size() < 4)
return "not enough args";
- const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[1]);
+ const auto PLASTWINDOW = g_pCompositor->m_pLastWindow;
+ const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[1]);
if (!PWINDOW)
return "window not found";
@@ -1092,6 +1093,8 @@ std::string dispatchSetProp(eHyprCtlOutputFormat format, std::string request) {
const auto PROP = vars[2];
const auto VAL = vars[3];
+ auto noFocus = PWINDOW->m_sAdditionalConfigData.noFocus;
+
bool lock = false;
if (vars.size() > 4) {
@@ -1121,6 +1124,8 @@ std::string dispatchSetProp(eHyprCtlOutputFormat format, std::string request) {
PWINDOW->m_sAdditionalConfigData.forceNoShadow.forceSetIgnoreLocked(configStringToInt(VAL), lock);
} else if (PROP == "forcenodim") {
PWINDOW->m_sAdditionalConfigData.forceNoDim.forceSetIgnoreLocked(configStringToInt(VAL), lock);
+ } else if (PROP == "nofocus") {
+ PWINDOW->m_sAdditionalConfigData.noFocus.forceSetIgnoreLocked(configStringToInt(VAL), lock);
} else if (PROP == "windowdancecompat") {
PWINDOW->m_sAdditionalConfigData.windowDanceCompat.forceSetIgnoreLocked(configStringToInt(VAL), lock);
} else if (PROP == "nomaxsize") {
@@ -1156,6 +1161,12 @@ std::string dispatchSetProp(eHyprCtlOutputFormat format, std::string request) {
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
+ if (!(PWINDOW->m_sAdditionalConfigData.noFocus.toUnderlying() == noFocus.toUnderlying())) {
+ g_pCompositor->focusWindow(nullptr);
+ g_pCompositor->focusWindow(PWINDOW);
+ g_pCompositor->focusWindow(PLASTWINDOW);
+ }
+
for (auto& m : g_pCompositor->m_vMonitors)
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID);