Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:17
    UE2020 commented #1349
  • Jan 08 11:12
    markus-bauer commented #1034
  • Jan 06 09:33
    ProgrammingLife opened #1386
  • Jan 03 19:13

    madsmtm on update-contact-links

    (compare)

  • Jan 03 19:13

    madsmtm on master

    Update contact links (#1379) (compare)

  • Jan 03 19:13
    madsmtm closed #1379
  • Jan 03 13:51
    caiiiycuk commented #1167
  • Dec 29 2021 10:27
    PureTryOut commented #1307
  • Dec 28 2021 21:30
    Kaiser1989 commented #1307
  • Dec 28 2021 21:29
    Kaiser1989 edited #1385
  • Dec 28 2021 21:28
    Kaiser1989 edited #1385
  • Dec 28 2021 21:27
    Kaiser1989 opened #1385
  • Dec 27 2021 13:28
    LordMZTE commented #1307
  • Dec 20 2021 05:42
    JamesSmith2 edited #1384
  • Dec 20 2021 05:41
    JamesSmith2 edited #1384
  • Dec 20 2021 05:41
    JamesSmith2 edited #1384
  • Dec 20 2021 05:41
    JamesSmith2 opened #1384
  • Dec 16 2021 15:02

    maroider on master

    Added missing character in word… (compare)

  • Dec 16 2021 15:02
    maroider closed #1383
  • Dec 16 2021 15:02
    maroider commented #1383
Github
@_neb_github:matrix.org
[m]
rust-windowing/winit#3 : PRs that need to be merged into winit
rust-windowing/winit#2 : Purge OpenGL from cocoa
rust-windowing/winit#4 : Make it compile on Linux
1 reply
arturkovacs
@arturkovacs:matrix.org
[m]
0x6C697370 referred to events in their example using hashmark followed by the event sequence number. The github bot thought these were references to gihub PRs/issues
maroider
@maroider:matrix.org
[m]
although I'm not that familiar with how ScaleFactorChanged works
AidanConnelly
@AidanConnelly
Is it supposed to be obvious how to run futures (core::future::Future, from the futures API) from within the winit event loop? Been bashing my head against this and I can't seem to figure out a way to do it
0x6C697370
@michaelmmacleod:matrix.org
[m]
@AidanConnelly: As far as I know there's no functionality for executing futures in the standard library. You've got to use an executor, like one from the futures crate. block_on is fairly easy to use: https://docs.rs/futures/0.3.17/futures/executor/fn.block_on.html, and there's more complex things there too if you need more control.
Ralith
@ralith:ralith.com
[m]
maroider: repeated emails to gentz have failed to elicit a response; might be time to abandon this room and make a new one, and get matrix.org staff to nuke the alias
maroider
@maroider:matrix.org
[m]
well, that's unfortunate
maroider
@maroider:matrix.org
[m]
if this room gets nuked, then I'd like to have a copy of the chat history available if possible
Ralith
@ralith:ralith.com
[m]
rooms proper can't be nuked, just forgotten by their participants
idk if matrix.org has a policy for room admin recovery, seems unlikely though
Lukas Bombach
@lukasbombach:matrix.org
[m]

Since I joined this room there have been some discussions which revolved around the constraints the event loop imposes on one's own implementation. I now completely get that this is how OSes work and winit is really just wrapping this in safe cross platform rust code, but I still find this unpleasant to work with (by the OSes, not by winit). Anyhow, I just found this GIST on Tokio's Gitter, which I found to be a clean enough route to deal with this

https://gist.github.com/FredrikNoren/7c3535b11e99e8fcd8dd3d55f9a934a2

I am just sharing this if anyone here finds this interesting and maybe it will be useful for the next person who needs an idea for moving control to their own code

^ this instantiates a tokio event loop that spawns a thread and goes on from there and then has winit forward all events to tokio. I'd probably select the events I would want to forward, but this seems "kind of" clean to me
But maybe I am just too much of a novice
Ralith
@ralith:ralith.com
[m]
you don't need multiple threads to accomplish that as written, fwiw, you can just move your Gpu structure into the event loop closure
Lukas Bombach
@lukasbombach:matrix.org
[m]
That is just one example. I am integrating the V8 runtime via deno in an app. V8 has its own event loop, but the main thread will be completely blocked by winit, so I need to put it in a thread there
madsmtm
@madsmtm:matrix.org
[m]
Re https://github.com/rust-windowing/winit/pull/2023#issuecomment-918497408 and others, I could consider becoming a winit maintainer at some point, but I feel I need to get my (yet private) fork of objc to a proper level first, and need to get my studies in order. Maybe in a few months
*MacOS maintainer
yuri6037
@yuri6037:matrix.org
[m]
Hi, I have some questions about winit: is this rust library able to create a window in both Win7+, Linux (Ubuntu minimum - Xorg + Waylan) and Mac?
yuri6037
@yuri6037:matrix.org
[m]
well nevermind I can't use this lib anyway: I require layout agnostic key codes. If I press Q on a AZERTY layout I want Q not A. If I press Q on any keyboard layout then I want the program to report Q not whatever key based on the QWERTY layout
maroider
@maroider:matrix.org
[m]
well, that happened
Ralith
@ralith:ralith.com
[m]
very classic
madsmtm
@madsmtm:matrix.org
[m]
And is it even true? I mean, couldn't @yuri6037 have used ReceivedCharacter(char)?
maroider
@maroider:matrix.org
[m]
they effectively wanted what we'd get once the keyboard event rework lands
madsmtm
@madsmtm:matrix.org
[m]
Yeah, fair enough
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