Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppKit not being called from main thread #245

Closed
mystise opened this issue Feb 1, 2015 · 8 comments
Closed

AppKit not being called from main thread #245

mystise opened this issue Feb 1, 2015 · 8 comments

Comments

@mystise
Copy link

mystise commented Feb 1, 2015

I'm not sure how to handle this in a cross platform manner, but calling any AppKit method on a background thread is disallowed and undefined behavior (And Glium uses exclusively that)

Note: I'm posting this to both Glium and Glutin's pages, as I'm not sure where it's best to solve this.

glium/glium#425

@tomaka
Copy link
Contributor

tomaka commented Feb 1, 2015

Yeah that's a big problem.

If it can't be enforced at compile-time, it should at least be enforced at runtime.

@bobakker
Copy link
Contributor

bobakker commented Feb 1, 2015

So, is this the reason we've been getting spinning beachballs of death if we run the Glium examples on OS X?

@tomaka
Copy link
Contributor

tomaka commented Feb 1, 2015

Probably :-/

@camjackson
Copy link
Contributor

But the bug isn't in the example code is it? It's built into way glium's
message loop works, right? Hope it's not too annoying to change, just for
osx.
On 02/02/2015 6:21 am, "tomaka" notifications@github.com wrote:

Probably :-/


Reply to this email directly or view it on GitHub
#245 (comment).

@tomaka
Copy link
Contributor

tomaka commented Feb 1, 2015

Glium does something wrong, but glutin is also at fault because it lets you do that wrong thing without any compile-time error nor panic.

@SSheldon
Copy link
Contributor

Any thoughts on how to solve this? In #4 there was mention of a macro solution.

The issue of accessing things off the main thread could be resolved by dispatching more work to the main thread, but it feels like there's a fundamental difference between how Cocoa works and the other APIs. Unless we enforce that all glutin apps call a glutin_main, there'll have to be different instructions for using it on OSX vs other platforms.

@SSheldon
Copy link
Contributor

This issue relates to #47 and may be a dup.

@tomaka
Copy link
Contributor

tomaka commented May 16, 2015

Yeah let's close this in favor of #47

@tomaka tomaka closed this as completed May 16, 2015
tomaka added a commit that referenced this issue Aug 29, 2017
Fixes window inner size calc for hidpi windows X11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants