From c0940bddd880d563ff648cff76618061ad25812a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 28 Nov 2021 13:04:07 +0100 Subject: [PATCH] fixed the bar being behind transparent fullscreen windows --- src/windowManager.cpp | 22 ++++++++++++++++++++++ src/windowManager.hpp | 1 + 2 files changed, 23 insertions(+) diff --git a/src/windowManager.cpp b/src/windowManager.cpp index d51e9e3..a6f06ad 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -1108,6 +1108,28 @@ void CWindowManager::updateBarInfo() { } IPCSendMessage(m_sIPCBarPipeIn.szPipeName, message); + + + // Also check if the bar should be made invisibel + // we make it by moving it far far away + // the bar will also stop all updates + if (message.fullscreenOnBar) { + if (lastKnownBarPosition.x == -1 && lastKnownBarPosition.y == -1) { + lastKnownBarPosition = monitors[ConfigManager::getInt("bar:monitor") > monitors.size() ? 0 : ConfigManager::getInt("bar:monitor")].vecPosition; + } + + Values[0] = (int)-99999; + Values[1] = (int)-99999; + xcb_configure_window(DisplayConnection, barWindowID, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, Values); + } else { + if (lastKnownBarPosition.x != -1 && lastKnownBarPosition.y != -1) { + Values[0] = (int)lastKnownBarPosition.x; + Values[1] = (int)lastKnownBarPosition.y; + xcb_configure_window(DisplayConnection, barWindowID, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, Values); + } + + lastKnownBarPosition = Vector2D(-1, -1); + } } void CWindowManager::setAllFloatingWindowsTop() { diff --git a/src/windowManager.hpp b/src/windowManager.hpp index d7c08b8..ddaf231 100644 --- a/src/windowManager.hpp +++ b/src/windowManager.hpp @@ -46,6 +46,7 @@ public: SIPCPipe m_sIPCBarPipeIn = {ISDEBUG ? "/tmp/hypr/hyprbarind" : "/tmp/hypr/hyprbarin", 0}; SIPCPipe m_sIPCBarPipeOut = {ISDEBUG ? "/tmp/hypr/hyprbaroutd" : "/tmp/hypr/hyprbarout", 0}; CStatusBar* statusBar = nullptr; + Vector2D lastKnownBarPosition = {-1,-1}; uint64_t barWindowID = 0; GThread* barThread; /* Well right now anything but the bar but lol */