solitary: fix check for config error (#11733)

Adds a blocker for solitary optimizations if there is a hyprerror present
This commit is contained in:
Vaxry 2025-09-17 14:03:49 +02:00 committed by GitHub
parent 7fd6998f7c
commit 1cb8cd3930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 10 deletions

View file

@ -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)

View file

@ -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();