summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/desktop/Window.hpp2
-rw-r--r--src/managers/input/InputManager.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp
index f592aed6..2d99016d 100644
--- a/src/desktop/Window.hpp
+++ b/src/desktop/Window.hpp
@@ -104,6 +104,7 @@ struct SWindowData {
CWindowOverridableVar<bool> tearing = false;
CWindowOverridableVar<bool> xray = false;
CWindowOverridableVar<bool> renderUnfocused = false;
+ CWindowOverridableVar<bool> noFollowMouse = false;
CWindowOverridableVar<Hyprlang::INT> borderSize = {std::string("general:border_size"), Hyprlang::INT(0), std::nullopt};
CWindowOverridableVar<Hyprlang::INT> rounding = {std::string("decoration:rounding"), Hyprlang::INT(0), std::nullopt};
@@ -484,6 +485,7 @@ namespace NWindowProperties {
{"syncfullscreen", [](const PHLWINDOW& pWindow) { return &pWindow->m_sWindowData.syncFullscreen; }},
{"immediate", [](const PHLWINDOW& pWindow) { return &pWindow->m_sWindowData.tearing; }},
{"xray", [](const PHLWINDOW& pWindow) { return &pWindow->m_sWindowData.xray; }},
+ {"nofollowmouse", [](const PHLWINDOW& pWindow) { return &pWindow->m_sWindowData.noFollowMouse; }},
};
const std::unordered_map<std::string, std::function<CWindowOverridableVar<Hyprlang::INT>*(const PHLWINDOW&)>> intWindowProperties = {
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 7ca8dc00..6c3b3699 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -546,8 +546,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) {
// TODO: this looks wrong. When over a popup, it constantly is switching.
// Temp fix until that's figured out. Otherwise spams windowrule lookups and other shit.
if (m_pLastMouseFocus.lock() != pFoundWindow || g_pCompositor->m_pLastWindow.lock() != pFoundWindow) {
- if (m_fMousePosDelta > *PFOLLOWMOUSETHRESHOLD || refocus)
- g_pCompositor->focusWindow(pFoundWindow, foundSurface);
+ if (m_fMousePosDelta > *PFOLLOWMOUSETHRESHOLD || refocus) {
+ const bool hasNoFollowMouse = pFoundWindow && pFoundWindow->m_sWindowData.noFollowMouse.valueOrDefault();
+
+ if (refocus || !hasNoFollowMouse)
+ g_pCompositor->focusWindow(pFoundWindow, foundSurface);
+ }
} else
g_pCompositor->focusSurface(foundSurface, pFoundWindow);
}