summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-09-17 14:03:49 +0200
committerGitHub <noreply@github.com>2025-09-17 14:03:49 +0200
commit1cb8cd3930e2c8410bbc99baa0a5bea91994bd71 (patch)
treed6bf2df91a6f67a32985ee05a087eaead6b3d530 /src
parent7fd6998f7c858c731bcbcbf255d2946cb0d79a3b (diff)
solitary: fix check for config error (#11733)
Adds a blocker for solitary optimizations if there is a hyprerror present
Diffstat (limited to 'src')
-rw-r--r--src/debug/HyprCtl.cpp11
-rw-r--r--src/helpers/Monitor.cpp11
-rw-r--r--src/helpers/Monitor.hpp7
3 files changed, 19 insertions, 10 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index c742fec0..26cc8d14 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -111,13 +111,14 @@ static std::string availableModesForOutput(PHLMONITOR pMonitor, eHyprCtlOutputFo
}
const std::array<const char*, CMonitor::SC_CHECKS_COUNT> SOLITARY_REASONS_JSON = {
- "\"UNKNOWN\"", "\"NOTIFICATION\"", "\"LOCK\"", "\"WORKSPACE\"", "\"WINDOWED\"", "\"DND\"", "\"SPECIAL\"", "\"ALPHA\"",
- "\"OFFSET\"", "\"CANDIDATE\"", "\"OPAQUE\"", "\"TRANSFORM\"", "\"OVERLAYS\"", "\"FLOAT\"", "\"WORKSPACES\"", "\"SURFACES\"",
+ "\"UNKNOWN\"", "\"NOTIFICATION\"", "\"LOCK\"", "\"WORKSPACE\"", "\"WINDOWED\"", "\"DND\"", "\"SPECIAL\"", "\"ALPHA\"", "\"OFFSET\"",
+ "\"CANDIDATE\"", "\"OPAQUE\"", "\"TRANSFORM\"", "\"OVERLAYS\"", "\"FLOAT\"", "\"WORKSPACES\"", "\"SURFACES\"", "\"CONFIGERROR\"",
};
const std::array<const char*, CMonitor::SC_CHECKS_COUNT> SOLITARY_REASONS_TEXT = {
- "unknown reason", "notification", "session lock", "invalid workspace", "windowed mode", "dnd active", "special workspace", "alpha channel",
- "workspace offset", "missing candidate", "not opaque", "surface transformations", "other overlays", "floating windows", "other workspaces", "subsurfaces",
+ "unknown reason", "notification", "session lock", "invalid workspace", "windowed mode", "dnd active",
+ "special workspace", "alpha channel", "workspace offset", "missing candidate", "not opaque", "surface transformations",
+ "other overlays", "floating windows", "other workspaces", "subsurfaces", "config error",
};
std::string CHyprCtl::getSolitaryBlockedReason(Hyprutils::Memory::CSharedPointer<CMonitor> m, eHyprCtlOutputFormat format) {
@@ -128,7 +129,7 @@ std::string CHyprCtl::getSolitaryBlockedReason(Hyprutils::Memory::CSharedPointer
std::string reasonStr = "";
const auto TEXTS = format == eHyprCtlOutputFormat::FORMAT_JSON ? SOLITARY_REASONS_JSON : SOLITARY_REASONS_TEXT;
- for (int i = 0; i < CMonitor::SC_CHECKS_COUNT; i++) {
+ for (uint32_t i = 0; i < CMonitor::SC_CHECKS_COUNT; i++) {
if (reasons & (1 << i)) {
if (reasonStr != "")
reasonStr += ",";
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index e5b60597..4a9f93ff 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -25,6 +25,7 @@
#include "../managers/animation/AnimationManager.hpp"
#include "../managers/animation/DesktopAnimationManager.hpp"
#include "../managers/input/InputManager.hpp"
+#include "../hyprerror/HyprError.hpp"
#include "sync/SyncTimeline.hpp"
#include "time/Time.hpp"
#include "../desktop/LayerSurface.hpp"
@@ -1499,8 +1500,8 @@ void CMonitor::setCTM(const Mat3x3& ctm_) {
g_pCompositor->scheduleFrameForMonitor(m_self.lock(), Aquamarine::IOutput::scheduleFrameReason::AQ_SCHEDULE_NEEDS_FRAME);
}
-uint16_t CMonitor::isSolitaryBlocked(bool full) {
- uint16_t reasons = 0;
+uint32_t CMonitor::isSolitaryBlocked(bool full) {
+ uint32_t reasons = 0;
if (g_pHyprNotificationOverlay->hasAny()) {
reasons |= SC_NOTIFICATION;
@@ -1508,6 +1509,12 @@ uint16_t CMonitor::isSolitaryBlocked(bool full) {
return reasons;
}
+ if (g_pHyprError->active() && g_pCompositor->m_lastMonitor == m_self) {
+ reasons |= SC_ERRORBAR;
+ if (!full)
+ return reasons;
+ }
+
if (g_pSessionLockManager->isSessionLocked()) {
reasons |= SC_LOCK;
if (!full)
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index 5400fd97..542207b6 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -235,7 +235,7 @@ class CMonitor {
};
// keep in sync with HyprCtl
- enum eSolitaryCheck : uint16_t {
+ enum eSolitaryCheck : uint32_t {
SC_OK = 0,
SC_UNKNOWN = (1 << 0),
@@ -254,8 +254,9 @@ class CMonitor {
SC_FLOAT = (1 << 13),
SC_WORKSPACES = (1 << 14),
SC_SURFACES = (1 << 15),
+ SC_ERRORBAR = (1 << 16),
- SC_CHECKS_COUNT = 16,
+ SC_CHECKS_COUNT = 17,
};
// keep in sync with HyprCtl
@@ -297,7 +298,7 @@ class CMonitor {
WORKSPACEID activeSpecialWorkspaceID();
CBox logicalBox();
void scheduleDone();
- uint16_t isSolitaryBlocked(bool full = false);
+ uint32_t isSolitaryBlocked(bool full = false);
void recheckSolitary();
uint8_t isTearingBlocked(bool full = false);
bool updateTearing();