From 0c51b36b104febb735fb48cf071df4a545ee8d82 Mon Sep 17 00:00:00 2001 From: Kaley Fischer Date: Wed, 3 Jan 2024 05:50:25 +0100 Subject: [PATCH] update: made it up to date with upstream --- .clang-format-ignore | 1 + .github/actions/setup_base/action.yml | 75 ++ CMakeLists.txt | 3 +- Makefile | 4 + example/hyprland.conf | 2 + flake.lock | 12 +- flake.nix | 27 +- hyprctl/main.cpp | 84 +- hyprpm/CMakeLists.txt | 16 + hyprpm/src/core/DataState.cpp | 215 ++++++ hyprpm/src/core/DataState.hpp | 21 + hyprpm/src/core/Manifest.cpp | 104 +++ hyprpm/src/core/Manifest.hpp | 32 + hyprpm/src/core/Plugin.hpp | 17 + hyprpm/src/core/PluginManager.cpp | 724 ++++++++++++++++++ hyprpm/src/core/PluginManager.hpp | 63 ++ hyprpm/src/helpers/Colors.hpp | 11 + hyprpm/src/main.cpp | 149 ++++ hyprpm/src/meson.build | 10 + hyprpm/src/progress/CProgressBar.cpp | 80 ++ hyprpm/src/progress/CProgressBar.hpp | 17 + meson.build | 1 + nix/default.nix | 27 +- nix/hm-module.nix | 170 +--- nix/module.nix | 92 +-- nix/overlays.nix | 32 +- nix/wlroots.nix | 22 +- props.json | 2 +- scripts/generateVersion.sh | 4 +- src/Compositor.cpp | 137 ++-- src/Compositor.hpp | 11 +- src/SharedDefs.hpp | 14 +- src/Window.cpp | 52 +- src/Window.hpp | 28 +- src/config/ConfigManager.cpp | 235 ++++-- src/config/ConfigManager.hpp | 30 +- src/config/defaultConfig.hpp | 1 + src/debug/CrashReporter.cpp | 38 +- src/debug/HyprCtl.cpp | 72 +- src/debug/HyprCtl.hpp | 3 +- src/debug/HyprNotificationOverlay.hpp | 7 +- src/debug/Log.hpp | 3 +- src/events/Layers.cpp | 2 +- src/events/Popups.cpp | 2 +- src/events/Windows.cpp | 92 ++- src/helpers/AnimatedVariable.hpp | 12 +- src/helpers/MiscFunctions.cpp | 15 +- src/helpers/MiscFunctions.hpp | 1 + src/helpers/Monitor.cpp | 46 +- src/helpers/Monitor.hpp | 5 +- src/helpers/VarList.hpp | 9 + src/helpers/WLClasses.hpp | 7 +- src/helpers/WLSurface.hpp | 6 +- src/helpers/Workspace.cpp | 4 +- src/helpers/XWaylandStubs.hpp | 3 +- src/includes.hpp | 2 +- src/init/initHelpers.cpp | 4 +- src/layout/DwindleLayout.cpp | 45 +- src/layout/IHyprLayout.cpp | 32 +- src/layout/IHyprLayout.hpp | 6 +- src/layout/MasterLayout.cpp | 87 ++- src/macros.hpp | 10 +- src/main.cpp | 16 +- src/managers/AnimationManager.cpp | 2 + src/managers/EventManager.hpp | 1 + src/managers/KeybindManager.cpp | 51 +- src/managers/KeybindManager.hpp | 3 +- src/managers/XWaylandManager.cpp | 14 +- src/managers/input/InputManager.cpp | 106 +-- src/managers/input/InputManager.hpp | 9 +- src/managers/input/Swipe.cpp | 52 +- src/managers/input/Tablets.cpp | 20 +- src/plugins/HookSystem.cpp | 165 ++-- src/plugins/HookSystem.hpp | 40 +- src/protocols/FractionalScale.cpp | 4 +- src/protocols/Screencopy.hpp | 3 +- src/protocols/ToplevelExport.cpp | 12 +- src/render/OpenGL.cpp | 38 +- src/render/OpenGL.hpp | 8 +- src/render/Renderer.cpp | 297 ++++--- src/render/Renderer.hpp | 34 +- src/render/Texture.hpp | 3 +- .../decorations/CHyprBorderDecoration.cpp | 108 +++ .../decorations/CHyprBorderDecoration.hpp | 41 + .../decorations/CHyprDropShadowDecoration.cpp | 19 +- .../decorations/CHyprDropShadowDecoration.hpp | 4 +- .../decorations/CHyprGroupBarDecoration.cpp | 141 +++- .../decorations/CHyprGroupBarDecoration.hpp | 13 +- .../decorations/DecorationPositioner.cpp | 51 +- .../decorations/DecorationPositioner.hpp | 6 +- .../decorations/IHyprWindowDecoration.cpp | 18 +- .../decorations/IHyprWindowDecoration.hpp | 19 +- src/version.h.in | 3 +- .../packagefiles/wlroots-meson-build.patch | 45 ++ subprojects/wlroots.wrap | 7 + 95 files changed, 3230 insertions(+), 1161 deletions(-) create mode 100644 .clang-format-ignore create mode 100644 .github/actions/setup_base/action.yml create mode 100644 hyprpm/CMakeLists.txt create mode 100644 hyprpm/src/core/DataState.cpp create mode 100644 hyprpm/src/core/DataState.hpp create mode 100644 hyprpm/src/core/Manifest.cpp create mode 100644 hyprpm/src/core/Manifest.hpp create mode 100644 hyprpm/src/core/Plugin.hpp create mode 100644 hyprpm/src/core/PluginManager.cpp create mode 100644 hyprpm/src/core/PluginManager.hpp create mode 100644 hyprpm/src/helpers/Colors.hpp create mode 100644 hyprpm/src/main.cpp create mode 100644 hyprpm/src/meson.build create mode 100644 hyprpm/src/progress/CProgressBar.cpp create mode 100644 hyprpm/src/progress/CProgressBar.hpp create mode 100644 src/render/decorations/CHyprBorderDecoration.cpp create mode 100644 src/render/decorations/CHyprBorderDecoration.hpp create mode 100644 subprojects/packagefiles/wlroots-meson-build.patch create mode 100644 subprojects/wlroots.wrap diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..c6bf34ed --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1 @@ +subprojects/**/* diff --git a/.github/actions/setup_base/action.yml b/.github/actions/setup_base/action.yml new file mode 100644 index 00000000..2985ce9a --- /dev/null +++ b/.github/actions/setup_base/action.yml @@ -0,0 +1,75 @@ +name: "Setup base" + +inputs: + INSTALL_XORG_PKGS: + description: 'Install xorg dependencies' + required: false + default: false + +runs: + using: "composite" + steps: + - name: Get required pacman pkgs + shell: bash + run: | + sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf + pacman --noconfirm --noprogressbar -Syyu + pacman --noconfirm --noprogressbar -Sy \ + base-devel \ + cairo \ + clang \ + cmake \ + git \ + glm \ + glslang \ + go \ + jq \ + libc++ \ + libdisplay-info \ + libdrm \ + libepoxy \ + libfontenc \ + libglvnd \ + libinput \ + libliftoff \ + libxcvt \ + libxfont2 \ + libxkbcommon \ + libxkbfile \ + lld \ + meson \ + ninja \ + pango \ + pixman \ + pkgconf \ + scdoc \ + seatd \ + systemd \ + tomlplusplus \ + wayland \ + wayland-protocols \ + xcb-util-errors \ + xcb-util-renderutil \ + xcb-util-wm + + - name: Get Xorg pacman pkgs + shell: bash + if: inputs.INSTALL_XORG_PKGS == 'true' + run: | + pacman --noconfirm --noprogressbar -Sy \ + xorg-fonts-encodings \ + xorg-server-common \ + xorg-setxkbmap \ + xorg-xkbcomp \ + xorg-xwayland + + - name: Checkout Hyprland + uses: actions/checkout@v4 + with: + submodules: recursive + + # Fix an issue with actions/checkout where the checkout repo is not mark as safe + - name: Mark directory as safe for git + shell: bash + run: | + git config --global --add safe.directory /__w/Hyprland/Hyprland diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f52c554..bedb7bbf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,5 +245,6 @@ protocol("staging/tearing-control/tearing-control-v1.xml" "tearing-control-v1" f protocol("unstable/text-input/text-input-unstable-v1.xml" "text-input-unstable-v1" false) protocol("staging/cursor-shape/cursor-shape-v1.xml" "cursor-shape-v1" false) -# hyprctl +# tools add_subdirectory(hyprctl) +add_subdirectory(hyprpm) diff --git a/Makefile b/Makefile index 6213102e..a0b00259 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,11 @@ install: mkdir -p ${PREFIX}/bin cp -f ./build/Hyprland ${PREFIX}/bin cp -f ./build/hyprctl/hyprctl ${PREFIX}/bin + cp -f ./build/hyprpm/hyprpm ${PREFIX}/bin chmod 755 ${PREFIX}/bin/Hyprland chmod 755 ${PREFIX}/bin/hyprctl + chmod 755 ${PREFIX}/bin/hyprpm + ln -s -r ${PREFIX}/bin/Hyprland ${PREFIX}/bin/hyprland if [ ! -f ${PREFIX}/share/wayland-sessions/hyprland.desktop ]; then cp ./example/hyprland.desktop ${PREFIX}/share/wayland-sessions; fi mkdir -p ${PREFIX}/share/hyprland cp ./assets/wall_* ${PREFIX}/share/hyprland @@ -58,6 +61,7 @@ uninstall: rm -f ${PREFIX}/share/wayland-sessions/hyprland.desktop rm -f ${PREFIX}/bin/Hyprland rm -f ${PREFIX}/bin/hyprctl + rm -f ${PREFIX}/bin/hyprpm rm -f ${PREFIX}/lib/libwlroots.so.13032 rm -rf ${PREFIX}/share/hyprland rm -f ${PREFIX}/share/man/man1/Hyprland.1 diff --git a/example/hyprland.conf b/example/hyprland.conf index e6c2a641..62b6e6e5 100644 --- a/example/hyprland.conf +++ b/example/hyprland.conf @@ -23,8 +23,10 @@ monitor=,preferred,auto,auto $terminal = kitty $fileManager = dolphin $menu = wofi --show drun + # Some default env vars. env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { diff --git a/flake.lock b/flake.lock index a7743fd0..f7761728 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1700612854, - "narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", + "lastModified": 1703438236, + "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", + "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", "type": "github" }, "original": { @@ -95,11 +95,11 @@ ] }, "locked": { - "lastModified": 1700508250, - "narHash": "sha256-X4o/mifI7Nhu0UKYlxx53wIC+gYDo3pVM9L2u3PE2bE=", + "lastModified": 1703514399, + "narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "eb120ff25265ecacd0fc13d7dab12131b60d0f47", + "rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a6d723f2..6807c0f3 100644 --- a/flake.nix +++ b/flake.nix @@ -62,12 +62,16 @@ inherit (pkgsFor.${system}) # hyprland-packages + hyprland hyprland-unwrapped hyprland-debug + hyprland-legacy-renderer # hyprland-extras + xdg-desktop-portal-hyprland # dependencies + hyprland-protocols wlroots-hyprland udis86 @@ -75,17 +79,18 @@ }); devShells = eachSystem (system: { - default = pkgsFor.${system}.mkShell.override { - stdenv = pkgsFor.${system}.gcc13Stdenv; - } { - name = "hyprland-shell"; - nativeBuildInputs = with pkgsFor.${system}; [cmake python3]; - buildInputs = [self.packages.${system}.wlroots-hyprland]; - inputsFrom = [ - self.packages.${system}.wlroots-hyprland - self.packages.${system}.hyprland - ]; - }; + default = + pkgsFor.${system}.mkShell.override { + stdenv = pkgsFor.${system}.gcc13Stdenv; + } { + name = "hyprland-shell"; + nativeBuildInputs = with pkgsFor.${system}; [cmake python3]; + buildInputs = [self.packages.${system}.wlroots-hyprland]; + inputsFrom = [ + self.packages.${system}.wlroots-hyprland + self.packages.${system}.hyprland + ]; + }; }); formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.alejandra); diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index a53c4c3f..f11cac6e 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -23,39 +23,49 @@ #include #include -const std::string USAGE = R"#(usage: hyprctl [(opt)flags] [command] [(opt)args] - -commands: - activewindow - activeworkspace - binds - clients - cursorpos - devices - dispatch - getoption - globalshortcuts - hyprpaper - instances - keyword - kill - layers - layouts - monitors - notify - plugin - reload - setcursor - seterror - setprop - splash - switchxkblayout - version - workspacerules - workspaces - -flags: +const std::string USAGE = R"#(usage: hyprctl [flags] [ [args]] + hyprctl --batch { [args] ; [args] ; ...} +LISTING COMMANDS: + monitors: List outputs + workspaces: List all workspaces + activeworkspace: Get currently active workspace + clients: List clients (e.g. windows) + activewindow: Get currently active window + layers: List layers + animations: List animations and bezier curves in use + devices: List devices + binds: List registered binds + instances: List running Hyprland instances + layouts: List layouts + globalshortcuts: List global shortcuts + version: Print hyprland version +CONFIGURATION COMMANDS: + keyword [args]: Execute a keyword + getoption