Skip to content

Update winit to 0.29.2#7220

Merged
kchibisov merged 2 commits intoalacritty:masterfrom
kchibisov:update-winit-final
Oct 21, 2023
Merged

Update winit to 0.29.2#7220
kchibisov merged 2 commits intoalacritty:masterfrom
kchibisov:update-winit-final

Conversation

@kchibisov
Copy link
Copy Markdown
Member

@kchibisov kchibisov commented Sep 16, 2023

Fixes #7236.
Fixes #7201.
Fixes #6848.
Fixes #3601.
Fixes #3108.
Fixes #2453.

@sukima
Copy link
Copy Markdown

sukima commented Sep 22, 2023

I would like to confirm, after applying this patch that…

  • My slow refreshes while coding in Vim are gone
  • My TMUX is responding way faster
  • My Emojis are crystal clear now
  • My fonts are much bigger (my eyes thank you)
  • Everything runs so much faster and snappier

Thank you!!!!

@kchibisov
Copy link
Copy Markdown
Member Author

@sukima I'm not sure why you have so many things fixed if this PR literally changed nothing compared to them. Probably an oversight.

@sukima
Copy link
Copy Markdown

sukima commented Sep 22, 2023

It is possible that a git pull also contributed to several fixes. But this PR defiantly fixed the #7201 problem I've been having.

@proski
Copy link
Copy Markdown
Contributor

proski commented Sep 26, 2023

This PR solves major issues with MacOS 14 Sonoma that was released today. Alacritty 0.12.2 doesn't work at all, it hangs. The current master branch makes the first line of text appear partially behind the title. Selecting text with the mouse selects on the line above the expected one. Alacritty build from this PR is working properly for me.

Not sure if we need a bug to track Sonoma issues, but I believe a new release is needed very soon.

@kchibisov
Copy link
Copy Markdown
Member Author

did mac broke things so badly? We have the same macOS code for 4 years, I'm pretty sure we're not the only one affected by that.

@proski
Copy link
Copy Markdown
Contributor

proski commented Sep 27, 2023

Everything else appears to be working correctly, including the standard Terminal app. I've opened a ticket #7242 specifically for that issue.

@kchibisov
Copy link
Copy Markdown
Member Author

Hm, I think it's because Apple changed the way resizes work and the way viewport sizes are being reported, and given that winit used different thing it sort of broke stuff.

Out of curiousity, could check with --print-events resizes on the 0.12.2? Maybe that's this issue rust-windowing/winit#2876 ?

I question, because maybe we should really back port and do a patch release of the winit itself, and maybe even alacritty?

@proski
Copy link
Copy Markdown
Contributor

proski commented Sep 27, 2023

I'm sure it's that issue.

[0.000274625s] [INFO ] [alacritty] Welcome to Alacritty
[0.000515667s] [INFO ] [alacritty] Version 0.12.2 (9d9982df)
[0.001379125s] [INFO ] [alacritty_config_derive] No config file found; using default
[0.016426167s] [INFO ] [alacritty] winit event: NewEvents(Init)
[0.016482667s] [INFO ] [alacritty] winit event: Resumed
[0.016543250s] [INFO ] [alacritty] Using Apple CGL
[0.042976333s] [INFO ] [alacritty] Window scale factor: 2
[0.071208917s] [INFO ] [alacritty] Running on Apple M2 Max
[0.071232042s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.082526708s] [INFO ] [alacritty] Cell size: 13 x 25
[0.082547708s] [INFO ] [alacritty] Padding: 0 x 0
[0.082559708s] [INFO ] [alacritty] Width: 1600, Height: 1200
[0.086401458s] [INFO ] [alacritty] PTY dimensions: 48 x 123
[0.088278708s] [INFO ] [alacritty] Initialisation complete
[0.092647333s] [INFO ] [alacritty] winit event: RedrawRequested(WindowId(WindowId(5636403584)))
[0.095163458s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5636403584)), event: Resized(PhysicalSize { width: 4294967295, height: 4294967295 }) }
[0.095196583s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5636403584)), event: Focused(false) }
[0.095216458s] [INFO ] [alacritty] winit event: MainEventsCleared
[0.095234250s] [INFO ] [alacritty] winit event: RedrawRequested(WindowId(WindowId(5636403584)))
[0.095249292s] [INFO ] [alacritty] winit event: RedrawEventsCleared
thread 'PTY reader' panicked at alacritty_terminal/src/tty/unix.rs:418:25:
attempt to multiply with overflow

@kchibisov
Copy link
Copy Markdown
Member Author

Thanks, I'll try to see whether we can backport that, but maybe not into alacritty itself.

