vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Editor GPU: Add device pixel support to ElementSizeObserver

Open Tyriar opened this issue 1 year ago • 4 comments

We have a ElementSizeObserver helper already, we should merge the capabilities of observeDevicePixelDimensions (from xterm.js) into it.

https://github.com/microsoft/vscode/blob/bd21f3c8f268b741edac137fc109d75a555c0541/src/vs/editor/browser/gpu/gpuUtils.ts#L24-L25

Tyriar avatar Aug 29 '24 16:08 Tyriar

https://github.com/microsoft/vscode/blob/bd21f3c8f268b741edac137fc109d75a555c0541/src/vs/editor/browser/gpu/gpuUtils.ts#L24-L25

Bashirsaba avatar Jan 10 '25 21:01 Bashirsaba

import os from dotenv import load_dotenv

load_dotenv() # Load environment variables from .env file

app_name = os.getenv("APP_NAME") database_uri = os.getenv("DATABASE_URI") jwt_secret = os.getenv("JWT_SECRET")

print(f"App Name: {app_name}") print(f"Database URI: {database_uri}") print("Don't print the JWT secret in a real application!")

Example of using a boolean config

enable_quantum = os.getenv("ENABLE_QUANTUM_COMPUTATION", "false").lower() == "true" # Default to false if not set print(f"Quantum Computation Enabled: {enable_quantum}")

Example of using an integer config

port = int(os.getenv("PORT", 8080)) # Default to 8080 if not set print(f"Port: {port}")

Dinor45 avatar Feb 26 '25 00:02 Dinor45

We have a ElementSizeObserver helper already, we should merge the capabilities of observeDevicePixelDimensions (from xterm.js) into it.

vscode/src/vs/editor/browser/gpu/gpuUtils.ts

Lines 24 to 25 in bd21f3c

// TODO: Move capabilities into ElementSizeObserver? export function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {

#√close_issue

thaileen0411 avatar Mar 08 '25 12:03 thaileen0411

// TODO: Move capabilities into ElementSizeObserver? export function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {

#√close_issue

Record0900 avatar May 21 '25 22:05 Record0900

Thank you for your work on tracking this issue! To reiterate, the goal is to merge the device pixel dimension observation capabilities from observeDevicePixelDimensions (from xterm.js) into the existing ElementSizeObserver helper, as referenced in vscode/src/vs/editor/browser/gpu/gpuUtils.ts (lines 24-25 in bd21f3c).

This will help consolidate logic, reduce code duplication, and make it easier to handle device pixel ratio changes within the editor's GPU rendering path.

If there are any blockers or new developments regarding this, please update the thread. Happy to helRE

akabarki76 avatar Jun 04 '25 11:06 akabarki76

can others contribute to this? like provide a solution maybe?

@PATTASWAMY-VISHWAK-YASASHREE you're better off looking for issues explicitly marked with "good first issue" or "help wanted"

Tyriar avatar Aug 22 '25 12:08 Tyriar

@PATTASWAMY-VISHWAK-YASASHREE you're better off looking for issues explicitly marked with "good first issue" or "help wanted"

thank you

Details

Header
Cell

Saud9911 avatar Oct 10 '25 03:10 Saud9911