Commit Graph
3696 Commits
Author SHA1 Message Date
RandomScientist aa2f07f1df Document potential user expectation of ctrl+left click behavior on macOS. (#4518) 2026-09-05 03:18:46 +09:00
Ali 549a51b4ee Add missing scancodes for orbital (#4515)
add missing keymaps
2026-09-05 03:18:46 +09:00
jgcodes2020 bf8714501f winit-x11: replace XQueryKeymap with equivalent x11rb call (#4497)
And slightly optimize the first_bit helper function.
2026-09-05 03:18:46 +09:00
RandomScientistandRandom-Scientist d3bb66a12e fix(macOS) "fix" toggling IME on appkit backend (#4512)
Co-authored-by: Random-Scientist <Random-Scientist@users.noreply.github.com>
2026-09-05 03:18:46 +09:00
Marijn Suijten aa162524e1 fix(android): Populate KeyEvent.text via Key::to_text()
The `text` field on `KeyEvent` was hardcoded to `None` on Android,
making it impossible for custom `NativeActivity` subclasses that
show the IME to receive functional text input using *for example* the
existing `winit-egui` crate which relies on this field being set.

Use `Key::to_text()` on press events to derive `text` from
`logical_key`, matching the convention used by the Windows and macOS
backends.

Supposedly that doesn't include all kinds of special virtual unicode
keys, but at least the basics work this way.
2026-09-05 03:18:46 +09:00
Pedro Macedo a1107d72bb wayland: implement resize increments 2026-09-05 03:18:46 +09:00
Kotomine Shiki ff1c6ab633 win32: fix ime setcontext lparam
Fixes #3893.
2026-09-05 03:18:46 +09:00
Takaranoao 4d095f44c2 fix(macOS): clamp IME selected_range to prevent substringToIndex crash
macOS native Pinyin IME can send a selected_range that exceeds the
marked text string length (e.g. index 8 for a 6-character string).
This caused an NSRangeException in substringToIndex:, crashing the
application with SIGABRT.

Clamp both location and end to the string's UTF-16 length before
calling substringToIndex.
2026-09-05 03:18:46 +09:00
voxelmagpie 8a100c2dc5 wayland: fix panic when fancy wacom tablet is connected
With some setups certain events were not handled leading to crashes,
thus add missing handles.

Fixes #4493.
2026-09-05 03:18:46 +09:00
SuchAFuriousDeath 31b6566575 winit-x11: fix debug mode overflow panic in set_timestamp
Fixes #4484
2026-09-05 03:18:46 +09:00
Mads Marquart 72f4710fef Refactor usage of CFRunLoopObserver (#4349)
Added a common interface that:
- Uses closures instead of static functions. This should allow easier
  refactoring in the future.
- Returns a handle which is invalidated on `Drop`. This should avoid
  situations where the event loop has exited, but an observer is still
  called because the user spawned the application later on.
- Is properly main-thread safe.

This interface is placed in winit-common, to allow using it in both
winit-appkit and winit-uikit.
2026-09-05 03:18:46 +09:00
Mads MarquartandOsspial 51f3832ae2 Reduce duplication in dpi module (#2148)
* Deduplicate Pixel impl for integers using a macro
* Deduplicate [Logical|Physical][Size|Position] From impls using a macro

Co-authored-by: Osspial <osspial@gmail.com>
2026-09-05 03:18:46 +09:00
Tarek Abdel Sater 8179561595 macOS: fix borderless game resetting after switching spaces (#4482) 2026-09-05 03:18:46 +09:00
DorotaCanddcz ad9e53ad6b wayland IME: Discard completed delete request
Co-authored-by: dcz <gilapfco.dcz@porcupinefactory.org>
2026-09-05 03:18:46 +09:00
isan 3852a741a5 reafactor(orbital): Reimplement Orbital support using std::fs and redox_event (#4470)
Implemented Send and Sync for EventQueue
2026-09-05 03:18:46 +09:00
John Nunley 9830318e03 wayland: Move hash algorithm to foldhash
At the moment, the wayland code uses ahash to perform hashing
in its various hash mas. This was done because ahash was seen as
the best default in the Rust community at the time. However, most
Rust crates (including `hashbrown`) have since moved to using
foldhash instead.

This move is done for two primary reasons:

- This reduces the number of dependencies in the tree for most GUI
  projects. As other projects use foldhash now, this removes ahash
  (as well as its five dependencies) from the tree.
- In most cases, foldhash is faster than ahash.

Signed-off-by: John Nunley <dev@notgull.net>
2026-09-05 03:18:46 +09:00
dependabot[bot] 058e67c1bb chore: bump taiki-e/cache-cargo-install-action (#4456) 2026-09-05 03:18:46 +09:00
Jack 3c23f9215a Add Apple Pencil support on iOS (#4449)
With force, altitude, and azimuth data handling
2026-09-05 03:18:46 +09:00
Mads Marquart 4ccbb97fd3 chore: appease clippy (#4471) 2026-09-05 03:18:46 +09:00
Colin Finck a992706c9e Upgrade windows-sys dependency to 0.61 (#4464) 2026-09-05 03:18:46 +09:00
dependabot[bot] db7d5c83c5 chore: bump the github-actions version 2026-09-05 03:18:46 +09:00
Anhad Singh 7a78bb8613 fix(winit-orbital): handle EINTR when reading from event_socket
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-09-05 03:18:46 +09:00
itsamine27 a6fe777c09 winit-win32: Fix ABI mismatch in INIT_MAIN_THREAD_ID
Fixes #4435.
2026-09-05 03:18:46 +09:00
Silico_Biomancer 35666a004d winit-x11: replace xfixes with x11rb in set_hittest
The xfixes implementation is not that reliable and rather simple to
replace, so use x11rb to implement the same functionality.

Fixes #4120.
Co-authored-by: avitran0 <holyhades64@gmail.com>
2026-09-05 03:18:46 +09:00
Mads Marquart 5d3a349c44 Fix issue template labels (#4421) 2026-09-05 03:18:46 +09:00
Diggory Hardy 6dedb9f888 winit-core/ime: implement Error for ImeSurroundingTextError 2026-09-05 03:18:46 +09:00
Kirill Chibisov f98ccf8efc Winit version 0.31.0-beta.2 v0.31.0-beta.2 2025-11-16 17:23:28 +09:00
Kirill Chibisov b961e8e941 winit-core: fix set_ime_allowed always panicing 2025-11-16 17:23:28 +09:00
Mads Marquart 4c5bf0ee08 winit/event_loop: Add register_app and run_app_never_return
To allow users to explicitly choose the run semantics that they want.
2025-11-16 17:23:28 +09:00
Mads Marquart f69b601abb winit-web: return immediately from run_app on web
This avoids using JavaScript exceptions to support `EventLoop::run_app`
on the web, which is a huge hack, and doesn't work with the Exception
Handling Proposal for WebAssembly:
https://github.com/WebAssembly/exception-handling

This needs the application handler passed to `run_app` to be `'static`,
but that works better on iOS too anyhow (since you can't accidentally
forget to pass in state that then wouldn't be dropped when terminating).
2025-11-16 17:23:28 +09:00
Kirill Chibisov e8bccfff4f Winit version 0.31.0-beta.1 v0.31.0-beta.1 2025-11-16 13:32:44 +09:00
Kirill Chibisov 0a59e4b905 chore: fix clippy on X11 2025-11-16 13:07:23 +09:00
ShikiSuen d837c88855 winit-appkit: fix tests on systems without MonitorId(1)
Use `CGMainDisplayID` instead of `1` to make tests pass on systems
without `MonitorId(1)`.
2025-11-06 14:46:28 +09:00
Dan Harris 82eab465e0 macOS: fix a crash when dragging non-file content onto window
Winit only supports text, thus we should ignore the rest
instead of crashing.
2025-11-05 13:20:01 +09:00
Diggory Hardy a9c189a423 winit-win32: prevent inner size reported as (0,0) when minimized 2025-11-01 23:39:57 +09:00
Diggory Hardy 9d9d21cfdb winit-core: revise MouseButton type
Unify the values of `MouseButton` and thus remove `Other` variant in
limit possible buttons to 32, which was picked based on platform
capabilities, where 32 is the highest.

For the reference, SDL has identical limit.
2025-11-01 21:00:39 +09:00
Kirill Chibisov 779f52a21f chore: latest typos 2025-11-01 21:00:39 +09:00
mfluehr 7a21858d29 windows: don't confine hidden cursor 2025-11-01 13:03:11 +09:00
Kirill Chibisov a3f7e6566a ci: fix eslint version to 9.38.0
9.39.0 has an issue with unified-signatures.

Links: https://github.com/eslint/eslint/issues/20272
2025-11-01 12:52:30 +09:00
DorotaC f41897cfa4 examples/ime: fix crash on wayland
When pressing Ctrl+Space, KeyEvent::text_with_all_modifiers would return
\0. That would get included in the text-input text. When an input method
gets activated, the invalid string returning \0 would get sent as
surrounding text, resulting in a Wayland protocol error and crashing the
application.
2025-10-29 13:40:30 +09:00
Timon bd6fef1d80 wayland: add prefer_csd attribute 2025-10-24 21:35:51 +09:00
Kirill Chibisov 42d256e926 ci: fix version of smol_str 2025-10-24 21:01:20 +09:00
Pavel Strakhov 03dad26c43 x11: ignore mouse scroll button release events 2025-10-24 20:07:10 +09:00
Kirill Chibisov 1e7ab0cd25 wayland: handle wl_seat v10 repeated state
Fixes #4382.
2025-10-20 00:01:36 +09:00
Kirill Chibisov c333003514 Bump MSRV to 1.85 and edition to 2024 2025-10-20 00:01:36 +09:00
Arthur Cosentino 10f21090ce x11: fix deadlock in request_ime_update 2025-10-09 16:57:20 +09:00
Timon 5575f51483 wayland: add wayland-csd-adwaita-notitlebar feature
Addition to already present `notitle` feature.
2025-10-08 12:11:55 +09:00
Ian Douglas Scott 2ede84ab2f wayland: handle axis_value120 scroll events
This can be tested with the `application` example, looking at the events
shown for mouse wheel movement.

`wl_pointer::axis_discrete` isn't sent in version 8 or higher of
`wl_pointer`. And `sctk` doesn't convert the `value120` events, so
on compositors advertising version 8, only pixel scroll events were
being sent.

This sends `MouseScrollDelta::LineDelta` with a fractional value,
without doing any accumulation. Given `LineDelta` contains `f32` values,
this presumably is expected?

Though it might be good to change the definition of `MouseScrollDelta`
to include both discrete and pixel values, when the compositor sends
both. I'm not familiar with how this works on non-Wayland backends
though.
2025-10-08 11:53:57 +09:00
Kirill Chibisovanddaxpedda f046e778aa winit-core:winit: add tablet input support
The API is integrated into the `WindowEvent::Pointer*` API and is
present in form of `TabletTool` variant on corresponding data entries.

For now implemented for Web, Windows, and with limitations for Wayland.

Fixes #99.

Co-authored-by: daxpedda <daxpedda@gmail.com>
2025-10-07 21:42:36 +09:00
sachharine ffcdf80192 chore: fix typos causing dead links 2025-10-07 19:25:41 +09:00