From 159a82e077691dfee472a9ae346a342cce10c7d3 Mon Sep 17 00:00:00 2001 From: David Richardson Date: Fri, 21 Aug 2026 15:52:17 -0600 Subject: [PATCH] AppKit: CPScreen, CPColor PLATFORM conditional removal - CPScreen.j and CPColor.j: one PLATFORM block each, resolved to runtime CPDOMAvailable guards; no preprocessor directives remain in either file - work-in-progress towards complete removal of CPP directives --- AppKit/CPColor.j | 7 ++++--- AppKit/CPScreen.j | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index cd6ad01e9..57ea1a9d4 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -563,9 +563,10 @@ var cachedBlackColor, { // Fix to avoid a problem when compiling a theme (missing the alpha component as theme compiler doesn't have CSS rgba capability) var hasAlpha = YES; -#if PLATFORM(DOM) - hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0; -#endif + if (CPDOMAvailable) + { + hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0; + } _cssString = (hasAlpha ? "rgba(" : "rgb(") + parseInt(_components[0] * 255.0) + ", " + diff --git a/AppKit/CPScreen.j b/AppKit/CPScreen.j index e4a763088..fceb68276 100644 --- a/AppKit/CPScreen.j +++ b/AppKit/CPScreen.j @@ -42,11 +42,10 @@ */ - (CGRect)visibleFrame { -#if PLATFORM(DOM) - return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight); -#else + if (CPDOMAvailable) + return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight); + return CGRectMakeZero(); -#endif } @end