mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2026-05-05 02:07:58 +02:00
hyprbars: invalidate input when overlay and top shell layers are on top (#377)
* ignore hyprbars input on overlay and top layers * simplify layer check
This commit is contained in:
parent
f58f65b375
commit
e8f212e9c8
1 changed files with 17 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <hyprland/src/managers/LayoutManager.hpp>
|
||||
#include <hyprland/src/config/ConfigManager.hpp>
|
||||
#include <hyprland/src/managers/AnimationManager.hpp>
|
||||
#include <hyprland/src/protocols/LayerShell.hpp>
|
||||
#include <pango/pangocairo.h>
|
||||
|
||||
#include "globals.hpp"
|
||||
|
|
@ -92,6 +93,22 @@ bool CHyprBar::inputIsValid() {
|
|||
if (WINDOWATCURSOR != m_pWindow && m_pWindow != g_pCompositor->m_lastWindow)
|
||||
return false;
|
||||
|
||||
// check if input is on top or overlay shell layers
|
||||
auto PMONITOR = g_pCompositor->m_lastMonitor.lock();
|
||||
PHLLS foundSurface = nullptr;
|
||||
Vector2D surfaceCoords;
|
||||
|
||||
// check top layer
|
||||
g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &PMONITOR->m_layerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfaceCoords, &foundSurface);
|
||||
|
||||
if (foundSurface)
|
||||
return false;
|
||||
// check overlay layer
|
||||
g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &PMONITOR->m_layerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &surfaceCoords, &foundSurface);
|
||||
|
||||
if (foundSurface)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue