Diff
1diff --git a/flake.nix b/flake.nix
2index 3f70a66f459e7c05395f1d5e41f615378b6f673b..f0b4a932c5ac21d1bde8a3257a5a4e74d38e73af 100644
3--- a/flake.nix
4+++ b/flake.nix
5@@ -9,7 +9,7 @@
6 hyprlandSystems = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
7 in {
8 packages = hyprlandSystems (system: pkgs: rec {
9- hy3 = pkgs.gcc12Stdenv.mkDerivation {
10+ hy3 = pkgs.stdenv.mkDerivation {
11 pname = "hy3";
12 version = "0.1";
13 src = ./.;
14@@ -38,7 +38,7 @@
15 });
16
17 devShells = hyprlandSystems (system: pkgs: {
18- default = pkgs.mkShell.override { stdenv = pkgs.gcc12Stdenv; } {
19+ default = pkgs.mkShell {
20 name = "hy3";
21
22 nativeBuildInputs = with pkgs; [
23diff --git a/src/main.cpp b/src/main.cpp
24index 50d4c829a6703e481e0efac9f0f6a709bc7ba95f..e2cc10afa14bfecb3f9e1eb0b9900eedd3f7c04a 100644
25--- a/src/main.cpp
26+++ b/src/main.cpp
27@@ -29,7 +29,7 @@ int workspace_for_action() {
28
29 int workspace_id = g_pCompositor->m_pLastMonitor->activeWorkspace;
30
31- if (workspace_id < 0) return -1;
32+ if (workspace_id == -1) return -1;
33 auto* workspace = g_pCompositor->getWorkspaceByID(workspace_id);
34 if (workspace == nullptr) return -1;
35 if (workspace->m_bHasFullscreenWindow) return -1;
36@@ -39,7 +39,7 @@ int workspace_for_action() {
37
38 void dispatch_makegroup(std::string arg) {
39 int workspace = workspace_for_action();
40- if (workspace < 0) return;
41+ if (workspace == -1) return;
42
43 if (arg == "h") {
44 g_Hy3Layout->makeGroupOnWorkspace(workspace, Hy3GroupLayout::SplitH);
45@@ -62,7 +62,7 @@ std::optional<ShiftDirection> parseShiftArg(std::string arg) {
46
47 void dispatch_movewindow(std::string value) {
48 int workspace = workspace_for_action();
49- if (workspace < 0) return;
50+ if (workspace == -1) return;
51
52 auto args = CVarList(value);
53
54@@ -74,7 +74,7 @@ void dispatch_movewindow(std::string value) {
55
56 void dispatch_movefocus(std::string arg) {
57 int workspace = workspace_for_action();
58- if (workspace < 0) return;
59+ if (workspace == -1) return;
60
61 if (auto shift = parseShiftArg(arg)) {
62 g_Hy3Layout->shiftFocus(workspace, shift.value());
63@@ -83,17 +83,17 @@ void dispatch_movefocus(std::string arg) {
64
65 void dispatch_raisefocus(std::string arg) {
66 int workspace = workspace_for_action();
67- if (workspace < 0) return;
68+ if (workspace == -1) return;
69
70 g_Hy3Layout->raiseFocus(workspace);
71 }
72
73 void dispatch_debug(std::string arg) {
74 int workspace = workspace_for_action();
75- if (workspace < 0) return;
76+ if (workspace == -1) return;
77
78 auto* root = g_Hy3Layout->getWorkspaceRootGroup(workspace);
79- if (workspace < 0) {
80+ if (workspace == -1) {
81 Debug::log(LOG, "DEBUG NODES: no nodes on workspace");
82 } else {
83 Debug::log(LOG, "DEBUG NODES\n%s", root->debugNode().c_str());