linebender / linebender/druid

Window sizing coherency

Open
#770 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion shell
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

When giving druid a window size (e.g. `window_size` or `with_min_size`) what is the expected result? Does that size include OS-styling (title bar and other borders) or is that size meant only for druid-addressable drawing area?

I think having it mean only the addressable drawing area makes the most sense if we want to achieve pixel perfect designs across platforms.

I tested macOS and Windows, haven't looked at Linux yet. On macOS the druid window size does determine the drawing area :+1: but on Windows the drawing area will be smaller because all the OS borders have to fit within the size constraints. :confused:

I think it is possible to change the behavior on Windows, perhaps with [AdjustWindowRect](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-adjustwindowrect) and friends.

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 reproducing the behavior of `window_size` and `with_min_size` on macOS and Windows, then compare the drawing area with the full window size; Linux is also mentioned as untested. Read the Windows sizing path around `AdjustWindowRect` and determine whether the API should consistently measure the Druid-addressable drawing area. Done means the sizing semantics are defined and behavior is consistent across platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.