fixup: fix compile against hyprland after hyprland#6776

Fixes #133
This commit is contained in:
outfoxxed 2024-07-13 22:58:01 -07:00
parent 4f06a1286a
commit a19f3b5e06
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 16 additions and 20 deletions

11
flake.lock generated
View file

@ -40,16 +40,17 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1719317162, "lastModified": 1720896272,
"narHash": "sha256-JmfnYz+9a4TjNl3mAus1VpoWtTI9d1xkW9MHbkcV0Po=", "narHash": "sha256-zo1lDMsxjEyko/P+KfCLNYZrCAWQOrX90/J31nqzpy4=",
"rev": "918d8340afd652b011b937d29d5eea0be08467f5", "ref": "refs/heads/main",
"revCount": 4886, "rev": "bc6b0880dda2607a80f000c134f573c970452a0f",
"revCount": 4925,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
}, },
"original": { "original": {
"rev": "918d8340afd652b011b937d29d5eea0be08467f5", "rev": "bc6b0880dda2607a80f000c134f573c970452a0f",
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"

View file

@ -1,6 +1,6 @@
{ {
inputs = { inputs = {
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&rev=918d8340afd652b011b937d29d5eea0be08467f5"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&rev=bc6b0880dda2607a80f000c134f573c970452a0f";
}; };
outputs = { self, hyprland, ... }: let outputs = { self, hyprland, ... }: let

View file

@ -12,6 +12,7 @@
#include "Hy3Node.hpp" #include "Hy3Node.hpp"
#include "SelectionHook.hpp" #include "SelectionHook.hpp"
#include "globals.hpp" #include "globals.hpp"
#include "src/desktop/Window.hpp"
SP<HOOK_CALLBACK_FN> renderHookPtr; SP<HOOK_CALLBACK_FN> renderHookPtr;
SP<HOOK_CALLBACK_FN> windowTitleHookPtr; SP<HOOK_CALLBACK_FN> windowTitleHookPtr;
@ -300,9 +301,7 @@ void Hy3Layout::onWindowRemovedTiling(PHLWINDOW window) {
(uintptr_t) node->parent (uintptr_t) node->parent
); );
window->m_sSpecialRenderData.rounding = true; window->unsetWindowData(PRIORITY_LAYOUT);
window->m_sSpecialRenderData.border = true;
window->m_sSpecialRenderData.decorate = true;
if (window->m_bIsFullscreen) { if (window->m_bIsFullscreen) {
g_pCompositor->setWindowFullscreen(window, false, FULLSCREEN_FULL); g_pCompositor->setWindowFullscreen(window, false, FULLSCREEN_FULL);
@ -521,9 +520,7 @@ void Hy3Layout::fullscreenRequestForWindow(
window->m_vRealPosition = window->m_vLastFloatingPosition; window->m_vRealPosition = window->m_vLastFloatingPosition;
window->m_vRealSize = window->m_vLastFloatingSize; window->m_vRealSize = window->m_vLastFloatingSize;
window->m_sSpecialRenderData.rounding = true; window->unsetWindowData(PRIORITY_LAYOUT);
window->m_sSpecialRenderData.border = true;
window->m_sSpecialRenderData.decorate = true;
} }
} else { } else {
window->m_pWorkspace->m_efFullscreenMode = fullscreen_mode; window->m_pWorkspace->m_efFullscreenMode = fullscreen_mode;
@ -638,7 +635,7 @@ PHLWINDOW Hy3Layout::getNextWindowCandidate(PHLWINDOW window) {
for (auto& w: g_pCompositor->m_vWindows | std::views::reverse) { for (auto& w: g_pCompositor->m_vWindows | std::views::reverse) {
if (w->m_bIsMapped && !w->isHidden() && w->m_bIsFloating && w->m_iX11Type != 2 if (w->m_bIsMapped && !w->isHidden() && w->m_bIsFloating && w->m_iX11Type != 2
&& w->m_pWorkspace == window->m_pWorkspace && !w->m_bX11ShouldntFocus && w->m_pWorkspace == window->m_pWorkspace && !w->m_bX11ShouldntFocus
&& !w->m_sAdditionalConfigData.noFocus && w != window) && !w->m_sWindowData.noFocus.valueOrDefault() && w != window)
{ {
return w; return w;
} }
@ -1529,8 +1526,6 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
return; return;
} }
const auto workspace_rule = g_pConfigManager->getWorkspaceRuleFor(node->workspace);
// clang-format off // clang-format off
static const auto gaps_in = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_in"); static const auto gaps_in = ConfigValue<Hyprlang::CUSTOMTYPE, CCssGapData>("general:gaps_in");
static const auto no_gaps_when_only = ConfigValue<Hyprlang::INT>("plugin:hy3:no_gaps_when_only"); static const auto no_gaps_when_only = ConfigValue<Hyprlang::INT>("plugin:hy3:no_gaps_when_only");
@ -1549,7 +1544,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
return; return;
} }
window->updateSpecialRenderData(); window->unsetWindowData(PRIORITY_LAYOUT);
auto nodeBox = CBox(node->position, node->size); auto nodeBox = CBox(node->position, node->size);
nodeBox.round(); nodeBox.round();
@ -1565,10 +1560,10 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|| (window->m_bIsFullscreen && window->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL || (window->m_bIsFullscreen && window->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL
))) )))
{ {
window->m_sSpecialRenderData.border = workspace_rule.border.value_or(*no_gaps_when_only == 2); window->m_sWindowData.decorate = CWindowOverridableVar(true, PRIORITY_LAYOUT); // a little curious but copying what dwindle does
window->m_sWindowData.noBorder = CWindowOverridableVar(*no_gaps_when_only != 2, PRIORITY_LAYOUT);
window->m_sSpecialRenderData.rounding = false; window->m_sWindowData.noRounding = CWindowOverridableVar(true, PRIORITY_LAYOUT);
window->m_sSpecialRenderData.shadow = false; window->m_sWindowData.noShadow = CWindowOverridableVar(true, PRIORITY_LAYOUT);
window->updateWindowDecos(); window->updateWindowDecos();