-
Notifications
You must be signed in to change notification settings - Fork 0
Add multi-monitor fullscreen support via Window Management API #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
18c8137
9d35964
8b2163f
5eccba9
c29c378
0be801d
0e636e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -782,3 +782,93 @@ export default (urlParams) => { | |||||||||||||
|
|
||||||||||||||
| return config; | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * Serialize configuration to URL parameters | ||||||||||||||
| * Used for multi-monitor uniform mode to pass config to child windows | ||||||||||||||
| * @param {Object} config - Configuration object to serialize | ||||||||||||||
| * @returns {string} URL query string with serialized config | ||||||||||||||
| */ | ||||||||||||||
| export function serializeConfig(config) { | ||||||||||||||
| const params = new URLSearchParams(); | ||||||||||||||
|
|
||||||||||||||
| // Conversion constant for angle serialization | ||||||||||||||
| const RADIANS_TO_DEGREES = 180 / Math.PI; | ||||||||||||||
|
|
||||||||||||||
| // Core parameters that should be passed to child windows | ||||||||||||||
| const serializableParams = [ | ||||||||||||||
| "version", | ||||||||||||||
| "font", | ||||||||||||||
| "effect", | ||||||||||||||
| "numColumns", | ||||||||||||||
| "resolution", | ||||||||||||||
| "animationSpeed", | ||||||||||||||
| "forwardSpeed", | ||||||||||||||
| "cycleSpeed", | ||||||||||||||
| "fallSpeed", | ||||||||||||||
| "raindropLength", | ||||||||||||||
| "slant", | ||||||||||||||
| "bloomSize", | ||||||||||||||
| "bloomStrength", | ||||||||||||||
| "volumetric", | ||||||||||||||
| "fps", | ||||||||||||||
| "renderer", | ||||||||||||||
| "suppressWarnings", | ||||||||||||||
| "cursorIntensity", | ||||||||||||||
| "glyphIntensity", | ||||||||||||||
| "ditherMagnitude", | ||||||||||||||
| "glyphFlip", | ||||||||||||||
| "glyphRotation", | ||||||||||||||
| "isometric", | ||||||||||||||
| "loops", | ||||||||||||||
| ]; | ||||||||||||||
|
|
||||||||||||||
| // Add each parameter if it differs from default or is explicitly set | ||||||||||||||
| for (const key of serializableParams) { | ||||||||||||||
| if (config[key] !== undefined && config[key] !== null) { | ||||||||||||||
| // Special handling for different types | ||||||||||||||
| if (typeof config[key] === "boolean") { | ||||||||||||||
| params.set(key, config[key].toString()); | ||||||||||||||
| } else if (typeof config[key] === "number") { | ||||||||||||||
| // For slant, convert back to degrees | ||||||||||||||
| if (key === "slant") { | ||||||||||||||
| params.set(key, (config[key] * RADIANS_TO_DEGREES).toString()); | ||||||||||||||
| } else { | ||||||||||||||
| params.set(key, config[key].toString()); | ||||||||||||||
| } | ||||||||||||||
| } else if (typeof config[key] === "string") { | ||||||||||||||
| params.set(key, config[key]); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // Handle color parameters (convert from internal format to URL format) | ||||||||||||||
| if (config.backgroundColor && config.backgroundColor.values) { | ||||||||||||||
| const values = config.backgroundColor.values.join(","); | ||||||||||||||
| params.set(config.backgroundColor.space === "hsl" ? "backgroundHSL" : "backgroundColor", values); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (config.cursorColor && config.cursorColor.values) { | ||||||||||||||
| const values = config.cursorColor.values.join(","); | ||||||||||||||
| params.set(config.cursorColor.space === "hsl" ? "cursorHSL" : "cursorColor", values); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
||||||||||||||
| if (config.glintColor && config.glintColor.values) { | |
| const values = config.glintColor.values.join(","); | |
| params.set(config.glintColor.space === "hsl" ? "glintHSL" : "glintColor", values); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
serializeConfigfunction is missing several configuration parameters that are available in the codebase and should be serialized for uniform mode to work correctly. Missing parameters include:glintColor/glintHSL- Used for glyph highlights (defined in paramMapping)cursorIntensity- Brightness multiplier for cursor glow (used in config)glyphIntensity- Brightness multiplier for glyphs (used in config)ditherMagnitude- Random per-pixel dimming (defined in defaults)glyphFlip- Horizontal glyph reflection (defined in defaults)glyphRotation- Angle to rotate glyphs (defined in defaults)isometric- Isometric view mode (defined in paramMapping)loops- Loop configuration (defined in paramMapping)Without these parameters, child windows in uniform mode may not accurately replicate the parent window's visual configuration, leading to inconsistent appearance across displays.