diff options
author | Tom Englund <[email protected]> | 2024-10-27 18:51:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-27 17:51:26 +0000 |
commit | f9b52203f58bcb716144d89ee9f85fe12ebfe94d (patch) | |
tree | 4ecf23106134d32a5411a185d7081f986cd0c33c /src/desktop/Window.hpp | |
parent | a3d3b4fd64a51a8c1663b450bd2a408f1f0fa9b3 (diff) | |
download | Hyprland-f9b52203f58bcb716144d89ee9f85fe12ebfe94d.tar.gz Hyprland-f9b52203f58bcb716144d89ee9f85fe12ebfe94d.zip |
internal: optimize cursor move a bit (#8264)
* window: inline and const getWindowMainSurfaceBox
getWindowMainSurfaceBox gets called a lot of times from deep down from
mousemoveunified, profiling mousemoveunified it spends quite a lot of
cpu time in here, let the compiler optimize the call to
getWindowMainSurfaceBox by inlining and making it const. reducing the
overhead.
* inputmgr: return early and use std::any_of
return early in mousemoveunified to reduce the amount of unnecessery
calls to various pointers when not needed, also make isconstrained use
std::any_of instead of for loop to use the STL optimized paths with
hopes and dreams marginally faster.
* decoration: return early, reduce temporar copy
return earlier and reduce the temp copies by using one .lock instead of
two
Diffstat (limited to 'src/desktop/Window.hpp')
-rw-r--r-- | src/desktop/Window.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index 9867a8c9..64f39558 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -396,10 +396,12 @@ class CWindow { } // methods - CBox getFullWindowBoundingBox(); - SBoxExtents getFullWindowExtents(); - CBox getWindowBoxUnified(uint64_t props); - CBox getWindowMainSurfaceBox(); + CBox getFullWindowBoundingBox(); + SBoxExtents getFullWindowExtents(); + CBox getWindowBoxUnified(uint64_t props); + inline CBox getWindowMainSurfaceBox() const { + return {m_vRealPosition.value().x, m_vRealPosition.value().y, m_vRealSize.value().x, m_vRealSize.value().y}; + } CBox getWindowIdealBoundingBoxIgnoreReserved(); void addWindowDeco(std::unique_ptr<IHyprWindowDecoration> deco); void updateWindowDecos(); |