mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Address PR issues
This commit is contained in:
parent
82f6283a8f
commit
3841f2382f
3 changed files with 30 additions and 56 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,5 +2,3 @@ build/
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
.vscode/
|
.vscode/
|
||||||
*.log
|
*.log
|
||||||
.env
|
|
||||||
.env.*
|
|
|
@ -1,69 +1,44 @@
|
||||||
#ifndef BITFLAG
|
#pragma once
|
||||||
#define BITFLAG
|
|
||||||
|
|
||||||
template <typename FlagType>
|
template <typename FlagType>
|
||||||
struct BitFlag
|
struct BitFlag {
|
||||||
{
|
int m_FlagValue = 0;
|
||||||
int m_FlagValue = 0;
|
|
||||||
|
|
||||||
BitFlag() = default;
|
BitFlag() = default;
|
||||||
|
|
||||||
BitFlag(FlagType flag) {
|
BitFlag(FlagType flag) { m_FlagValue = (int) flag; }
|
||||||
m_FlagValue = (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator FlagType() const {
|
operator FlagType() const { return static_cast<FlagType>(m_FlagValue); }
|
||||||
return static_cast<FlagType>(m_FlagValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set(FlagType flag) {
|
void Set(FlagType flag) { m_FlagValue |= (int) flag; }
|
||||||
m_FlagValue |= (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Unset(FlagType flag) {
|
void Unset(FlagType flag) { m_FlagValue &= ~(int) flag; }
|
||||||
m_FlagValue &= ~(int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Toggle(FlagType flag) {
|
void Toggle(FlagType flag) { m_FlagValue ^= (int) flag; }
|
||||||
m_FlagValue ^= (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Mask(FlagType flag) {
|
void Mask(FlagType flag) { m_FlagValue &= (int) flag; }
|
||||||
m_FlagValue &= (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Has(FlagType flag) const {
|
bool Has(FlagType flag) const { return (m_FlagValue & (int) flag) == (int) flag; }
|
||||||
return (m_FlagValue & (int)flag) == (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasAny(FlagType flag) const {
|
bool HasAny(FlagType flag) const { return (m_FlagValue & (int) flag) != 0; }
|
||||||
return (m_FlagValue & (int)flag) != 0;
|
bool HasNot(FlagType flag) const { return (m_FlagValue & (int) flag) != (int) flag; }
|
||||||
}
|
|
||||||
bool HasNot(FlagType flag) const {
|
|
||||||
return (m_FlagValue & (int)flag) != (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
const BitFlag& operator |=(FlagType flag) {
|
const BitFlag& operator|=(FlagType flag) {
|
||||||
Set(flag);
|
Set(flag);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BitFlag& operator &=(FlagType flag) {
|
const BitFlag& operator&=(FlagType flag) {
|
||||||
Mask(flag);
|
Mask(flag);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BitFlag& operator ^=(FlagType flag) {
|
const BitFlag& operator^=(FlagType flag) {
|
||||||
Toggle(flag);
|
Toggle(flag);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(FlagType flag) const {
|
bool operator==(FlagType flag) const { return m_FlagValue == (int) flag; }
|
||||||
return m_FlagValue == (int)flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(FlagType flag) const {
|
bool operator!=(FlagType flag) const { return m_FlagValue != (int) flag; }
|
||||||
return m_FlagValue != (int)flag;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
#endif
|
|
|
@ -506,7 +506,7 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
|
||||||
g_pXWaylandManager->setWindowSize(window, required_size);
|
g_pXWaylandManager->setWindowSize(window, required_size);
|
||||||
} else if (auto* node = this->getNodeFromWindow(window);node != nullptr) {
|
} else if (auto* node = this->getNodeFromWindow(window);node != nullptr) {
|
||||||
executeResizeOperation(delta, corner, &node->getExpandActor(), g_pCompositor->getMonitorFromID(window->m_iMonitorID));
|
executeResizeOperation(delta, corner, &node->getExpandActor(), g_pCompositor->getMonitorFromID(window->m_iMonitorID));
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::fullscreenRequestForWindow(
|
void Hy3Layout::fullscreenRequestForWindow(
|
||||||
|
@ -2056,8 +2056,9 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
|
||||||
auto& group_data = target_group->data.as_group;
|
auto& group_data = target_group->data.as_group;
|
||||||
|
|
||||||
if (group_data.children.empty()) {
|
if (group_data.children.empty()) {
|
||||||
|
// in theory this would never happen
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} // in theory this would never happen
|
}
|
||||||
|
|
||||||
bool shift_after = false;
|
bool shift_after = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue