mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Fix logging
Fix breakage due to logging changes Improve existing logging
This commit is contained in:
parent
4bc6e306c6
commit
1376a4f3d0
8 changed files with 101 additions and 101 deletions
18
flake.lock
generated
18
flake.lock
generated
|
@ -9,11 +9,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693851147,
|
"lastModified": 1694074808,
|
||||||
"narHash": "sha256-kkI7FXwKufOmNIIQQHr868tneIV8ggqupBA0EJ/jAuI=",
|
"narHash": "sha256-gFHAGWaGh5ZM144wPSYJ6EXam3xmyS2wLwjLhjd7OKU=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "4ddcda93f5887792a953332bf1b487e4b2c3b4ed",
|
"rev": "0be6b03ee972fcc4921984f3b68469a2ee121511",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -49,11 +49,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693158576,
|
"lastModified": 1693844670,
|
||||||
"narHash": "sha256-aRTTXkYvhXosGx535iAFUaoFboUrZSYb1Ooih/auGp0=",
|
"narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a999c1cc0c9eb2095729d5aa03e0d8f7ed256780",
|
"rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -118,11 +118,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691841170,
|
"lastModified": 1694025408,
|
||||||
"narHash": "sha256-RCTm1/MVWYPnReMgyp7tr2ogGYo/pvw38jZaFwemgPU=",
|
"narHash": "sha256-oJNhGfZH8Z2w3ztXdzsYVg32//cWEcPVDM3+tp/ZVfU=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "xdg-desktop-portal-hyprland",
|
"repo": "xdg-desktop-portal-hyprland",
|
||||||
"rev": "57a3a41ba6b358109e4fc25c6a4706b5f7d93c6b",
|
"rev": "022469529c8bc95acf222dc5a62389b04c8b1205",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -7,8 +7,10 @@
|
||||||
inherit (hyprland.inputs) nixpkgs;
|
inherit (hyprland.inputs) nixpkgs;
|
||||||
hyprlandSystems = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
|
hyprlandSystems = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
|
||||||
in {
|
in {
|
||||||
packages = hyprlandSystems (system: pkgs: rec {
|
packages = hyprlandSystems (system: pkgs: let
|
||||||
hy3 = pkgs.stdenv.mkDerivation {
|
hyprlandPackage = hyprland.packages.${system}.hyprland;
|
||||||
|
in rec {
|
||||||
|
hy3 = hyprlandPackage.stdenv.mkDerivation {
|
||||||
pname = "hy3";
|
pname = "hy3";
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
@ -16,10 +18,10 @@
|
||||||
nativeBuildInputs = with pkgs; [ cmake pkg-config ];
|
nativeBuildInputs = with pkgs; [ cmake pkg-config ];
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
hyprland.packages.${system}.hyprland.dev
|
hyprlandPackage.dev
|
||||||
pango
|
pango
|
||||||
cairo
|
cairo
|
||||||
] ++ hyprland.packages.${system}.hyprland.buildInputs;
|
] ++ hyprlandPackage.buildInputs;
|
||||||
|
|
||||||
# no noticeable impact on performance and greatly assists debugging
|
# no noticeable impact on performance and greatly assists debugging
|
||||||
cmakeBuildType = "Debug";
|
cmakeBuildType = "Debug";
|
||||||
|
@ -37,7 +39,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells = hyprlandSystems (system: pkgs: {
|
devShells = hyprlandSystems (system: pkgs: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell.override {
|
||||||
|
stdenv = pkgs.gcc13Stdenv;
|
||||||
|
} {
|
||||||
name = "hy3";
|
name = "hy3";
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
|
|
|
@ -68,16 +68,21 @@ void Hy3Layout::onWindowCreated(CWindow* window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::onWindowCreatedTiling(CWindow* window) {
|
void Hy3Layout::onWindowCreatedTiling(CWindow* window) {
|
||||||
|
hy3_log(
|
||||||
|
TRACE,
|
||||||
|
"onWindowCreatedTiling called with window {:x} (floating: {})",
|
||||||
|
(uintptr_t) window,
|
||||||
|
window->m_bIsFloating
|
||||||
|
);
|
||||||
if (window->m_bIsFloating) return;
|
if (window->m_bIsFloating) return;
|
||||||
|
|
||||||
auto* existing = this->getNodeFromWindow(window);
|
auto* existing = this->getNodeFromWindow(window);
|
||||||
if (existing != nullptr) {
|
if (existing != nullptr) {
|
||||||
Debug::log(
|
hy3_log(
|
||||||
WARN,
|
ERR,
|
||||||
"Attempted to add a window(%p) that is already tiled(as %p) to the "
|
"onWindowCreatedTiling called with a window ({:x}) that is already tiled (node: {:x})",
|
||||||
"layout",
|
(uintptr_t) window,
|
||||||
window,
|
(uintptr_t) existing
|
||||||
existing
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -136,17 +141,17 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opening_into->data.type != Hy3NodeType::Group) {
|
if (opening_into->data.type != Hy3NodeType::Group) {
|
||||||
Debug::log(ERR, "opening_into node %p was not of type Group", opening_into);
|
hy3_log(ERR, "opening_into node ({:x}) was not a group node", (uintptr_t) opening_into);
|
||||||
errorNotif();
|
errorNotif();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opening_into->workspace_id != window->m_iWorkspaceID) {
|
if (opening_into->workspace_id != window->m_iWorkspaceID) {
|
||||||
Debug::log(
|
hy3_log(
|
||||||
WARN,
|
WARN,
|
||||||
"opening_into node %p has workspace %d which does not match the "
|
"opening_into node ({:x}) is on workspace {} which does not match the new window "
|
||||||
"opening window (workspace %d)",
|
"(workspace {})",
|
||||||
opening_into,
|
(uintptr_t) opening_into,
|
||||||
opening_into->workspace_id,
|
opening_into->workspace_id,
|
||||||
window->m_iWorkspaceID
|
window->m_iWorkspaceID
|
||||||
);
|
);
|
||||||
|
@ -198,24 +203,17 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window) {
|
||||||
children.insert(iter2, &node);
|
children.insert(iter2, &node);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug::log(
|
hy3_log(
|
||||||
LOG,
|
LOG,
|
||||||
"opened new window %p(node: %p) on window %p in %p",
|
"tiled window ({:x} as node {:x}) after node {:x} in node {:x}",
|
||||||
window,
|
(uintptr_t) window,
|
||||||
&node,
|
(uintptr_t) &node,
|
||||||
opening_after,
|
(uintptr_t) opening_after,
|
||||||
opening_into
|
(uintptr_t) opening_into
|
||||||
);
|
);
|
||||||
|
|
||||||
node.markFocused();
|
node.markFocused();
|
||||||
opening_into->recalcSizePosRecursive();
|
opening_into->recalcSizePosRecursive();
|
||||||
Debug::log(
|
|
||||||
LOG,
|
|
||||||
"opening_into (%p) contains new child (%p)? %d",
|
|
||||||
opening_into,
|
|
||||||
&node,
|
|
||||||
opening_into->data.as_group.hasChild(&node)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
||||||
|
@ -223,12 +221,16 @@ void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:node_collapse_policy")->intValue;
|
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:node_collapse_policy")->intValue;
|
||||||
|
|
||||||
auto* node = this->getNodeFromWindow(window);
|
auto* node = this->getNodeFromWindow(window);
|
||||||
Debug::log(LOG, "remove tiling %p (window %p)", node, window);
|
|
||||||
|
|
||||||
if (node == nullptr) {
|
if (node == nullptr) return;
|
||||||
Debug::log(ERR, "onWindowRemovedTiling node null?");
|
|
||||||
return;
|
hy3_log(
|
||||||
}
|
LOG,
|
||||||
|
"removing window ({:x} as node {:x}) from node {:x}",
|
||||||
|
(uintptr_t) window,
|
||||||
|
(uintptr_t) node,
|
||||||
|
(uintptr_t) node->parent
|
||||||
|
);
|
||||||
|
|
||||||
window->m_sSpecialRenderData.rounding = true;
|
window->m_sSpecialRenderData.rounding = true;
|
||||||
window->m_sSpecialRenderData.border = true;
|
window->m_sSpecialRenderData.border = true;
|
||||||
|
@ -271,10 +273,16 @@ void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::onWindowFocusChange(CWindow* window) {
|
void Hy3Layout::onWindowFocusChange(CWindow* window) {
|
||||||
Debug::log(LOG, "Switched windows to %p", window);
|
|
||||||
auto* node = this->getNodeFromWindow(window);
|
auto* node = this->getNodeFromWindow(window);
|
||||||
if (node == nullptr) return;
|
if (node == nullptr) return;
|
||||||
|
|
||||||
|
hy3_log(
|
||||||
|
TRACE,
|
||||||
|
"changing window focus to window {:x} as node {:x}",
|
||||||
|
(uintptr_t) window,
|
||||||
|
(uintptr_t) node
|
||||||
|
);
|
||||||
|
|
||||||
node->markFocused();
|
node->markFocused();
|
||||||
while (node->parent != nullptr) node = node->parent;
|
while (node->parent != nullptr) node = node->parent;
|
||||||
node->recalcSizePosRecursive();
|
node->recalcSizePosRecursive();
|
||||||
|
@ -285,7 +293,7 @@ bool Hy3Layout::isWindowTiled(CWindow* window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::recalculateMonitor(const int& monitor_id) {
|
void Hy3Layout::recalculateMonitor(const int& monitor_id) {
|
||||||
Debug::log(LOG, "Recalculate monitor %d", monitor_id);
|
hy3_log(LOG, "recalculating monitor {}", monitor_id);
|
||||||
const auto monitor = g_pCompositor->getMonitorFromID(monitor_id);
|
const auto monitor = g_pCompositor->getMonitorFromID(monitor_id);
|
||||||
if (monitor == nullptr) return;
|
if (monitor == nullptr) return;
|
||||||
|
|
||||||
|
@ -322,7 +330,6 @@ void Hy3Layout::recalculateMonitor(const int& monitor_id) {
|
||||||
int outer_gaps = -(*gaps_in - *gaps_out);
|
int outer_gaps = -(*gaps_in - *gaps_out);
|
||||||
auto gap_topleft_offset = Vector2D(outer_gaps, outer_gaps);
|
auto gap_topleft_offset = Vector2D(outer_gaps, outer_gaps);
|
||||||
auto gap_bottomright_offset = Vector2D(outer_gaps, outer_gaps);
|
auto gap_bottomright_offset = Vector2D(outer_gaps, outer_gaps);
|
||||||
Debug::log(LOG, "FS gaps: %d", outer_gaps);
|
|
||||||
|
|
||||||
Hy3Node fakeNode = {
|
Hy3Node fakeNode = {
|
||||||
.data = window,
|
.data = window,
|
||||||
|
@ -465,8 +472,6 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
|
||||||
outer_node = outer_node->parent;
|
outer_node = outer_node->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug::log(LOG, "resizeActive - inner_node: %p, outer_node: %p", inner_node, outer_node);
|
|
||||||
|
|
||||||
auto& inner_group = inner_parent->data.as_group;
|
auto& inner_group = inner_parent->data.as_group;
|
||||||
// adjust the inner node
|
// adjust the inner node
|
||||||
switch (inner_group.layout) {
|
switch (inner_group.layout) {
|
||||||
|
@ -610,11 +615,9 @@ void Hy3Layout::fullscreenRequestForWindow(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullscreen_mode == FULLSCREEN_FULL) {
|
if (fullscreen_mode == FULLSCREEN_FULL) {
|
||||||
Debug::log(LOG, "fullscreen");
|
|
||||||
window->m_vRealPosition = monitor->vecPosition;
|
window->m_vRealPosition = monitor->vecPosition;
|
||||||
window->m_vRealSize = monitor->vecSize;
|
window->m_vRealSize = monitor->vecSize;
|
||||||
} else {
|
} else {
|
||||||
Debug::log(LOG, "vaxry hack");
|
|
||||||
// Copy of vaxry's massive hack
|
// Copy of vaxry's massive hack
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -625,7 +628,6 @@ void Hy3Layout::fullscreenRequestForWindow(
|
||||||
int outer_gaps = -(*gaps_in - *gaps_out);
|
int outer_gaps = -(*gaps_in - *gaps_out);
|
||||||
auto gap_pos_offset = Vector2D(outer_gaps, outer_gaps);
|
auto gap_pos_offset = Vector2D(outer_gaps, outer_gaps);
|
||||||
auto gap_size_offset = Vector2D(outer_gaps * 2, outer_gaps * 2);
|
auto gap_size_offset = Vector2D(outer_gaps * 2, outer_gaps * 2);
|
||||||
Debug::log(LOG, "FS gaps: %d", outer_gaps);
|
|
||||||
|
|
||||||
Hy3Node fakeNode = {
|
Hy3Node fakeNode = {
|
||||||
.data = window,
|
.data = window,
|
||||||
|
@ -908,7 +910,6 @@ void Hy3Layout::shiftNode(Hy3Node& node, ShiftDirection direction, bool once, bo
|
||||||
|
|
||||||
void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once, bool visible) {
|
void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once, bool visible) {
|
||||||
auto* node = this->getWorkspaceFocusedNode(workspace);
|
auto* node = this->getWorkspaceFocusedNode(workspace);
|
||||||
Debug::log(LOG, "ShiftWindow %p %d", node, direction);
|
|
||||||
if (node == nullptr) return;
|
if (node == nullptr) return;
|
||||||
|
|
||||||
this->shiftNode(*node, direction, once, visible);
|
this->shiftNode(*node, direction, once, visible);
|
||||||
|
@ -916,7 +917,6 @@ void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once,
|
||||||
|
|
||||||
void Hy3Layout::shiftFocus(int workspace, ShiftDirection direction, bool visible) {
|
void Hy3Layout::shiftFocus(int workspace, ShiftDirection direction, bool visible) {
|
||||||
auto* node = this->getWorkspaceFocusedNode(workspace);
|
auto* node = this->getWorkspaceFocusedNode(workspace);
|
||||||
Debug::log(LOG, "ShiftFocus %p %d", node, direction);
|
|
||||||
if (node == nullptr) return;
|
if (node == nullptr) return;
|
||||||
|
|
||||||
Hy3Node* target;
|
Hy3Node* target;
|
||||||
|
@ -1389,7 +1389,11 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitor == nullptr) {
|
if (monitor == nullptr) {
|
||||||
Debug::log(ERR, "Orphaned Node %x (workspace ID: %i)!!", node, node->workspace_id);
|
hy3_log(
|
||||||
|
ERR,
|
||||||
|
"node {:x}'s workspace has no associated monitor, cannot apply node data",
|
||||||
|
(uintptr_t) node
|
||||||
|
);
|
||||||
errorNotif();
|
errorNotif();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1401,7 +1405,13 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
if (!g_pCompositor->windowExists(window) || !window->m_bIsMapped) {
|
if (!g_pCompositor->windowExists(window) || !window->m_bIsMapped) {
|
||||||
Debug::log(ERR, "Node %p holding invalid window %p!!", node, window);
|
hy3_log(
|
||||||
|
ERR,
|
||||||
|
"node {:x} is an unmapped window ({:x}), cannot apply node data, removing from tiled "
|
||||||
|
"layout",
|
||||||
|
(uintptr_t) node,
|
||||||
|
(uintptr_t) window
|
||||||
|
);
|
||||||
errorNotif();
|
errorNotif();
|
||||||
this->onWindowRemovedTiling(window);
|
this->onWindowRemovedTiling(window);
|
||||||
return;
|
return;
|
||||||
|
@ -1448,7 +1458,6 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
||||||
|
|
||||||
window->m_vRealPosition = calcPos;
|
window->m_vRealPosition = calcPos;
|
||||||
window->m_vRealSize = calcSize;
|
window->m_vRealSize = calcSize;
|
||||||
Debug::log(LOG, "Set size (%f %f)", calcSize.x, calcSize.y);
|
|
||||||
|
|
||||||
g_pXWaylandManager->setWindowSize(window, calcSize);
|
g_pXWaylandManager->setWindowSize(window, calcSize);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ Hy3GroupData::~Hy3GroupData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Hy3GroupData::hasChild(Hy3Node* node) {
|
bool Hy3GroupData::hasChild(Hy3Node* node) {
|
||||||
Debug::log(LOG, "Searching for child %p of %p", this, node);
|
|
||||||
for (auto child: this->children) {
|
for (auto child: this->children) {
|
||||||
if (child == node) return true;
|
if (child == node) return true;
|
||||||
|
|
||||||
|
@ -88,13 +87,6 @@ Hy3NodeData::Hy3NodeData(Hy3GroupData group): type(Hy3NodeType::Group) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Hy3NodeData::Hy3NodeData(Hy3NodeData&& from): type(from.type) {
|
Hy3NodeData::Hy3NodeData(Hy3NodeData&& from): type(from.type) {
|
||||||
Debug::log(
|
|
||||||
LOG,
|
|
||||||
"Move CTor type matches? %d is group? %d",
|
|
||||||
this->type == from.type,
|
|
||||||
this->type == Hy3NodeType::Group
|
|
||||||
);
|
|
||||||
|
|
||||||
switch (from.type) {
|
switch (from.type) {
|
||||||
case Hy3NodeType::Window: this->as_window = from.as_window; break;
|
case Hy3NodeType::Window: this->as_window = from.as_window; break;
|
||||||
case Hy3NodeType::Group: new (&this->as_group) Hy3GroupData(std::move(from.as_group)); break;
|
case Hy3NodeType::Group: new (&this->as_group) Hy3GroupData(std::move(from.as_group)); break;
|
||||||
|
@ -126,13 +118,6 @@ Hy3NodeData& Hy3NodeData::operator=(Hy3GroupLayout layout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Hy3NodeData& Hy3NodeData::operator=(Hy3NodeData&& from) {
|
Hy3NodeData& Hy3NodeData::operator=(Hy3NodeData&& from) {
|
||||||
Debug::log(
|
|
||||||
LOG,
|
|
||||||
"operator= type matches? %d is group? %d",
|
|
||||||
this->type == from.type,
|
|
||||||
this->type == Hy3NodeType::Group
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->type == Hy3NodeType::Group) {
|
if (this->type == Hy3NodeType::Group) {
|
||||||
this->as_group.~Hy3GroupData();
|
this->as_group.~Hy3GroupData();
|
||||||
}
|
}
|
||||||
|
@ -235,15 +220,6 @@ Hy3Node* Hy3Node::getFocusedNode(bool ignore_group_focus, bool stop_at_expanded)
|
||||||
switch (this->data.type) {
|
switch (this->data.type) {
|
||||||
case Hy3NodeType::Window: return this;
|
case Hy3NodeType::Window: return this;
|
||||||
case Hy3NodeType::Group:
|
case Hy3NodeType::Group:
|
||||||
Debug::log(
|
|
||||||
LOG,
|
|
||||||
"focusing %p, gf: %d, ef: %d (stop: %d)",
|
|
||||||
this,
|
|
||||||
this->data.as_group.group_focused,
|
|
||||||
this->data.as_group.expand_focused,
|
|
||||||
stop_at_expanded
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this->data.as_group.focused_child == nullptr
|
if (this->data.as_group.focused_child == nullptr
|
||||||
|| (!ignore_group_focus && this->data.as_group.group_focused)
|
|| (!ignore_group_focus && this->data.as_group.group_focused)
|
||||||
|| (stop_at_expanded && this->data.as_group.expand_focused != ExpandFocusType::NotExpanded))
|
|| (stop_at_expanded && this->data.as_group.expand_focused != ExpandFocusType::NotExpanded))
|
||||||
|
@ -360,7 +336,12 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expanded_node == nullptr) {
|
if (expanded_node == nullptr) {
|
||||||
Debug::log(ERR, "indiect expand target is missing");
|
hy3_log(
|
||||||
|
ERR,
|
||||||
|
"recalcSizePosRecursive: unable to find expansion target of latch node {:x}",
|
||||||
|
(uintptr_t) this
|
||||||
|
);
|
||||||
|
errorNotif();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,7 +654,7 @@ std::string Hy3Node::debugNode() {
|
||||||
Hy3Node* Hy3Node::removeFromParentRecursive(Hy3Node** expand_actor) {
|
Hy3Node* Hy3Node::removeFromParentRecursive(Hy3Node** expand_actor) {
|
||||||
Hy3Node* parent = this;
|
Hy3Node* parent = this;
|
||||||
|
|
||||||
Debug::log(LOG, "Recursively removing parent nodes of %p", parent);
|
hy3_log(TRACE, "removing parent nodes of {:x} recursively", (uintptr_t) parent);
|
||||||
|
|
||||||
if (this->parent != nullptr) {
|
if (this->parent != nullptr) {
|
||||||
auto& actor = this->getExpandActor();
|
auto& actor = this->getExpandActor();
|
||||||
|
@ -685,14 +666,7 @@ Hy3Node* Hy3Node::removeFromParentRecursive(Hy3Node** expand_actor) {
|
||||||
|
|
||||||
while (parent != nullptr) {
|
while (parent != nullptr) {
|
||||||
if (parent->parent == nullptr) {
|
if (parent->parent == nullptr) {
|
||||||
Debug::log(ERR, "* UAF DEBUGGING - %p's parent is null, its the root group", parent);
|
if (parent != this) parent->layout->nodes.remove(*parent);
|
||||||
|
|
||||||
if (parent == this) {
|
|
||||||
Debug::log(ERR, "* UAF DEBUGGING - returning nullptr as this == root group");
|
|
||||||
} else {
|
|
||||||
Debug::log(ERR, "* UAF DEBUGGING - deallocing %p and returning nullptr", parent);
|
|
||||||
parent->layout->nodes.remove(*parent);
|
|
||||||
}
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,12 +686,12 @@ Hy3Node* Hy3Node::removeFromParentRecursive(Hy3Node** expand_actor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group.children.remove(child)) {
|
if (!group.children.remove(child)) {
|
||||||
Debug::log(
|
hy3_log(
|
||||||
ERR,
|
ERR,
|
||||||
"Was unable to remove child node %p from parent %p. Child likely has "
|
"unable to remove child node {:x} from parent node {:x}, child's parent pointer is "
|
||||||
"a false parent pointer.",
|
"likely dangling",
|
||||||
child,
|
(uintptr_t) child,
|
||||||
parent
|
(uintptr_t) parent
|
||||||
);
|
);
|
||||||
|
|
||||||
errorNotif();
|
errorNotif();
|
||||||
|
@ -789,7 +763,8 @@ bool Hy3Node::swallowGroups(Hy3Node* into) {
|
||||||
// group is wrong.
|
// group is wrong.
|
||||||
if (into->parent == nullptr && child->data.type != Hy3NodeType::Group) return false;
|
if (into->parent == nullptr && child->data.type != Hy3NodeType::Group) return false;
|
||||||
|
|
||||||
Debug::log(LOG, "Swallowing %p into %p", child, into);
|
hy3_log(TRACE, "swallowing node {:x} into node {:x}", (uintptr_t) child, (uintptr_t) into);
|
||||||
|
|
||||||
Hy3Node::swapData(*into, *child);
|
Hy3Node::swapData(*into, *child);
|
||||||
into->layout->nodes.remove(*child);
|
into->layout->nodes.remove(*child);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ inline CFunctionHook* g_LastSelectionHook = nullptr;
|
||||||
|
|
||||||
void hook_updateDecos(void* thisptr, CWindow* window) {
|
void hook_updateDecos(void* thisptr, CWindow* window) {
|
||||||
bool explicitly_selected = g_Hy3Layout->shouldRenderSelected(window);
|
bool explicitly_selected = g_Hy3Layout->shouldRenderSelected(window);
|
||||||
Debug::log(LOG, "update decos for %p - selected: %d", window, explicitly_selected);
|
|
||||||
|
|
||||||
auto* lastWindow = g_pCompositor->m_pLastWindow;
|
auto* lastWindow = g_pCompositor->m_pLastWindow;
|
||||||
if (explicitly_selected) {
|
if (explicitly_selected) {
|
||||||
|
@ -28,12 +27,14 @@ void init() {
|
||||||
|
|
||||||
if (decoUpdateCandidates.size() != 1) {
|
if (decoUpdateCandidates.size() != 1) {
|
||||||
g_LastSelectionHook = nullptr;
|
g_LastSelectionHook = nullptr;
|
||||||
Debug::log(
|
|
||||||
|
hy3_log(
|
||||||
ERR,
|
ERR,
|
||||||
"Expected one matching function to hook for "
|
"expected one matching function to hook for"
|
||||||
"\"updateWindowAnimatedDecorationValues\", found %d",
|
"\"updateWindowAnimatedDecorationValues\", found {}",
|
||||||
decoUpdateCandidates.size()
|
decoUpdateCandidates.size()
|
||||||
);
|
);
|
||||||
|
|
||||||
HyprlandAPI::addNotificationV2(
|
HyprlandAPI::addNotificationV2(
|
||||||
PHANDLE,
|
PHANDLE,
|
||||||
{
|
{
|
||||||
|
|
|
@ -449,7 +449,6 @@ Hy3TabGroup::Hy3TabGroup(Hy3Node& node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
|
void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
|
||||||
Debug::log(LOG, "updated tab bar for %p", &node);
|
|
||||||
static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
|
static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
|
||||||
static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
|
static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
|
||||||
static const auto* bar_height
|
static const auto* bar_height
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "Hy3Layout.hpp"
|
#include "Hy3Layout.hpp"
|
||||||
|
#include "log.hpp"
|
||||||
|
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
|
||||||
inline HANDLE PHANDLE = nullptr;
|
inline HANDLE PHANDLE = nullptr;
|
||||||
|
|
8
src/log.hpp
Normal file
8
src/log.hpp
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hyprland/src/debug/Log.hpp>
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
void hy3_log(LogLevel level, const std::string& fmt, Args&&... args) {
|
||||||
|
Debug::log(level, "[hy3] " + fmt, args...);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue