g3n/engine

App scene does not appear properly in MacOs

signalsaeed opened this issue ยท 15 comments

The app scene window in comes into the task bar (dock), but not shown as window in mac. it happens randomly. Do you have any Idea why the app scene behaves like this? and any fix?

Can you post a screenshot? It might be an issue with go-gl/glfw. Could you run the example in their readme and check if it has the same behavior?

for the screenshot, I can say when the app scene appear randomly, I get following code in my terminal:
7:45:58.961403:I::OpenGL version: 4.1 INTEL-16.4.5
if the app scene does not pop out, above message does not appear on terminal and the only exec icon appear on deck.
system:mac, Darwin 20.5.0

@danaugrs I run the example in the go-gl/glfw and it works well. it is working with glfw v3.3 , however g3n is still on v3.2
is it possible to merge this PR or introduce a shortcut before its merge ;)

I had updated g3n to use glfw v3.3 in 6938345 - I just closed the PR you mentioned and associated issue.
I also recently updated g3n to use the very latest go-gl/glfw in de78e3c.
Please try again with the latest version of g3n and let me know!

Thank you @danaugrs . I will try it and let you know.

Any improvement @signalsaeed ?

NO Unfortunately, the problem was not related to the glfw version. During my tries and errors, I found out that if I put my code in one function it works and if I spread the code through different files in go packages, it will have the same random app scene problem. the random appearing of the app scene, may be related to threading whereas with some threads, it appears and in some threads , it does not.

I also should add that I am using a mesh file for the graphic part.

Interesting - unfortunately I can't debug/reproduce this as I don't have a Mac. If you put together a minimal reproducible example, Mac folks might be able to investigate further @mat007 @SamTov

Yeah, I can manage a minimal reproducible piece of code to check what would be the problem as the issue draws my curiousness ;)

Sure I can test it if you have some example code.

You're using an Intel Mac right @signalsaeed?

@SamTov, sure I can prepare an example code that reproduce the problem.

I am using Intel mac.

Dear @SamTov,

I uploaded a reproducible piece of code which randomly appear the app scene in my mac.
link:
https://drive.google.com/file/d/1wZwA5GYoBIE-3K7K-qi9E7IGF02UfVfe/view?usp=sharing
please let me know if you need further information.

Hi @SamTov, did you manage to reproduce the issue?

I can confirm adding this to main solves the issue here.

func init() {
	// This is needed to arrange that main() runs on main thread.
	// See documentation for functions that are only allowed to be called from the main thread.
	runtime.LockOSThread()
}