rust-windowing / rust-windowing/winit

Need to get info about window state (maybe only on Windows)

Open
#208 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs discussion D - easy DS - win32 H - help wanted P - normal S - api
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Need to add possibility emit Maximized and Minimized window events to winit.
Current implementation on window minimizing only sends Resized event, where window size on Windows machines equals to zero (w = 0, h = 0). Sometimes it causes bugs in programs (like games), where aspect ratio dynamically calculated on window size change.

There are two suggestions to implement:

  • Add completely new window events - WindowEvent::Minimized and WindowEvent::Maximized, as the result of window minimization don't send WindowEvent::Resized, only that two new
  • Update current WindowEvent::Resized(u32, u32) signature to a new WindowEvent::Resized(u32, u32, bool) one, where bool parameter will be a window minized (true)/maximized (false) state

Look at the following PR's:

Contributor guide

Open the contributing guide

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 reviewing the two referenced pull requests and compare their approaches to reporting minimized and maximized window state. Decide which event API and platform behavior the project should support; done means the chosen behavior is implemented consistently without causing incorrect resize-based aspect-ratio calculations.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.