Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyprwm/Hyprland
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dbfbc58d6cd2b3d97e1bdcd443478582b13af791
Choose a base ref
..
head repository: hyprwm/Hyprland
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7d4d545ff38d0601adfefc946827b67a20f5b2b2
Choose a head ref
Showing with 520 additions and 425 deletions.
  1. +0 −23 .github/workflows/ci.yaml
  2. +1 −1 CMakeLists.txt
  3. +49 −39 src/Compositor.cpp
  4. +8 −7 src/Compositor.hpp
  5. +32 −14 src/config/ConfigManager.cpp
  6. +7 −5 src/config/ConfigManager.hpp
  7. +2 −2 src/config/ConfigWatcher.hpp
  8. +1 −1 src/debug/HyprCtl.hpp
  9. +1 −1 src/debug/HyprDebugOverlay.hpp
  10. +1 −1 src/debug/HyprNotificationOverlay.cpp
  11. +9 −9 src/debug/HyprNotificationOverlay.hpp
  12. +1 −1 src/desktop/LayerRule.cpp
  13. +1 −1 src/desktop/LayerSurface.cpp
  14. +1 −1 src/desktop/LayerSurface.hpp
  15. +1 −1 src/desktop/Popup.cpp
  16. +3 −3 src/desktop/Popup.hpp
  17. +3 −2 src/desktop/Rule.cpp
  18. +3 −3 src/desktop/Rule.hpp
  19. +2 −2 src/desktop/Subsurface.cpp
  20. +8 −8 src/desktop/Subsurface.hpp
  21. +2 −1 src/desktop/WLSurface.hpp
  22. +20 −11 src/desktop/Window.cpp
  23. +7 −6 src/desktop/Window.hpp
  24. +1 −1 src/helpers/Monitor.hpp
  25. +1 −1 src/helpers/SdDaemon.cpp
  26. +1 −1 src/helpers/Watchdog.cpp
  27. +3 −3 src/helpers/Watchdog.hpp
  28. +1 −1 src/helpers/memory/Memory.hpp
  29. +1 −1 src/hyprerror/HyprError.hpp
  30. +6 −3 src/layout/IHyprLayout.cpp
  31. +12 −5 src/main.cpp
  32. +2 −1 src/managers/AnimationManager.cpp
  33. +1 −1 src/managers/AnimationManager.hpp
  34. +3 −3 src/managers/CursorManager.cpp
  35. +13 −14 src/managers/CursorManager.hpp
  36. +2 −2 src/managers/DonationNagManager.hpp
  37. +1 −1 src/managers/EventManager.hpp
  38. +1 −1 src/managers/HookSystemManager.hpp
  39. +10 −3 src/managers/KeybindManager.cpp
  40. +1 −1 src/managers/KeybindManager.hpp
  41. +1 −1 src/managers/LayoutManager.hpp
  42. +54 −54 src/managers/ProtocolManager.cpp
  43. +1 −1 src/managers/ProtocolManager.hpp
  44. +1 −1 src/managers/SeatManager.cpp
  45. +2 −2 src/managers/SessionLockManager.cpp
  46. +5 −5 src/managers/SessionLockManager.hpp
  47. +1 −1 src/managers/TokenManager.hpp
  48. +2 −2 src/managers/VersionKeeperManager.hpp
  49. +1 −0 src/managers/XCursorManager.cpp
  50. +1 −1 src/managers/XWaylandManager.cpp
  51. +1 −1 src/managers/XWaylandManager.hpp
  52. +1 −1 src/managers/eventLoop/EventLoopManager.hpp
  53. +1 −1 src/managers/input/IdleInhibitor.cpp
  54. +2 −2 src/managers/input/InputManager.hpp
  55. +3 −3 src/managers/input/InputMethodRelay.cpp
  56. +3 −3 src/managers/input/InputMethodRelay.hpp
  57. +0 −1 src/managers/input/TextInput.hpp
  58. +1 −1 src/pch/pch.hpp
  59. +1 −1 src/plugins/HookSystem.cpp
  60. +4 −4 src/plugins/HookSystem.hpp
  61. +1 −1 src/plugins/PluginAPI.cpp
  62. +1 −1 src/plugins/PluginAPI.hpp
  63. +2 −2 src/plugins/PluginSystem.cpp
  64. +3 −3 src/plugins/PluginSystem.hpp
  65. +3 −4 src/protocols/AlphaModifier.cpp
  66. +0 −1 src/protocols/AlphaModifier.hpp
  67. +1 −1 src/protocols/CTMControl.cpp
  68. +1 −2 src/protocols/CTMControl.hpp
  69. +0 −1 src/protocols/ColorManagement.hpp
  70. +1 −1 src/protocols/CursorShape.cpp
  71. +0 −1 src/protocols/CursorShape.hpp
  72. +0 −1 src/protocols/DRMLease.hpp
  73. +0 −1 src/protocols/DRMSyncobj.hpp
  74. +0 −1 src/protocols/DataDeviceWlr.hpp
  75. +3 −4 src/protocols/FocusGrab.cpp
  76. +1 −1 src/protocols/ForeignToplevel.cpp
  77. +0 −1 src/protocols/ForeignToplevel.hpp
  78. +1 −1 src/protocols/ForeignToplevelWlr.cpp
  79. +0 −1 src/protocols/ForeignToplevelWlr.hpp
  80. +2 −2 src/protocols/FractionalScale.cpp
  81. +0 −1 src/protocols/FractionalScale.hpp
  82. +0 −1 src/protocols/FrogColorManagement.hpp
  83. +2 −2 src/protocols/GammaControl.cpp
  84. +0 −1 src/protocols/GammaControl.hpp
  85. +25 −4 src/protocols/HyprlandSurface.cpp
  86. +4 −2 src/protocols/HyprlandSurface.hpp
  87. +1 −1 src/protocols/IdleInhibit.cpp
  88. +0 −1 src/protocols/IdleInhibit.hpp
  89. +1 −1 src/protocols/IdleNotify.cpp
  90. +0 −1 src/protocols/IdleNotify.hpp
  91. +1 −1 src/protocols/InputMethodV2.cpp
  92. +0 −1 src/protocols/InputMethodV2.hpp
  93. +6 −1 src/protocols/LayerShell.cpp
  94. +0 −1 src/protocols/LayerShell.hpp
  95. +2 −2 src/protocols/LinuxDMABUF.cpp
  96. +0 −1 src/protocols/LinuxDMABUF.hpp
  97. +1 −1 src/protocols/LockNotify.cpp
  98. +0 −1 src/protocols/MesaDRM.hpp
  99. +0 −1 src/protocols/OutputManagement.hpp
  100. +2 −2 src/protocols/OutputPower.cpp
  101. +0 −1 src/protocols/OutputPower.hpp
  102. +1 −1 src/protocols/PointerConstraints.cpp
  103. +0 −1 src/protocols/PointerConstraints.hpp
  104. +4 −4 src/protocols/PointerGestures.cpp
  105. +0 −1 src/protocols/PointerGestures.hpp
  106. +1 −1 src/protocols/PresentationTime.cpp
  107. +0 −1 src/protocols/PresentationTime.hpp
  108. +0 −1 src/protocols/PrimarySelection.hpp
  109. +2 −2 src/protocols/RelativePointer.cpp
  110. +0 −1 src/protocols/RelativePointer.hpp
  111. +0 −1 src/protocols/SecurityContext.hpp
  112. +2 −3 src/protocols/ServerDecorationKDE.cpp
  113. +0 −1 src/protocols/ServerDecorationKDE.hpp
  114. +1 −1 src/protocols/SessionLock.cpp
  115. +0 −1 src/protocols/SessionLock.hpp
  116. +2 −2 src/protocols/ShortcutsInhibit.cpp
  117. +0 −1 src/protocols/ShortcutsInhibit.hpp
  118. +0 −1 src/protocols/SinglePixel.hpp
  119. +1 −1 src/protocols/Tablet.cpp
  120. +0 −1 src/protocols/Tablet.hpp
  121. +2 −2 src/protocols/TearingControl.cpp
  122. +0 −1 src/protocols/TearingControl.hpp
  123. +1 −1 src/protocols/TextInputV3.cpp
  124. +0 −1 src/protocols/TextInputV3.hpp
  125. +0 −1 src/protocols/Viewporter.hpp
  126. +1 −1 src/protocols/VirtualKeyboard.cpp
  127. +0 −1 src/protocols/VirtualKeyboard.hpp
  128. +1 −1 src/protocols/VirtualPointer.cpp
  129. +0 −1 src/protocols/VirtualPointer.hpp
  130. +1 −0 src/protocols/WaylandProtocol.hpp
  131. +2 −2 src/protocols/XDGActivation.cpp
  132. +0 −1 src/protocols/XDGActivation.hpp
  133. +2 −2 src/protocols/XDGDecoration.cpp
  134. +0 −1 src/protocols/XDGDecoration.hpp
  135. +0 −1 src/protocols/XDGDialog.hpp
  136. +2 −2 src/protocols/XDGOutput.cpp
  137. +0 −1 src/protocols/XDGShell.hpp
  138. +0 −1 src/protocols/XWaylandShell.hpp
  139. +0 −1 src/protocols/core/Compositor.hpp
  140. +6 −0 src/protocols/core/DataDevice.cpp
  141. +3 −1 src/protocols/core/DataDevice.hpp
  142. +0 −1 src/protocols/core/Output.hpp
  143. +0 −1 src/protocols/core/Seat.hpp
  144. +0 −1 src/protocols/core/Shm.hpp
  145. +0 −1 src/protocols/core/Subcompositor.hpp
  146. +0 −1 src/protocols/types/WLBuffer.hpp
  147. +27 −7 src/render/OpenGL.cpp
  148. +2 −1 src/render/OpenGL.hpp
  149. +1 −1 src/render/Renderer.hpp
  150. +6 −6 src/render/decorations/CHyprGroupBarDecoration.cpp
  151. +2 −2 src/render/decorations/CHyprGroupBarDecoration.hpp
  152. +1 −1 src/render/decorations/DecorationPositioner.cpp
  153. +7 −7 src/render/decorations/DecorationPositioner.hpp
  154. +2 −2 src/render/pass/RectPassElement.cpp
  155. +50 −0 src/render/pass/SurfacePassElement.cpp
  156. +1 −0 src/render/pass/SurfacePassElement.hpp
  157. +1 −1 src/xwayland/Server.cpp
  158. +1 −1 src/xwayland/XDataSource.cpp
  159. +4 −4 src/xwayland/XWM.cpp
  160. +1 −1 src/xwayland/XWM.hpp
  161. +1 −1 src/xwayland/XWayland.cpp
  162. +3 −4 src/xwayland/XWayland.hpp
  163. +1 −1 subprojects/hyprland-protocols
