engine icon indicating copy to clipboard operation
engine copied to clipboard

App scene does not appear properly in MacOs

Open signalsaeed opened this issue 4 years ago • 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?

signalsaeed avatar May 27 '21 09:05 signalsaeed

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?

danaugrs avatar Jun 09 '21 19:06 danaugrs

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

signalsaeed avatar Jun 10 '21 07:06 signalsaeed

@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 ;)

signalsaeed avatar Jun 14 '21 12:06 signalsaeed

I had updated g3n to use glfw v3.3 in https://github.com/g3n/engine/commit/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 https://github.com/g3n/engine/commit/de78e3c4204a605dd7bb204ab2c6551e9d7a8a41. Please try again with the latest version of g3n and let me know!

danaugrs avatar Jun 14 '21 13:06 danaugrs

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

signalsaeed avatar Jun 14 '21 13:06 signalsaeed

Any improvement @signalsaeed ?

danaugrs avatar Jul 23 '21 13:07 danaugrs

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.

signalsaeed avatar Jul 23 '21 13:07 signalsaeed

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

signalsaeed avatar Jul 23 '21 13:07 signalsaeed

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

danaugrs avatar Jul 23 '21 14:07 danaugrs

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

signalsaeed avatar Jul 23 '21 14:07 signalsaeed

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

You're using an Intel Mac right @signalsaeed?

SamTov avatar Jul 24 '21 11:07 SamTov

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

I am using Intel mac.

signalsaeed avatar Jul 26 '21 07:07 signalsaeed

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.

signalsaeed avatar Jul 27 '21 10:07 signalsaeed

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

Noushed avatar Sep 08 '21 12:09 Noushed

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()
}

aymanbagabas avatar Feb 15 '22 00:02 aymanbagabas