Hypr bar treated as EWMH, fix for reserved and no_gaps_when_only

This commit is contained in:
vaxerski 2022-03-09 11:42:07 +01:00
parent f213047085
commit 002247629e
6 changed files with 7 additions and 21 deletions

View File

@ -446,9 +446,6 @@ void CStatusBar::drawErrorScreen() {
void CStatusBar::draw() {
if (m_bIsCovered)
return; // Do not draw a bar on a fullscreen window.
if (m_bIsDestroyed)
return;

View File

@ -64,7 +64,6 @@ public:
EXPOSED_MEMBER(StatusCommand, std::string, sz); // TODO: make the bar better
EXPOSED_MEMBER(LastWindowName, std::string, sz);
EXPOSED_MEMBER(LastWindowClass, std::string, sz);
EXPOSED_MEMBER(IsCovered, bool, b);
EXPOSED_MEMBER(HasTray, bool, b);
EXPOSED_MEMBER(IsDestroyed, bool, b); // for not deleting nulls

View File

@ -600,10 +600,6 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
// Map the window
xcb_map_window(g_pWindowManager->DisplayConnection, E->window);
// bar
if (E->window == g_pWindowManager->barWindowID)
return;
// We check if the window is not on our tile-blacklist and if it is, we have a special treatment procedure for it.
// this func also sets some stuff

View File

@ -136,7 +136,7 @@ void IPCRecieveMessageB(const std::string path) {
} else if (PROPNAME == "lastwindowclass") {
g_pWindowManager->statusBar->setLastWindowClass(PROPVALUE);
} else if (PROPNAME == "barfullscreenwindow") {
g_pWindowManager->statusBar->setIsCovered(PROPVALUE == "1" ? true : false);
// deprecated
}
}
} catch(...) {

View File

@ -465,12 +465,12 @@ void CWindowManager::refreshDirtyWindows() {
const auto MONITOR = getMonitorFromWindow(&window);
Values[0] = (int)MONITOR->vecSize.x;
Values[1] = window.getFullscreen() ? (int) MONITOR->vecSize.y : MONITOR->vecSize.y - getBarHeightForMonitor(window.getMonitor());
Values[0] = window.getFullscreen() ? (int)MONITOR->vecSize.x : MONITOR->vecSize.x - MONITOR->vecReservedTopLeft.x - MONITOR->vecReservedBottomRight.x;
Values[1] = window.getFullscreen() ? (int) MONITOR->vecSize.y : MONITOR->vecSize.y - MONITOR->vecReservedTopLeft.y - MONITOR->vecReservedBottomRight.y;
window.setEffectiveSize(Vector2D(Values[0], Values[1]));
Values[0] = (int)MONITOR->vecPosition.x;
Values[1] = window.getFullscreen() ? (int)MONITOR->vecPosition.y : MONITOR->vecPosition.y + getBarHeightForMonitor(window.getMonitor());
Values[0] = window.getFullscreen() ? (int)MONITOR->vecPosition.x : MONITOR->vecPosition.x + MONITOR->vecReservedTopLeft.x;
Values[1] = window.getFullscreen() ? (int)MONITOR->vecPosition.y : MONITOR->vecPosition.y + MONITOR->vecReservedTopLeft.y;
window.setEffectivePosition(Vector2D(Values[0], Values[1]));
Values[0] = (int)window.getRealPosition().x;
@ -895,7 +895,6 @@ void CWindowManager::setEffectiveSizePosUsingConfig(CWindow* pWindow) {
return;
const auto MONITOR = getMonitorFromWindow(pWindow);
const auto BARHEIGHT = getBarHeightForMonitor(pWindow->getMonitor());
// set some flags.
const bool DISPLAYLEFT = STICKS(pWindow->getPosition().x, MONITOR->vecPosition.x);
@ -911,7 +910,7 @@ void CWindowManager::setEffectiveSizePosUsingConfig(CWindow* pWindow) {
pWindow->setEffectiveSize(pWindow->getSize() - (Vector2D(BORDERSIZE, BORDERSIZE) * 2));
const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? GAPSOUT + MONITOR->vecReservedTopLeft.x : GAPSIN,
DISPLAYTOP ? GAPSOUT + MONITOR->vecReservedTopLeft.y + BARHEIGHT : GAPSIN);
DISPLAYTOP ? GAPSOUT + MONITOR->vecReservedTopLeft.y : GAPSIN);
const auto OFFSETBOTTOMRIGHT = Vector2D( DISPLAYRIGHT ? GAPSOUT + MONITOR->vecReservedBottomRight.x : GAPSIN,
DISPLAYBOTTOM ? GAPSOUT + MONITOR->vecReservedBottomRight.y : GAPSIN);
@ -1026,7 +1025,7 @@ void CWindowManager::calculateNewTileSetOldTile(CWindow* pWindow) {
int CWindowManager::getWindowsOnWorkspace(const int& workspace) {
int number = 0;
for (auto& w : windows) {
if (w.getWorkspaceID() == workspace && w.getDrawable() > 0) {
if (w.getWorkspaceID() == workspace && w.getDrawable() > 0 && !w.getDock()) {
++number;
}
}
@ -2419,10 +2418,6 @@ bool CWindowManager::shouldBeManaged(const int& window) {
return true;
}
int CWindowManager::getBarHeightForMonitor(const int& mon) {
return (mon == ConfigManager::getInt("bar:monitor") ? (ConfigManager::getInt("bar:enabled") == 1 ? ConfigManager::getInt("bar:height") : ConfigManager::parseError == "" ? 0 : ConfigManager::getInt("bar:height")) : 0);
}
SMonitor* CWindowManager::getMonitorFromCoord(const Vector2D coord) {
for (auto& m : monitors) {
if (VECINRECT(coord, m.vecPosition.x, m.vecPosition.y, m.vecPosition.x + m.vecSize.x, m.vecPosition.y + m.vecSize.y))

View File

@ -167,7 +167,6 @@ private:
void focusOnWorkspace(const int&);
void dispatchQueuedWarp();
CWindow* getMasterForWorkspace(const int&);
int getBarHeightForMonitor(const int&);
void processBarHiding();
};