Hacker News new | past | comments | ask | show | jobs | submit login

Having just started looking more into winit, I'm wondering how much different druid-shell is. There's a lot of similar ideas, and I know from working on a couple other projects that platform abstractions are often a nightmare to build and test.

How does druid test across platforms like the web, Wayland, x11, macOS, Windows, etc? I feel like testing is one of the biggest missing links in the Rust GUI ecosystem right now.




This is a very complicated issue. You can read our reasoning at the time in https://github.com/linebender/druid/issues/16

Since then, I've both regretted the fact that we're duplicating work, and been happy that we've been able to move more nimbly than we would if we were dragging the rest of the winit userbase along. A recent example of that is keyboard handling, and I'm expecting a similar situation soon with IME, as we'll want to handle that very differently than winit's current implementation.

Take a look at our CI for the testing story. We have some tests, but they're mostly for platform-independent logic; we don't run a lot of platform specific code in CI. That said, Rust's type system is strong enough to catch a lot of potential breakage at compile time. Other than that, people tend to notice broken things pretty quickly. So overall testing is one of the many things we want to improve, but works reasonably well.


If you don't mind, I'd love to hear more about what you are doing differently with keyboard handling (and IME support).

I'm asking partly because I know this stuff is ripe with complexity and edge cases, and also because my head's in that space a bit right now, since I've been slowly fixing a bug in Alacritty that's been driving me crazy with modifiers at startup on X11.


On keyboard handling, https://github.com/linebender/druid/issues/1040 is the main tracking issue. That references a number of PR's, of which 1049 is the core of the platform keyboard handling. I'd be very pleased for other people doing this (including winit) to use this as a model, as a fair amount of study went into getting it right, especially on Windows.

Regarding IME, we haven't done it yet (we're trying to be fairly conservative in our roadmapping), but we plan to wire up actual composition regions and so on, and hope to plumb IME to it using a cross-platform abstraction. My understanding of the winit code is that it varies a lot from platform to platform, but seems to mostly be synthesizing keyboard events (ReceivedCharacter) when an IME request such as "insertText" happens.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: