Commit graph

540 commits

Author SHA1 Message Date
Bruce Mitchener
6641dfa412
Bump cfg_aliases to 0.2.0 2024-01-29 21:27:23 +04:00
John Nunley
c1168b4f58
Remove drm/kms features from softbuffer (#3439)
We use softbuffer as a dev-dependency for rendering into our windows in
examples. However, we do not support a DRM/KMS backend yet, while
softbuffer comes with a DRM/KMS backend by default. This commit removes
the DRM/KMS feature from softbuffer to save some build time during
testing
2024-01-28 22:40:01 +01:00
Kirill Chibisov
73910d20cc
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2024-01-15 13:10:46 +04:00
daxpedda
16d860736b
Platform is called Web not Wasm (#3393) 2024-01-14 18:54:52 +01:00
daxpedda
2ee44246ae
Bump web-time to v1 (#3392) 2024-01-14 18:37:32 +01:00
daxpedda
169cd39f93
Web: improve custom cursor handling and add animated cursors (#3384) 2024-01-12 11:51:19 +01:00
Alexander Medvedev
bdeb2574dc
Update Redox (#3368) 2024-01-10 20:05:52 +01:00
daxpedda
37b6243289
Deploy master docs to GitHub Pages (#3359) 2024-01-05 15:05:12 +01:00
Kirill Chibisov
8ea1da7879
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2024-01-05 15:18:55 +04:00
Mads Marquart
42dbc4748e
Display all platform-specific documentation on docs.rs (#3076) 2024-01-04 12:54:35 +01:00
Kirill Chibisov
c55a2c779b
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-12-31 20:25:19 +04:00
Kirill Chibisov
ca1674519a
Bump version on master (#3332)
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-12-27 10:30:59 +04:00
Kirill Chibisov
775c8ece70
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-12-25 00:30:59 +04:00
Alex Butler
5a43ea8cd6
bugfix(rwh): Bump rwh_05 min version to 0.5.2
Correct min version to support "std" feature
2023-12-23 22:37:35 -08:00
Mads Marquart
674657efb6
Partially replace custom AppKit bindings with icrate's autogenerated bindings (#2982)
* Refactor winit-specific cursor logic out of appkit module

* Add relevant AppKit features that we depend on

* Use icrate's NSImageRep and NSBitmapImageRep

* Use icrate's NSImage

* Use icrate's NSCursor

* Use icrate's NSAppearance

* Use icrate's NSScreen

* Use icrate's NSButton

* Use icrate's NSAppKitVersionNumber

* Use icrate's NSTextInputContext

* Use icrate's NSColor

* Use icrate's NSEvent

* Use icrate's NSMenu and NSMenuItem

* Use icrate's NSPasteboard

* Use icrate's NSResponder

* Use icrate's NSTextInputClient

* Use icrate's NSView
2023-12-23 20:58:38 +01:00
Mads Marquart
7d5bee767c
Update objc2 and icrate versions (#3256) 2023-12-23 18:04:24 +01:00
daxpedda
e37585e5bc
Bump MSRV to 1.70 (#3287) 2023-12-22 23:27:36 +01:00
daxpedda
2c15de7cf9
Allow custom cursor caching (#3276) 2023-12-22 22:20:41 +01:00
Kirill Chibisov
7761b2b16c
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-12-22 00:55:52 +04:00
Eero Lehtinen
af93167237
feat(all): Custom cursor images for all desktop platforms
There seems to be many PRs relating to this issue, but they don't include all
platforms and for some reason lost steam. This PR again tries to make this
feature happen, and does it for all desktop platforms (x11, wayland, macos,
windows, web).

I think the best user of this feature and the reason I'm doing this is Bevy and
game engines in general. There non laggy hardware cursors with custom images are
very important. Game devs also like their PNGs so supporting platform native
cursor files is not that important, but I guess could be added too.

Co-authored-by: daxpedda <daxpedda@gmail.com>
Co-authored-by: Mads Marquart <mads@marquart.dk>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
2023-12-16 12:02:17 -08:00
Friz64
bf5806a9b2
Update sctk-adwaita to 0.8 2023-12-16 20:16:39 +04:00
Uli Schlachter
3eea505440
m: Update to x11rb 0.13.0
The only breaking change is that x11rb no longer reports an error when
querying the WmSizeHints of a window that does not have this property
set. For this reason, the return type of WmSizeHintsCookie::Reply()
changed from Result<WmSizeHints, SomeError> to
Result<Option<WmSizeHints>, SomeError>.

In update_normal_hints(), previously a cryptic error would be reported
to the caller. Instead, this now uses unwrap_or_default() to get a
WmSizeHints. All fields of WmSizeHints are Options, so this produces an
empty object.

resize_increments() queries a value from the window and returns an
Option. Previously, the error for "missing property" was turned into
None via .ok(). This commit adds a call to flatten() to also turn
"property not set" into None.

Finally, request_user_attention() queries a window's WmHints property
and updates one field of it. The code already uses unwrap_or_default()
to deal with missing properties, so just a call to flatten() is needed
to merge "missing property" and "error while querying" into one.

Other changes in x11rb do not seem to affect this crate.

x11rb's MSRV increased from 1.56 to 1.63, which is still below the MSRV
of this crate, which is 1.65.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-12-09 07:02:30 -08:00
Kirill Chibisov
17296e9878
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-11-24 18:32:53 +04:00
Mads Marquart
5612626944
Make Android docs build on docs.rs (#3236) 2023-11-23 08:18:05 +01:00
Kirill Chibisov
e9210555c1
On X11, try alternative cursor icon names as well
This should cover more icons.
2023-11-04 15:19:15 +04:00
Marijn Suijten
0994b5ceb8
Disable default-features for the ndk crate
We decided to add `rwh_06` to the `default` list of features in the
`ndk` to [nudge users to upgrade], but this forces `winit` to always
(transitively) include `raw-window-handle 0.6` even if the user has
set a different `rwh_xx` feature on the `winit` crate.  `winit` already
forwards the respective `rwh_xx` feaure to the `ndk` crate anyway, so
this default should just be turned off.

At the time of writing this is the only `default` feature of the `ndk`.

Links: https://github.com/rust-mobile/ndk/pull/434#issuecomment-1752089087
2023-11-04 15:18:55 +04:00
Kirill Chibisov
3c9f9da19e
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-10-28 21:09:28 +04:00
Kirill Chibisov
772b21ce09
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-10-21 11:58:17 +04:00
Kirill Chibisov
880238a24f
Fix examples not render on Wayland
The `rwh_05` feature was not enabled.

Fixes: e41fac825c (Update to new raw-window-handle strategy)
2023-10-17 07:53:38 +04:00
Kirill Chibisov
3ad64fb811
Remove resolved deny.toml entries 2023-10-17 04:35:14 +04:00
Marijn Suijten
9bf4493a21
Upgrade to ndk 0.8, ndk-sys 0.5 + android-activity 0.5 releases
Fixes #2905.
Co-authored-by: Robert Bragg <robert@sixbynine.org>
2023-10-17 04:08:33 +04:00
Kirill Chibisov
b7e3649e8b
Update SCTK to 0.18.0
The update is pretty minor, however we support now
`WindowEvent::Occluded` when xdg-shell v6 is available.

It also adds support for `Window::show_window_menu`.

Fixes #2927.
2023-10-15 06:49:57 +04:00
Kirill Chibisov
844269d017
Fix ndk deps versions 2023-10-15 06:39:18 +04:00
John Nunley
e41fac825c
Update to new raw-window-handle strategy
Signed-off-by: John Nunley <dev@notgull.net>
Co-authored-by: TornaxO7 <tornax@proton.me>
2023-10-15 06:07:39 +04:00
Dmitry Sharshakov
0363be4776
Add Window::set_blur
Allow clients to request blur behind their window, implemented on
Wayland for now.
2023-10-08 23:53:15 +04:00
daxpedda
992aeb0ca0
Ignore foreign-types* duplicate deps on macOS
The dependency is duplicated due to examples, yet we still need to
exclude checking it.

Fixes #3093.
2023-09-16 14:54:49 +04:00
John Nunley
bb9b629bc3
Implement X11 extensions using x11rb instead of Xlib
Removes Xlib code by replacing it with the x11rb equivalent,
the commit handles xrandr, xinput, xinput2, and xkb.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-30 01:01:25 +04:00
daxpedda
48abf52aac
Use setTimeout() trick instead of Window.requestIdleCallback() (#3044) 2023-08-25 21:40:21 +02:00
Kirill Chibisov
309e6aa85a
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.

This is a follow up to beta yanking
2023-08-16 16:34:36 +04:00
Kirill Chibisov
8b8556798e
Bump version on master
This commit does not represent a release and only synchronizes CHANGELOG
from the latest release.
2023-08-16 13:21:09 +04:00
Kirill Chibisov
2d96480a89
Use beta versions of android crates 2023-08-16 12:31:23 +04:00
Kirill Chibisov
6caff77abb
Bump MSRV to 1.65 2023-08-16 12:10:38 +04:00
Mads Marquart
af6c343d0e
Improve macOS/iOS/Web thread safety
Co-authored-by: daxpedda <daxpedda@gmail.com>
2023-08-14 23:19:57 +04:00
Kirill Chibisov
119462795a
Pin android-activity git dependency 2023-08-14 23:10:32 +04:00
Robert Bragg
bd2f1e8312
Android: Support unicode character mapping + dead keys
Up until now the Android backend has been directly mapping key codes
which essentially just represent the "physical" cap of the key (quoted
since this also related to virtual keyboards).

Since we didn't account for any meta keys either it meant the backend
only supported a 1:1 mapping from key codes, which only covers a tiny
subset of characters. For example you couldn't type a colon since
there's no keycode for that and we didn't try and map Shift+Semicolon
into a colon character.

This has been tricky to support because the `NativeActivity` class doesn't
have direct access to the Java `KeyEvent` object which exposes a more
convenient `getUnicodeChar` API.

It is now possible to query a `KeyCharcterMap` for the device associated
with a `KeyEvent` via the `AndroidApp::device_key_character_map` API
which provides a binding to the SDK `KeyCharacterMap` API in Java:

 https://developer.android.com/reference/android/view/KeyCharacterMap

This is effectively what `getUnicodeChar` is implemented based on and is
a bit more general purpose.

`KeyCharacterMap` lets us map a key_code + meta_state from a `KeyEvent`
into either a unicode character or dead key accent that can be combined
with the following key. This mapping is done based on the user's chosen
layout for the keyboard.

To enable support for key character maps the
`AndroidApp::input_events()` API was replaced by
`AndroidApp::input_events_iter()` which returns a (lending) iterator for
events. This was changed because the previous design made it difficult
to allow other AndroidApp APIs to be used while iterating events (mainly
because AndroidApp held a lock over the backend during iteration)
2023-08-08 02:56:42 +04:00
Mads Marquart
b5aa96bea4
Update icrate to v0.0.4 (#2992) 2023-08-02 16:30:41 +02:00
Mads Marquart
e33d2bee6c
Update objc2 version (#2936)
* Upgrade to objc2 v0.4.0 and icrate v0.0.3

* Fix `touchBar` method

* Use ClassType::alloc

* Use #[method_id(...)] functionality in declare_class!
2023-07-29 00:33:03 +02:00
John Nunley
43acf7f42f
Replace libc with rustix in some modules
Unfortunately this isn't a total removal, for two reasons:

- We still need "libc" for the Xlib XIM implementation, for locales.
- BSD requires libc to check for main-threadedness.

First one we can likely resolve in the near future, not so sure about
the second one without using some weird pthreads trick.
2023-07-22 09:32:27 +00:00
Kirill Chibisov
f7a84a5b50
Add platform::startup_notify for Wayland/X11
The utils in this module should help the users to activate the windows
they create, as well as manage activation tokens environment variables.

The API is essential for Wayland in the first place, since some
compositors may decide initial focus of the window based on whether
the activation token was during the window creation.

Fixes #2279.

Co-authored-by: John Nunley <jtnunley01@gmail.com>
2023-07-20 13:16:51 +00:00
John Nunley
d7ec899d69
Replace parts of the Xlib backend with x11-rb 2023-07-12 07:59:12 +00:00