Skip to content

Expose existing GPUI minimize, zoom, and fullscreen window controls #68

Closed

Description

@jhomra21

I've been looking at this from the GPUix Solid side because the features missing from my test projects DAW and Diffusion-style editor both need real canvas drawing.

I checked the current GPUIX 0.9 implementation. canvas is already in the React/JSX host types, but CustomElementRegistry::with_defaults() does not register a Canvas factory. So <canvas> currently falls through to the unknown custom-element path and paints nothing.

GPUIX already uses gpui::canvas() internally, and GPUI can paint quads, paths, and text directly. That looks like a good place to start without introducing a CPU bitmap or readback step.

I’d rewrite that section as:

A first Canvas2D-compatible implementation could start with the common drawing operations that cover basic custom rendering:

  • fillRect / strokeRect
  • beginPath, moveTo, lineTo, quadraticCurveTo, closePath
  • fill / stroke
  • fillText

That would provide a useful base for charts, diagrams, waveforms, custom controls, visualizations, and other 2D rendering without trying to implement the entire Canvas2D API at once.

I would leave out getImageData, toDataURL, and other CPU readback APIs.

GPUIX already exposes activateWindow() and setWindowTitle(). The GPUI revision used by GPUIX also has runtime methods for:

window.minimize_window()
window.zoom_window()
window.toggle_fullscreen()

Could GPUIX expose the same operations through the renderer?

renderer.minimizeWindow()
renderer.zoomWindow()
renderer.toggleFullscreen()

I traced the existing window command code. On macOS, these can use the same update_window path as the current title and activation methods. On Windows, Linux, and FreeBSD, they can be added beside UiCommand::ActivateWindow and UiCommand::SetWindowTitle and forwarded to GPUI.

I don't see a GPUI fork change needed for these three operations.

This would let bindings expose the actual desktop controls instead of treating them as unsupported when GPUI already implements them. In GPUix Solid, I would keep the binding thin and add appWindow.minimize(), appWindow.zoom(), and appWindow.toggleFullscreen() after GPUIX exposes the renderer methods.

I'm opening the issue first because of the repos contributor guidance. If this API looks right, I can put together the implementation and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions