Address PR issues

This commit is contained in:
github-usr-name 2024-02-24 12:32:02 +00:00
parent 82f6283a8f
commit 3841f2382f
3 changed files with 30 additions and 56 deletions

2
.gitignore vendored
View file

@ -2,5 +2,3 @@ build/
compile_commands.json
.vscode/
*.log
.env
.env.*

View file

@ -1,69 +1,44 @@
#ifndef BITFLAG
#define BITFLAG
#pragma once
template <typename FlagType>
struct BitFlag
{
struct BitFlag {
int m_FlagValue = 0;
BitFlag() = default;
BitFlag(FlagType flag) {
m_FlagValue = (int)flag;
}
BitFlag(FlagType flag) { m_FlagValue = (int) flag; }
operator FlagType() const {
return static_cast<FlagType>(m_FlagValue);
}
operator FlagType() const { return static_cast<FlagType>(m_FlagValue); }
void Set(FlagType flag) {
m_FlagValue |= (int)flag;
}
void Set(FlagType flag) { m_FlagValue |= (int) flag; }
void Unset(FlagType flag) {
m_FlagValue &= ~(int)flag;
}
void Unset(FlagType flag) { m_FlagValue &= ~(int) flag; }
void Toggle(FlagType flag) {
m_FlagValue ^= (int)flag;
}
void Toggle(FlagType flag) { m_FlagValue ^= (int) flag; }
void Mask(FlagType flag) {
m_FlagValue &= (int)flag;
}
void Mask(FlagType flag) { m_FlagValue &= (int) flag; }
bool Has(FlagType flag) const {
return (m_FlagValue & (int)flag) == (int)flag;
}
bool Has(FlagType flag) const { return (m_FlagValue & (int) flag) == (int) flag; }
bool HasAny(FlagType flag) const {
return (m_FlagValue & (int)flag) != 0;
}
bool HasNot(FlagType flag) const {
return (m_FlagValue & (int)flag) != (int)flag;
}
bool HasAny(FlagType flag) const { return (m_FlagValue & (int) flag) != 0; }
bool HasNot(FlagType flag) const { return (m_FlagValue & (int) flag) != (int) flag; }
const BitFlag& operator |=(FlagType flag) {
const BitFlag& operator|=(FlagType flag) {
Set(flag);
return *this;
}
const BitFlag& operator &=(FlagType flag) {
const BitFlag& operator&=(FlagType flag) {
Mask(flag);
return *this;
}
const BitFlag& operator ^=(FlagType flag) {
const BitFlag& operator^=(FlagType flag) {
Toggle(flag);
return *this;
}
bool operator==(FlagType flag) const {
return m_FlagValue == (int)flag;
}
bool operator==(FlagType flag) const { return m_FlagValue == (int) flag; }
bool operator!=(FlagType flag) const {
return m_FlagValue != (int)flag;
}
bool operator!=(FlagType flag) const { return m_FlagValue != (int) flag; }
};
#endif

View file

@ -506,7 +506,7 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
g_pXWaylandManager->setWindowSize(window, required_size);
} else if (auto* node = this->getNodeFromWindow(window);node != nullptr) {
executeResizeOperation(delta, corner, &node->getExpandActor(), g_pCompositor->getMonitorFromID(window->m_iMonitorID));
};
}
}
void Hy3Layout::fullscreenRequestForWindow(
@ -2056,8 +2056,9 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
auto& group_data = target_group->data.as_group;
if (group_data.children.empty()) {
// in theory this would never happen
return nullptr;
} // in theory this would never happen
}
bool shift_after = false;