aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2024-09-18 11:22:07 +0100
committervaxerski <[email protected]>2024-09-18 11:22:12 +0100
commit883d01084c52fdc5da0e6bfff7fd0f5cf0f62352 (patch)
treeea5dceace3b731fe437eecbd87c64947906abfab /src/Compositor.cpp
parent0564b46a5e9afbf2fb51a7198452342e43ba4637 (diff)
downloadHyprland-883d01084c52fdc5da0e6bfff7fd0f5cf0f62352.tar.gz
Hyprland-883d01084c52fdc5da0e6bfff7fd0f5cf0f62352.zip
userchecks: add an xdg_current_desktop check
ref https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/251 if the XDG_CURRENT_DESKTOP is externally managed (e.g. DE, DM, etc) Hyprland will not overwrite it. In those cases, if that's undesired, portals and other apps depending on it might break.
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 8e1b11b0..232ba4a6 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -2696,7 +2696,17 @@ WORKSPACEID CCompositor::getNewSpecialID() {
}
void CCompositor::performUserChecks() {
- ; // intentional
+ static auto PNOCHECKXDG = CConfigValue<Hyprlang::INT>("misc:disable_xdg_env_checks");
+
+ if (!*PNOCHECKXDG) {
+ const auto CURRENT_DESKTOP_ENV = getenv("XDG_CURRENT_DESKTOP");
+ if (!CURRENT_DESKTOP_ENV || std::string{CURRENT_DESKTOP_ENV} != "Hyprland") {
+ g_pHyprNotificationOverlay->addNotification(
+ std::format("Your XDG_CURRENT_DESKTOP environment seems to be managed externally, and the current value is {}.\nThis might cause issues unless it's intentional.",
+ CURRENT_DESKTOP_ENV ? CURRENT_DESKTOP_ENV : "unset"),
+ CColor{}, 15000, ICON_WARNING);
+ }
+ }
}
void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWorkspace) {