At least the rest of the ecosystem could have the fix without waiting on the update of winit.

@proski
Copy link
Copy Markdown
Contributor

proski commented Sep 27, 2023

I reverted rust-windowing/winit#2876 on a local copy of winit and used it with the code from this PR. It triggered both issues I reported in #7242, the overflow panic in the Windowed mode and the lines behind the title in the Maximized mode. So apparently the backport would be very useful, considering that users are updating to MacOS 14 en masse after the release.

@proski
Copy link
Copy Markdown
Contributor

proski commented Oct 12, 2023

Please don't forget to update copypasta version in the commit title.

@kchibisov kchibisov force-pushed the update-winit-final branch 4 times, most recently from 1f8d62b to c472fc9 Compare October 20, 2023 09:40
@kchibisov kchibisov changed the title Update winit to 0.29.1 Update winit to 0.29.2 Oct 20, 2023
@tbozan
Copy link
Copy Markdown

tbozan commented Oct 20, 2023

With this last version of pr only upper left quarter of a terminal window is clickable (beam cursor, can select text, instead of regular cursor and unable to select text in other three quarters).
As i'm using 2x scaling i'm guessing there's a chance that it has something to do with hidpi.
Last working version of this pr was 67382eb.

@kchibisov
Copy link
Copy Markdown
Member Author

kchibisov commented Oct 20, 2023

@tbozan could you be more specific on that matter? Which platform, compositor, etc?

@tbozan
Copy link
Copy Markdown

tbozan commented Oct 20, 2023

Sorry about that. Latest mesa and linux kernel, picom compositor.
Basically when i'm interacting with the mouse (clicking, selecting text...) with upper left quarter of the window everything works as expected. When interacting with other three quarters nothing happens, like i'm clicking on a screenshot of a window.

@kchibisov
Copy link
Copy Markdown
Member Author

@tbozan could you provide the --print-events log and the log when you click on different parts of the window?

@tbozan
Copy link
Copy Markdown

tbozan commented Oct 20, 2023

When moving the cursor or clicking on upper left quarter i'm getting the usual events:

[2.855835398s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 743574320 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.855840097s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 780.0, y: 292.0 } } }
[2.855844487s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 0, value: 782.0 } }
[2.855849327s] [INFO ] [alacritty] winit event: AboutToWait
[2.856835703s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 744574296 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.856840923s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 784.0, y: 292.0 } } }
[2.856845193s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 0, value: 786.0 } }
[2.856849963s] [INFO ] [alacritty] winit event: AboutToWait
[2.857835939s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 745519402 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.857842199s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 791.0, y: 293.0 } } }
[2.857849399s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 0, value: 793.0 } }
[2.857853569s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 1, value: 371.0 } }
[2.857858689s] [INFO ] [alacritty] winit event: AboutToWait
[2.858838005s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 746585238 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.858843235s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 795.0, y: 293.0 } } }
[2.858847995s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 0, value: 797.0 } }
[2.858853195s] [INFO ] [alacritty] winit event: AboutToWait
[2.859838050s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 747585753 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.859844100s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 799.0, y: 293.0 } } }
[2.859848860s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: AxisMotion { device_id: DeviceId(X(DeviceId(2))), axis: 0, value: 801.0 } }
[2.859854170s] [INFO ] [alacritty] winit event: AboutToWait
[2.860839336s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18595, tv_nsec: 748579459 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 132330815 }) })
[2.860844486s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: CursorLeft { device_id: DeviceId(X(DeviceId(2))) } }
[2.860849576s] [INFO ] [alacritty] winit event: AboutToWait
[3.243674390s] [INFO ] [alacritty] winit event: NewEvents(ResumeTimeReached { start: Instant { tv_sec: 18595, tv_nsec: 749519005 }, requested_resume: Instant { tv_sec: 18596, tv_nsec: 132330815 } })
[3.243689990s] [INFO ] [alacritty] winit event: AboutToWait
[3.243698980s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 132362189 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.243704300s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(25165827))), payload: BlinkCursor })
[3.243709420s] [INFO ] [alacritty] winit event: AboutToWait
[3.243714580s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 132378899 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.243720290s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(25165827)), event: RedrawRequested }
[3.244190609s] [INFO ] [alacritty] winit event: AboutToWait
[3.244201948s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 132864457 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.244207888s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(25165827))), payload: Frame { force: false } })

With other three quarters nothing happens when moving the cursor, only when i click on the window i get:

