While most compositors provide server side decorations, the GNOME
does not, and won't provide them. Also Wayland clients must render
client side decorations.
Winit was already drawing some decorations, however they were bad
looking and provided no text rendering, so the title was missing.
However this commit makes use of the SCTK external frame similar to
GTK's Adwaita theme supporting text rendering and looking similar to
other GTK applications.
Fixes#1967.
This commit brings new Ime event to account for preedit state of input
method, also adding `Window::set_ime_allowed` to toggle IME input on
the particular window.
This commit implements API as designed in #1497 for desktop platforms.
Co-authored-by: Artur Kovacs <kovacs.artur.barnabas@gmail.com>
Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
Co-authored-by: Murarth <murarth@gmail.com>
Co-authored-by: Yusuke Kominami <yukke.konan@gmail.com>
Co-authored-by: moko256 <koutaro.mo@gmail.com>
`wl_pointer::set_cursor` expects a serial number of the last
`wl_pointer::enter` event. However other calls expect latest
observed pointer serial, so this commit tracks both and
use them as required by specification.
Fixes#2273.
This makes X11 and Wayland follow Windows and macOS, so the size of the
window could be set even though it has resizable attribute set to false.
Fixes#2242.
Both APIs are used to set application name. This commit unifies the API
between Wayland and X11, so downstream applications can remove platform
specific code when using `WindowBuilderExtUnix`.
Fixes#1739.
When all the receive from the compositor is `TouchEvent::Down` and
`TouchEvent::Up` for the same id, we would record the touch position in
the touch_points vector the first time. On `TouchEvent::Up` we'd find it
and report `TouchPhase::Ended` with that location. The next time we
receive `TouchEvent::Down` for the same id, we'd however unconditionally
append a new `TouchPoint` to `inner.touch_points`, with the new
position. On release however we'd find the earlier point and report its
location, which basically means that `TouchPhase::Ended` always and
forever reported the location of the very first touch down event.
Instead, this patch updates an existing touch point location with the
same id on `TouchDown`.
Fixes#1996
The commit without buffer attached should be done after setting all
top level size/application related properties. While c4df7ad7a added
commit after setting decorations, it accounted just for decorations,
however we should account for the min/max size and other attributes.
This commit brings `is_resizable` and `is_decorated`. Since the client
is responsible for both of them, they could be tracked without deep
syncing with server.
The scale factor being sent when the only monitor is disconnected and
reconnected is hard coded to 1.0. That may work by chance, if that's the
scale factor in use currently, but it does not work in the general case.
As a result, clients may end up with wrongly scaled or laid out window
contents after reconnect, as was reported over in
https://github.com/alacritty/alacritty/issues/5703, for example.
The problem was introduced by change 125ee0b, which caused an additional
ScaleFactorChanged event to be sent on monitor reconnect, but got the
scale factor wrong when the only monitor is disconnected and
reconnected.
This change fixes the problem by using the current monitor's scale
factor in this case. The event is still being sent as intended by
125ee0b.
Fixes#2123.
* Use NSView's inputContext instead of creating our own
This means that `set_ime_position` now properly invalidates the character coordinates.
* Make `set_ime_position` robust against moving windows
If you try to use `EventLoop::run_return` API in a way that you do on
demand polling of events it won't actually poll, since in such strategy
the `ControlFlow::Exit` is sent right before Wayland backend starts to
poll.
This was observed with smithay compositor Anvil which was doing this
particular thing leading to GNOME thinking that app isn't responding,
due to connection not being polled.
* Improve web example
* Implement basic logger into the example webpage
* Repace bash script with xtask
* replace wasm-bindgen-cli with wasm-bindgen-cli-support
* refactor
* Move logic into external crate.
* Remove CI changes
* Review feedback
This commit adds an `EventLoopBuilder` struct to simplify event loop
customization and providing options to it upon creation. It also
deprecates the use of `EventLoop::with_user_event` in favor of the same
method on new builder, and replaces old platforms specific extension
traits with the new ones on the `EventLoopBuilder`.
* Add TraceGuard to make tracing simpler
* Add SharedStateMutexGuard to make tracing simpler
* Add trace_scope macro
* Add missing let binding in trace_scope!
* Update changelog guidelines to prevent conflicts from blocking PRs
As per consensus in https://github.com/rust-windowing/winit/issues/2135
* Add note about whitespace in changelog
* Add note about maintainer creating new tag
* Add exit code to control flow and impl on linux
* Fix examples to have an exit code
* Fix doc examples to use an exit code
* Improve documentation wording on the exit code
* Add exit code example
* Add exit code on windows
* Change i32 as exit code to u8
This avoids nasty surprises with negative numbers on some unix-alikes
due to two's complement.
* Fix android usages of ControlFlow::Exit
* Fix ios usages of ControlFlow::Exit
* Fix web usages of ControlFlow::Exit
* Add macos exit code
* Add changelog note
* Document exit code on display server disconnection
* Revert "Change i32 as exit code to u8"
This reverts commit f88fba0253b45de6a2ac0c3cbcf01f50503c9396.
* Change Exit to ExitWithCode and make an Exit const
* Revert "Add exit code example"
This reverts commit fbd3d03de9c2d7516c7a63da489c99f498b710df.
* Revert "Fix doc examples to use an exit code"
This reverts commit daabcdf9ef9e16acad715c094ae442529e39fcbc.
* Revert "Fix examples to have an exit code"
This reverts commit 0df486896b8d106acf65ba83c45cc88d60d228e1.
* Fix unix-alike to use ExitWithCode instead of Exit
* Fix windows to use ExitWithCode rather than Exit
* Silence warning about non-uppercase Exit const
* Refactor exit code handling
* Fix macos Exit usage and recover original semantic
* Fix ios to use ExitWithCode instead of Exit
* Update documentation to reflect ExitWithCode
* Fix web to use ExitWithCode when needed, not Exit
* Fix android to use ExitWithCode, not Exit
* Apply documenation nits
* Apply even more documentation nits
* Move change in CHANGELOG.md under "Unreleased"
* Try to use OS error code as exit code on wayland