When called from inside some winit event handler, we'd go straight to
`with_window_target` to get hold of the event proxy and send it. However
when called through some external event handler (DOM), the scoped
CURRENT_WINDOW_TARGET would not be set and MAYBE_LOOP_INSTANCE would
also be empty because `run` takes it. So instead we'd end up creating an
new event loop instance and the event would sit in there forever.
Instead, this change brings WASM in line with the other platforms by
using the dedicated event loop proxy (global_proxy). Because of the lack
of threading the dance of storage for that is a little different though.
On Windows 10, the creation of symlinks by normal users requires
enabling the developer mode, which may or may not be acceptable in
corporate environments with restricted IT setups.
We introduced the symlinks for the shared special key codes mapping,
which instead this patch places into a shared sixtyfps-common crate.
Share the code that defines the key with a macro over all the backends using
a symlink.
This is a symlink rather than exposing the macro directly since we add this
module in every backend, and each backend re-declares the macro to handle
the part that it needs. This needs to be a symlink because it will also be shared
with the compiler that does not depends on sixtyfps-corelib
PR #642 fixed making the window not resizable when it has initially a
fixed size. This change applies a different logic with the same
resulting effect when the window item changes later, for example when
transiting in the live-preview from a fixed size to a resizable window -
by looking at the min/max constraints.
Treating the Tab key as text disallows handling Shift-Tab because
the shift modifier will not be passed down. This makes the
handling of Tab analogous to Escape, Return and other non-text
keycodes.
When processing window specific events, or generally when accessing
the ALL_WINDOWS refcell, keep the time for borrow to an absolute
miniumum. That way any subsequent method calls may further acquire the
refcell.
This patch re-organizes the entire deeply nested window event handling
in a function with slightly less indentation.
Fixes a panic when calling hide on a Window from within a callback
handler.
Fixes#539
Set QStyle::State_Active conditional to whether the window is active,
which maps to Qt's active window concept and winit's has-focus (until we
render popups differently).
When the window is mapped, the scale factor is brought up-to-date. Only
after that we can receive a resize event or a window scale factor
changed event.
Under these windowing systems, we receive a QString text from Qt that
contains a terminal control character (like \u{3} for ctrl+c). We
decided to supply the character for the key (for example 'c' for Ctrl+C)
to the application, so activate the conversion from the key code when
control characters are present.
With winit, we receive first a key down input event with the virtual key
code (for example C for Ctrl+C), followed by a ReceivedCharacter event
with a terminal control character. We choose to ignore that and instead
take the previously received key code and try to use that instead.
Fixes#441