[3.314887544s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 132881467 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.314906624s] [INFO ] [alacritty] winit event: AboutToWait
[3.398846904s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 203576913 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.398871134s] [INFO ] [alacritty] winit event: AboutToWait
[3.668881109s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 287541613 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.668898769s] [INFO ] [alacritty] winit event: AboutToWait
[3.752828639s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 18596, tv_nsec: 557568778 }, requested_resume: Some(Instant { tv_sec: 18596, tv_nsec: 757360509 }) })
[3.752840928s] [INFO ] [alacritty] winit event: AboutToWait
[3.868705206s] [INFO ] [alacritty] winit event: NewEvents(ResumeTimeReached { start: Instant { tv_sec: 18596, tv_nsec: 641510797 }, requested_resume: Instant { tv_sec: 18596, tv_nsec: 757360509 } })
[3.868721536s] [INFO ] [alacritty] winit event: AboutToWait

One pair of NewEvents(WaitCancelled... and AboutToWait for click-down and one for click-up.

@kchibisov
Copy link
Copy Markdown
Member Author

Could you also paste the log alacritty -vv --print-events without actually truncating it?

@tbozan
Copy link
Copy Markdown

tbozan commented Oct 20, 2023

@kchibisov
Copy link
Copy Markdown
Member Author

Does it happen with alacritty --config-file /dev/null?

@tbozan
Copy link
Copy Markdown

tbozan commented Oct 20, 2023

Good catch. When i comment out window.dimensions and restart alacritty everything works, even when i manually resize window.

kchibisov added a commit to kchibisov/winit that referenced this pull request Oct 21, 2023
The cursor hittest was not reloaded on window size changes, only
when `Window::request_inner_size` was called leading to regions
of the window being not clickable.

Links: alacritty/alacritty#7220
kchibisov added a commit to kchibisov/winit that referenced this pull request Oct 21, 2023
The cursor hittest was not reloaded on window size changes, only
when `Window::request_inner_size` was called leading to regions
of the window being not clickable.

Also, don't try to apply hittest logic when user never requested a
hittest.

Links: alacritty/alacritty#7220
kchibisov added a commit to rust-windowing/winit that referenced this pull request Oct 21, 2023
The cursor hittest was not reloaded on window size changes, only
when `Window::request_inner_size` was called leading to regions
of the window being not clickable.

Also, don't try to apply hittest logic when user never requested a
hittest.

Links: alacritty/alacritty#7220
kchibisov added a commit to kchibisov/winit that referenced this pull request Oct 21, 2023
The cursor hittest was not reloaded on window size changes, only
when `Window::request_inner_size` was called leading to regions
of the window being not clickable.

Also, don't try to apply hittest logic when user never requested a
hittest.

Links: alacritty/alacritty#7220
kchibisov added a commit to rust-windowing/winit that referenced this pull request Oct 21, 2023
The cursor hittest was not reloaded on window size changes, only
when `Window::request_inner_size` was called leading to regions
of the window being not clickable.

Also, don't try to apply hittest logic when user never requested a
hittest.

Links: alacritty/alacritty#7220
@kchibisov kchibisov marked this pull request as ready for review October 21, 2023 07:49
@kchibisov
Copy link
Copy Markdown
Member Author

@tbozan your issue should be fixed now. Thanks.

@kchibisov kchibisov requested a review from chrisduerr October 21, 2023 18:29
@kchibisov kchibisov merged commit 80d4dac into alacritty:master Oct 21, 2023
@kchibisov kchibisov deleted the update-winit-final branch October 21, 2023 18:56
@ProNoob135
Copy link
Copy Markdown

ProNoob135 commented Jan 24, 2024

Edit: Apologies, found the issue ( #7607 ) which is fixed by #7739

After this commit, Alacritty hangs if moved off my primary monitor.
./target/debug/alacritty -vv --print-events --config-file /dev/null
Alacritty-3416.log
Here's how far it gets if launched on my other monitors:
Alacritty-4406.log
I'm assuming something is off with my system configuration, but I've no idea what.
XFCE4(X11), three monitors, here's my xorg.conf:

	Identifier	"HDMI-A-0"
	Option	"Position"	"0 180"
EndSection

Section	"Monitor"
	Identifier	"DisplayPort-1"
	Modeline	"2560x1440_143.97"  592.25  2560 2581 2613 2666  1440 1443 1448 1543 +hsync -vsync
	Option	"PreferredMode"	"2560x1440_143.97"
	Option	"Position"	"1920 0"
	Option	"Primary"	"true"
EndSection

Section "Monitor"
	Identifier	"DisplayPort-2"
	Option	"PreferredMode"	"1920x1080"
	Option	"Position"	"4480 360"
	Option	"DPMS"	"false"
EndSection```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants