AllenDang / giu

Cross platform rapid GUI framework for golang based on Dear ImGui.
MIT License
2.26k stars 131 forks source link

Application crashing when moving the window from one monitor to a second one #155

Open mtp opened 3 years ago

mtp commented 3 years ago

My application is crashing when moving the window from one monitor to a second one, everytime and the exact moment is goes to the second monitor. The following error is given in the stdout :

File: imgui.cpp, Line 6982

Expression: (g.FrameCount == 0 || g.FrameCountEnded == g.FrameCount) && "Forgot to call Render() or EndFrame() at the end of the previous frame?"

The system is windows 10. Using GLFW 3.3 The two monitors dont have the same scale : 125% for the origin monitor, 100% for the destination monitor.

AllenDang commented 3 years ago

@mtp Got it. I will test it soon. I guess something is changed inside imgui when processing multiple monitor support.

lukaswozniak commented 3 years ago

I'm having the same problem. Is there any workaround for it?

AllenDang commented 3 years ago

@lukaswozniak It's really weired. What c++ compiler you are using?

lukaswozniak commented 3 years ago

I'm not really sure, definitely the default. I'm running the hello world code without any changes. If I change my second monitor from 125% to 100% scaling in Windows settings, then it's fixed for me, but I don't like it at 100%, because everything is too small to read.

go version go version go1.16.6 windows/amd64

0xkalle commented 6 months ago

Have the same problem. If I can help with checking different cases or something, let me know.

gucio321 commented 6 months ago

I'm wondering what causes this... glfw? Opengl?

@lukaswozniak are you running latest master (this with cimgui-go)? Could you try this on cimgui-go?

lukaswozniak commented 6 months ago

Sorry I no longer use giu, but iirc I solved the problem by downgrading giu from 0.6.1 to 0.6.0, I don't know if it exists on newer versions

gucio321 commented 6 months ago

oh, sorrry, I pinged a wrong person :smile: I meant @0xkalle

0xkalle commented 6 months ago

I'll try with my example application on cimgui-go. my problem was that last time it didn't want to start at all with cimgui-go

gucio321 commented 6 months ago

A lot changed last two months maybe not it will work

0xkalle commented 6 months ago

Ok. If both displays have the same scale, it works: grafik And I retested it with 0.7.1 as well, and it works with that as well.

But if you change the scale from the second monitor to 150% then 0.7.1 crashes and master produces this: grafik

(odd window stretching over both displays). It looks like the window gets continuously bigger and then crashes shortly after with: File: D:/a/cimgui-go/cimgui-go/cimgui/imgui/imgui.cpp, Line: 9852 exit status 1 Never saw something like that before.

Context how the monitors are arranged: grafik

1: 150% scale 2: 100% scale, primary

EDIT: Screenrecording of the "scaling" window:

https://github.com/AllenDang/giu/assets/31923808/af51e0e2-9878-4bf6-827f-3a0116be30cd

gucio321 commented 6 months ago

File: D:/a/cimgui-go/cimgui-go/cimgui/imgui/imgui.cpp, Line: 9852 exit status 1 says

    IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting.");
0xkalle commented 6 months ago

I guess it is running into that when it gets to big?