linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.53k stars 568 forks source link

Drop Downs and Tooltips don't take Window Insets into account #2307

Open CryZe opened 1 year ago

CryZe commented 1 year ago

This one is a trivial problem to fix, I'll probably send a PR later. On at least Windows they are spawned in coordinates relative to the top left of the window, but they accidentally use the outer top left instead of the inner top left. Other operating systems may be affected too.

xStrom commented 1 year ago

I think this comes from window inset treatment itself being broken on Windows. When you create a window in Druid and specify a size, that size is supposed to represent the size of the content. On the Windows platform this is not the case right now, instead it represents an imaginery size (not even just content+borders .. it also has +transparent_padding for compatibility reasons or something).

What we need is a comprehensive fix of the window sizing code in druid-shell Windows backend, so that it matches the other backends. I have some preliminary plans of fixing this in glazier and when that fix lands we can see how easy it is to backport it to druid-shell. Of course if anyone else feels like doing some fixes before me, that's fine too.