mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-12 23:25:59 +01:00
parent
be89d6faa9
commit
d2289d8327
5 changed files with 9 additions and 13 deletions
|
@ -239,13 +239,12 @@ bool CWindow::checkInputOnDecos(const eInputType type, const Vector2D& mouseCoor
|
||||||
pid_t CWindow::getPID() {
|
pid_t CWindow::getPID() {
|
||||||
pid_t PID = -1;
|
pid_t PID = -1;
|
||||||
if (!m_bIsX11) {
|
if (!m_bIsX11) {
|
||||||
|
if (!m_uSurface.xdg)
|
||||||
if (!m_bIsMapped)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
wl_client_get_credentials(wl_resource_get_client(m_uSurface.xdg->resource), &PID, nullptr, nullptr);
|
wl_client_get_credentials(wl_resource_get_client(m_uSurface.xdg->resource), &PID, nullptr, nullptr);
|
||||||
} else {
|
} else {
|
||||||
if (!m_bIsMapped)
|
if (!m_uSurface.xwayland)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
PID = m_uSurface.xwayland->pid;
|
PID = m_uSurface.xwayland->pid;
|
||||||
|
|
|
@ -945,7 +945,7 @@ SWorkspaceRule CConfigManager::getWorkspaceRuleFor(CWorkspace* pWorkspace) {
|
||||||
return *IT;
|
return *IT;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow, bool dynamic) {
|
std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow, bool dynamic, bool shadowExec) {
|
||||||
if (!g_pCompositor->windowExists(pWindow))
|
if (!g_pCompositor->windowExists(pWindow))
|
||||||
return std::vector<SWindowRule>();
|
return std::vector<SWindowRule>();
|
||||||
|
|
||||||
|
@ -1093,7 +1093,7 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anyExecFound) // remove exec rules to unclog searches in the future, why have the garbage here.
|
if (anyExecFound && !shadowExec) // remove exec rules to unclog searches in the future, why have the garbage here.
|
||||||
execRequestedRules.erase(std::remove_if(execRequestedRules.begin(), execRequestedRules.end(),
|
execRequestedRules.erase(std::remove_if(execRequestedRules.begin(), execRequestedRules.end(),
|
||||||
[&](const SExecRequestedRule& other) { return std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == other.iPid; }); }));
|
[&](const SExecRequestedRule& other) { return std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == other.iPid; }); }));
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ class CConfigManager {
|
||||||
std::string getBoundMonitorStringForWS(const std::string&);
|
std::string getBoundMonitorStringForWS(const std::string&);
|
||||||
const std::deque<SWorkspaceRule>& getAllWorkspaceRules();
|
const std::deque<SWorkspaceRule>& getAllWorkspaceRules();
|
||||||
|
|
||||||
std::vector<SWindowRule> getMatchingRules(CWindow*, bool dynamic = true);
|
std::vector<SWindowRule> getMatchingRules(CWindow*, bool dynamic = true, bool shadowExec = false);
|
||||||
std::vector<SLayerRule> getMatchingRules(SLayerSurface*);
|
std::vector<SLayerRule> getMatchingRules(SLayerSurface*);
|
||||||
|
|
||||||
std::unordered_map<std::string, SMonitorAdditionalReservedArea> m_mAdditionalReservedAreas;
|
std::unordered_map<std::string, SMonitorAdditionalReservedArea> m_mAdditionalReservedAreas;
|
||||||
|
|
|
@ -808,8 +808,8 @@ void Events::listener_commitWindow(void* owner, void* data) {
|
||||||
if ((maxSize.x > 0 && maxSize.x < predSize.x) || (maxSize.y > 0 && maxSize.y < predSize.y))
|
if ((maxSize.x > 0 && maxSize.x < predSize.x) || (maxSize.y > 0 && maxSize.y < predSize.y))
|
||||||
predSize = {};
|
predSize = {};
|
||||||
|
|
||||||
for (auto& r : g_pConfigManager->getMatchingRules(PWINDOW)) {
|
for (auto& r : g_pConfigManager->getMatchingRules(PWINDOW, true, true)) {
|
||||||
if (r.szRule == "float") {
|
if (r.szRule.starts_with("float")) {
|
||||||
predSize = {};
|
predSize = {};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1124,10 +1124,7 @@ Vector2D CHyprDwindleLayout::predictSizeForNewWindow() {
|
||||||
static auto* const PPRESERVESPLIT = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("dwindle:preserve_split");
|
static auto* const PPRESERVESPLIT = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("dwindle:preserve_split");
|
||||||
static auto* const PFLMULT = (Hyprlang::FLOAT* const*)g_pConfigManager->getConfigValuePtr("dwindle:split_width_multiplier");
|
static auto* const PFLMULT = (Hyprlang::FLOAT* const*)g_pConfigManager->getConfigValuePtr("dwindle:split_width_multiplier");
|
||||||
|
|
||||||
bool splitTop = false;
|
bool splitTop = box.h * **PFLMULT > box.w;
|
||||||
|
|
||||||
if (**PPRESERVESPLIT == 0 && **PSMARTSPLIT == 0)
|
|
||||||
splitTop = box.h * **PFLMULT > box.w;
|
|
||||||
|
|
||||||
const auto SPLITSIDE = !splitTop;
|
const auto SPLITSIDE = !splitTop;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue