rust-windowing / rust-windowing/softbuffer

Initial Window Size

Open
#106 22 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
506
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Currently the initial window size is always 0 in width and height, this will lead to panics when calling buffer_mut() if the size wasn't set with resize() depending on the platform:

  • Wayland: panics.
  • MacOS: doesn't panic.
  • Redox: doesn't panic.
  • Web: doesn't panic, but will panic when calling present() or fetch() (#104).
  • Windows: panics.
  • X11: doesn't panic.

I would prefer if we make this consistent on all platforms. My current ideas:

  1. Require an initial size in Surface::new().
  2. Set the initial size to the window size (don't know if that's possible on all platforms).
  3. Introduce a new error variant instead of panicking.

Currently leaning towards idea 1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Surface::new, buffer_mut(), resize(), present(), and fetch() across the Wayland, macOS, Redox, Web, Windows, and X11 backends. Review issue #104 and compare the platform-specific behavior before choosing a consistent initial-size policy; done means the behavior is consistent and no size-dependent panic remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.