23 changes: 0 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -127,26 +127,3 @@ jobs:

- name: clang-format check
run: ninja -C build clang-format-check

- name: clang-format apply
if: failure()
run: ninja -C build clang-format

- name: Create patch
if: failure()
run: |
echo 'Please fix the formatting issues by running [`clang-format`](https://wiki.hyprland.org/Contributing-and-Debugging/PR-Guidelines/#code-style), or directly apply this patch:' > clang-format.patch
echo '<details>' >> clang-format.patch
echo '<summary>clang-format.patch</summary>' >> clang-format.patch
echo >> clang-format.patch
echo '```diff' >> clang-format.patch
git diff >> clang-format.patch
echo '```' >> clang-format.patch
echo >> clang-format.patch
echo '</details>' >> clang-format.patch
- name: Comment patch
if: failure()
uses: peter-evans/commit-comment@v3
with:
message-path: clang-format.patch
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION})
pkg_check_modules(aquamarine_dep REQUIRED IMPORTED_TARGET aquamarine>=0.4.5)
pkg_check_modules(hyprlang_dep REQUIRED IMPORTED_TARGET hyprlang>=0.3.2)
pkg_check_modules(hyprcursor_dep REQUIRED IMPORTED_TARGET hyprcursor>=0.1.7)
pkg_check_modules(hyprutils_dep REQUIRED IMPORTED_TARGET hyprutils>=0.3.3)
pkg_check_modules(hyprutils_dep REQUIRED IMPORTED_TARGET hyprutils>=0.4.0)
pkg_check_modules(hyprgraphics_dep REQUIRED IMPORTED_TARGET hyprgraphics>=0.1.1)

