Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 22 00:32
    lattice0 commented #838
  • May 21 21:52
    lattice0 edited #1407
  • May 21 21:51
    lattice0 synchronize #1407
  • May 21 21:41
    MarijnS95 commented #1307
  • May 21 21:01
    lattice0 commented #1307
  • May 21 20:51
    lattice0 commented #1407
  • May 21 20:47
    lattice0 commented #1407
  • May 21 20:46
    lattice0 opened #1407
  • May 19 21:19
    jean-airoldie commented #1406
  • May 19 21:06
    jean-airoldie edited #1406
  • May 19 20:58
    jean-airoldie opened #1406
  • May 19 02:09
    lattice0 commented #1361
  • May 19 02:09
    lattice0 commented #1307
  • May 19 02:07
    lattice0 opened #1405
  • May 19 00:49
    StratusFearMe21 synchronize #1403
  • May 19 00:35
    StratusFearMe21 synchronize #1403
  • May 16 14:42
    thepperson commented #1034
  • May 16 08:46
    markus-bauer commented #1034
  • May 14 20:13
    unlimitedbacon edited #1397
  • May 14 02:37
    StratusFearMe21 synchronize #1403
maroider
@maroider:matrix.org
[m]
I'm not sure how relevant this is for you madsmtm, but I saw some discussion in the comments on reddit about macOS/iOS bindings
madsmtm
@madsmtm:matrix.org
[m]
Thanks for the link, I'll probably talk to those people when I get some more time!
DoM
@dom__:matrix.org
[m]

Hey! I have a question about exiting the EventLoop:
I am following a tutorial on wgpu (https://sotrh.github.io/learn-wgpu/) and it uses winit 0.25
I got to the end of the Surface part (https://sotrh.github.io/learn-wgpu/beginner/tutorial2-surface/#challenge)
but when I get to *control_flow = ControlFlow::Exit the window closes but the app is still waiting in the terminal. I was unable to find the proper way to exit a winit app as anything I put after event_loop.run() is unreachable code, returning after setting the control_flow also doesn't seem to do any difference. The example code does the same, but there seems to be no explanation in the tutorial for this. Do you know what my issue may be or what i am missing?

ps I am using Linux/X11

maroider
@maroider:matrix.org
[m]

but the app is still waiting in the terminal

so you're saying the program never stops running?

DoM
DoM
@dom__:matrix.org
[m]
yeah exactly! The window seems to close properly and event handling stops, but the program never exits
maroider
@maroider:matrix.org
[m]
strange...
can you reproduce this with winit's examples?
DoM
@dom__:matrix.org
[m]
i will check, one sec...
DoM
@dom__:matrix.org
[m]
hmmm the control_flow example seems to work and i see that it is different in many ways, but i'm not really sure which change is the culprit
though one thing that sticks out is that the last three events are:
MainEventsCleared
RedrawEventsCleared
LoopDestroyed
Is it possible that if I exit the loop without clearing the events the program just freezes? I never saw any mention of this before but i am pretty new to winit
maroider
@maroider:matrix.org
[m]
no, you don't have to do any work in order to drain events from the platform's queue
winit does that for you
did you check out v0.25.0 or did you just use master?
DoM
@dom__:matrix.org
[m]
i just used master, I'll see what v0.25.0 does
it seems to give the same result
maroider
@maroider:matrix.org
[m]
so it works?
DoM
@dom__:matrix.org
[m]
yeah
maroider
@maroider:matrix.org
[m]
Does this work correctly for you?
DoM
@dom__:matrix.org
[m]
no, this also freezes
i can type into the terminal but it doesn't stop until i kill it with ctrl + c
maroider
@maroider:matrix.org
[m]
does it work if you comment out all rendering/wgpu code?
DoM
@dom__:matrix.org
[m]
omg it actually does
i guess it was a wgpu issue then
1 reply
maroider
@maroider:matrix.org
[m]
paging cwfitzgerald
cwfitzgerald
@cwfitzgerald:matrix.org
[m]
👀
maroider
@maroider:matrix.org
[m]
short summary: DoM's program hangs upon trying to exit the application with ControlFlow::Exit when wgpu is in use
they're using X11 on Linux
cwfitzgerald
@cwfitzgerald:matrix.org
[m]
maroider: idk how winit works wrt reviewing, is there any chance of rust-windowing/winit#2025 getting in before the 0.26 release?
1 reply
Newbyte
@newbyte:matrix.org
[m]
👋 I'm trying to build the wgpu "just open a window" example from here: https://sotrh.github.io/learn-wgpu/beginner/tutorial1-window/
But when I run it, no window actually appears. It doesn't crash, and I do see it in the list of applications running. Just no window
3 replies
I suspect this is because I'm using Wayland via EGLStreams (thanks NVIDIA), and I understand Wayland is enabled by default for winit. Can I force winit to use X11 (and thus go via XWayland) somehow to see if that helps matters?
1 reply
cwfitzgerald
@cwfitzgerald:matrix.org
[m]
Newbyte: wayland is a cargo feature, you can disable it
maroider
@maroider:matrix.org
[m]
it's a bit awkward atm since we lack a maintainer for the web
but the PR seems fairly simple, so it shouldn't be too hard to get it merged in practice
no, it's not wrong per se
if proceeding to the next part of the tutorial doesn't work, then you can assume something is wrong
Newbyte
@newbyte:matrix.org
[m]
All this does is create a window, and keep it open until user closes it, or presses escape. Next tutorial we'll actually start using wgpu!
I mean, is this part wrong?
maroider
@maroider:matrix.org
[m]
it's not entirely correct when it comes to Wayland, yes
Newbyte
@newbyte:matrix.org
[m]
but it is for X11 and such?
maroider
@maroider:matrix.org
[m]
yes
Newbyte
@newbyte:matrix.org
[m]
I see, thanks! I'll try proceeding further into the tutorial then
maroider
@maroider:matrix.org
[m]
cwfitzgerald: I'll see if I can't take a look at it in the next couple of days. I have IRL stuff that urgently needs doing, but I think I can put aside enough time for this.
1 reply
cwfitzgerald
@cwfitzgerald:matrix.org
[m]
No real urgency on this, just would like to get it on for 0.26 as using grab is currently broken without it
Newbyte
@newbyte:matrix.org
[m]
And it also looks like GNOME Screenshot spares you winit's beautiful CSD
maroider
@maroider:matrix.org
[m]
IIRC, winit is going to lose its built-in CSD in the next release, so I suppose the screenshot accurately represents the near future for GNOME users
1 reply
maroider
@maroider:matrix.org
[m]
any built-in CSD support has been removed, and I don't know if or when libdecor support might be added
1 reply
winit's current Wayland maintainer doesn't seem to want to work around GNOME being "special" and not supporting server-side decorations, and idk how prioritized the issue is upstream (ie. in smithay-client-toolkit, which is where winit used to get the CSD from).
1 reply