add_compile_definitions(AQUAMARINE_VERSION="${aquamarine_dep_VERSION}")
88 changes: 49 additions & 39 deletions src/Compositor.cpp
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
#include <cstring>
#include <filesystem>
#include <ranges>
#include <print>
#include <unordered_set>
#include "debug/HyprCtl.hpp"
#include "debug/CrashReporter.hpp"
@@ -162,7 +163,10 @@ void CCompositor::restoreNofile() {
Debug::log(ERR, "Failed restoring NOFILE limits");
}

CCompositor::CCompositor() : m_iHyprlandPID(getpid()) {
CCompositor::CCompositor(bool onlyConfig) : m_bOnlyConfigVerification(onlyConfig), m_iHyprlandPID(getpid()) {
if (onlyConfig)
return;

m_szHyprTempDataRoot = std::string{getenv("XDG_RUNTIME_DIR")} + "/hypr";

if (m_szHyprTempDataRoot.starts_with("/hypr")) {
@@ -226,7 +230,7 @@ CCompositor::CCompositor() : m_iHyprlandPID(getpid()) {
}

CCompositor::~CCompositor() {
if (!m_bIsShuttingDown)
if (!m_bIsShuttingDown && !m_bOnlyConfigVerification)
cleanup();
}

@@ -262,6 +266,16 @@ static bool filterGlobals(const wl_client* client, const wl_global* global, void
//
void CCompositor::initServer(std::string socketName, int socketFd) {

if (m_bOnlyConfigVerification) {
g_pHookSystem = makeUnique<CHookSystemManager>();
g_pKeybindManager = makeUnique<CKeybindManager>();
g_pAnimationManager = makeUnique<CHyprAnimationManager>();
g_pConfigManager = makeUnique<CConfigManager>();

std::println("\n\n======== Config parsing result:\n\n{}", g_pConfigManager->verify());
return;
}

m_sWLDisplay = wl_display_create();

wl_display_set_global_filter(m_sWLDisplay, ::filterGlobals, nullptr);
@@ -586,92 +600,92 @@ void CCompositor::initManagers(eManagersInitStage stage) {
switch (stage) {
case STAGE_PRIORITY: {
Debug::log(LOG, "Creating the EventLoopManager!");
g_pEventLoopManager = std::make_unique<CEventLoopManager>(m_sWLDisplay, m_sWLEventLoop);
g_pEventLoopManager = makeUnique<CEventLoopManager>(m_sWLDisplay, m_sWLEventLoop);

Debug::log(LOG, "Creating the HookSystem!");
g_pHookSystem = std::make_unique<CHookSystemManager>();
g_pHookSystem = makeUnique<CHookSystemManager>();

Debug::log(LOG, "Creating the KeybindManager!");
g_pKeybindManager = std::make_unique<CKeybindManager>();
g_pKeybindManager = makeUnique<CKeybindManager>();

Debug::log(LOG, "Creating the AnimationManager!");
g_pAnimationManager = std::make_unique<CHyprAnimationManager>();
g_pAnimationManager = makeUnique<CHyprAnimationManager>();

Debug::log(LOG, "Creating the ConfigManager!");
g_pConfigManager = std::make_unique<CConfigManager>();
g_pConfigManager = makeUnique<CConfigManager>();

Debug::log(LOG, "Creating the CHyprError!");
g_pHyprError = std::make_unique<CHyprError>();
g_pHyprError = makeUnique<CHyprError>();

Debug::log(LOG, "Creating the LayoutManager!");
g_pLayoutManager = std::make_unique<CLayoutManager>();
g_pLayoutManager = makeUnique<CLayoutManager>();

Debug::log(LOG, "Creating the TokenManager!");
g_pTokenManager = std::make_unique<CTokenManager>();
g_pTokenManager = makeUnique<CTokenManager>();

g_pConfigManager->init();
g_pWatchdog = std::make_unique<CWatchdog>(); // requires config
g_pWatchdog = makeUnique<CWatchdog>(); // requires config
// wait for watchdog to initialize to not hit data races in reading config values.
while (!g_pWatchdog->m_bWatchdogInitialized) {
std::this_thread::yield();
}

Debug::log(LOG, "Creating the PointerManager!");
g_pPointerManager = std::make_unique<CPointerManager>();
g_pPointerManager = makeUnique<CPointerManager>();

Debug::log(LOG, "Creating the EventManager!");
g_pEventManager = std::make_unique<CEventManager>();
g_pEventManager = makeUnique<CEventManager>();
} break;
case STAGE_BASICINIT: {
Debug::log(LOG, "Creating the CHyprOpenGLImpl!");
g_pHyprOpenGL = std::make_unique<CHyprOpenGLImpl>();
g_pHyprOpenGL = makeUnique<CHyprOpenGLImpl>();

Debug::log(LOG, "Creating the ProtocolManager!");
g_pProtocolManager = std::make_unique<CProtocolManager>();
g_pProtocolManager = makeUnique<CProtocolManager>();

Debug::log(LOG, "Creating the SeatManager!");
g_pSeatManager = std::make_unique<CSeatManager>();
g_pSeatManager = makeUnique<CSeatManager>();
} break;
case STAGE_LATE: {
Debug::log(LOG, "Creating CHyprCtl");
g_pHyprCtl = std::make_unique<CHyprCtl>();
g_pHyprCtl = makeUnique<CHyprCtl>();

Debug::log(LOG, "Creating the InputManager!");
g_pInputManager = std::make_unique<CInputManager>();
g_pInputManager = makeUnique<CInputManager>();

Debug::log(LOG, "Creating the HyprRenderer!");
g_pHyprRenderer = std::make_unique<CHyprRenderer>();
g_pHyprRenderer = makeUnique<CHyprRenderer>();

Debug::log(LOG, "Creating the XWaylandManager!");
g_pXWaylandManager = std::make_unique<CHyprXWaylandManager>();
g_pXWaylandManager = makeUnique<CHyprXWaylandManager>();

Debug::log(LOG, "Creating the SessionLockManager!");
g_pSessionLockManager = std::make_unique<CSessionLockManager>();
g_pSessionLockManager = makeUnique<CSessionLockManager>();

Debug::log(LOG, "Creating the HyprDebugOverlay!");
g_pDebugOverlay = std::make_unique<CHyprDebugOverlay>();
g_pDebugOverlay = makeUnique<CHyprDebugOverlay>();

Debug::log(LOG, "Creating the HyprNotificationOverlay!");
g_pHyprNotificationOverlay = std::make_unique<CHyprNotificationOverlay>();
g_pHyprNotificationOverlay = makeUnique<CHyprNotificationOverlay>();

Debug::log(LOG, "Creating the PluginSystem!");
g_pPluginSystem = std::make_unique<CPluginSystem>();
g_pPluginSystem = makeUnique<CPluginSystem>();
g_pConfigManager->handlePluginLoads();

Debug::log(LOG, "Creating the DecorationPositioner!");
g_pDecorationPositioner = std::make_unique<CDecorationPositioner>();
g_pDecorationPositioner = makeUnique<CDecorationPositioner>();

Debug::log(LOG, "Creating the CursorManager!");
g_pCursorManager = std::make_unique<CCursorManager>();
g_pCursorManager = makeUnique<CCursorManager>();

Debug::log(LOG, "Creating the VersionKeeper!");
g_pVersionKeeperMgr = std::make_unique<CVersionKeeperManager>();
g_pVersionKeeperMgr = makeUnique<CVersionKeeperManager>();

Debug::log(LOG, "Creating the DonationNag!");
g_pDonationNagManager = std::make_unique<CDonationNagManager>();
g_pDonationNagManager = makeUnique<CDonationNagManager>();

Debug::log(LOG, "Starting XWayland");
g_pXWayland = std::make_unique<CXWayland>(g_pCompositor->m_bWantsXwayland);
g_pXWayland = makeUnique<CXWayland>(g_pCompositor->m_bWantsXwayland);
} break;
default: UNREACHABLE();
}
@@ -1155,6 +1169,7 @@ void CCompositor::focusWindow(PHLWINDOW pWindow, SP<CWLSurfaceResource> pSurface
g_pXWaylandManager->activateWindow(pWindow, true); // sets the m_pLastWindow

pWindow->updateDynamicRules();
pWindow->onFocusAnimUpdate();

updateWindowAnimatedDecorationValues(pWindow);

@@ -1851,12 +1866,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
}
}

// tick angle if it's not running (aka dead)
if (!pWindow->m_fBorderAngleAnimationProgress->isBeingAnimated())
pWindow->m_fBorderAngleAnimationProgress->setValueAndWarp(0.f);

// opacity
const auto PWORKSPACE = pWindow->m_pWorkspace;
if (pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN)) {
*pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaFullscreen.valueOrDefault().applyAlpha(*PFULLSCREENALPHA);
} else {
@@ -2508,13 +2518,13 @@ PHLLS CCompositor::getLayerSurfaceFromSurface(SP<CWLSurfaceResource> pSurface) {
continue;

ls->layerSurface->surface->breadthfirst(
[](SP<CWLSurfaceResource> surf, const Vector2D& offset, void* data) {
if (surf == ((std::pair<SP<CWLSurfaceResource>, bool>*)data)->first) {
*(bool*)data = true;
[&result](SP<CWLSurfaceResource> surf, const Vector2D& offset, void* data) {
if (surf == result.first) {
result.second = true;
return;
}
},
&result);
nullptr);

if (result.second)
return ls;
@@ -2701,7 +2711,7 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
g_pLayoutManager->getCurrentLayout()->recalculateWindow(pWindow);

if (!pWindow->getDecorationByType(DECORATION_GROUPBAR))
pWindow->addWindowDeco(std::make_unique<CHyprGroupBarDecoration>(pWindow));
pWindow->addWindowDeco(makeUnique<CHyprGroupBarDecoration>(pWindow));

} else {
if (!pWindow->m_bIsFloating)
15 changes: 8 additions & 7 deletions src/Compositor.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <memory>
#include <list>
#include <sys/resource.h>

@@ -10,6 +9,7 @@
#include "managers/SessionLockManager.hpp"
#include "desktop/Window.hpp"
#include "protocols/types/ColorManagement.hpp"
#include "helpers/memory/Memory.hpp"

#include <aquamarine/backend/Backend.hpp>
#include <aquamarine/output/Output.hpp>
@@ -24,7 +24,7 @@ enum eManagersInitStage : uint8_t {

class CCompositor {
public:
CCompositor();
CCompositor(bool onlyConfig = false);
~CCompositor();

wl_display* m_sWLDisplay;
@@ -71,10 +71,11 @@ class CCompositor {
bool m_bUnsafeState = false; // unsafe state is when there is no monitors.
bool m_bNextIsUnsafe = false;
PHLMONITORREF m_pUnsafeOutput; // fallback output for the unsafe state
bool m_bIsShuttingDown = false;
bool m_bFinalRequests = false;
bool m_bDesktopEnvSet = false;
bool m_bWantsXwayland = true;
bool m_bIsShuttingDown = false;
bool m_bFinalRequests = false;
bool m_bDesktopEnvSet = false;
bool m_bWantsXwayland = true;
bool m_bOnlyConfigVerification = false;

// ------------------------------------------------- //

@@ -170,4 +171,4 @@ class CCompositor {
rlimit m_sOriginalNofile = {0};
};

inline std::unique_ptr<CCompositor> g_pCompositor;
inline UP<CCompositor> g_pCompositor;
Loading