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

Crashed when using multi-viewport on the expand screen in windows 10 #5774

Closed
ChivenZhang opened this issue Oct 13, 2022 · 8 comments
Closed

Comments

@ChivenZhang
Copy link

ChivenZhang commented Oct 13, 2022

Version/Branch of Dear ImGui:

Version: 1.88#1
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_SDL.cpp + imgui_impl_OpenGL3.cpp
Compiler: MSVC of Visual Studio 2019
Operating System: Windows 10

My Issue/Question:

Steps below:

  • Create Dock Window
  • Create Normal Window (imgui::begin, imgui::end)
  • Move Dock Window to another expand screen in windows 10 (there are two expand screens in my pc)
  • Then drag out the Normal Window from dock space
  • And it crashed which need to kill the process

Screenshots/Video

NONE

Standalone, minimal, complete and verifiable example: (see #2261)

	const ImGuiViewport* viewport = ImGui::GetMainViewport();
	ImGui::SetNextWindowPos(viewport->WorkPos);
	ImGui::SetNextWindowSize(viewport->WorkSize);
	ImGui::SetNextWindowViewport(viewport->ID);
	ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
	ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
	ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
	ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
	window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
	window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
	ImGui::Begin(m_Name.getValue().c_str(), nullptr, window_flags);
	ImGui::PopStyleVar(3);
	auto dockspace_id = ImGui::GetID(m_Name.getValue().c_str());
	ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None;
	ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);
	ImGui::End();
@ChivenZhang ChivenZhang changed the title Crash when using docking window on the sharing screen in windows 10 ! Crashed when using docking space on the sharing screen in windows 10 Oct 13, 2022
@ChivenZhang ChivenZhang changed the title Crashed when using docking space on the sharing screen in windows 10 Crashed when using docking space on the expand screen in windows 10 Oct 13, 2022
@PathogenDavid
Copy link
Contributor

I can't reproduce this, but your code snippet isn't totally self-contained either. Can you provide a stack trace of the crash? Do you experience this crash in the official examples?

@ChivenZhang
Copy link
Author

ChivenZhang commented Oct 14, 2022

I can't reproduce this, but your code snippet isn't totally self-contained either. Can you provide a stack trace of the crash? Do you experience this crash in the official examples?

I have tried official example [example_sdl_opengl3.cpp] in other computer, It works well except mine.
My own pc is 'Dell G15' which made by one screen integrated and an expand screen 'Dell G2422HS' which using gpu accelerate.
You can visit website below for more product infomation about the expand screen, i guess it caused by hardware.
https://www.dell.com/support/kbdoc/zh-cn/000131820/dell-amd-freesync-monitors-that-are-nvidia-g-sync-compatible?lang=en

@ChivenZhang
Copy link
Author

I can't reproduce this, but your code snippet isn't totally self-contained either. Can you provide a stack trace of the crash? Do you experience this crash in the official examples?

I'll take you the stack trace after working.

@ChivenZhang
Copy link
Author

ChivenZhang commented Oct 15, 2022

I can't reproduce this, but your code snippet isn't totally self-contained either. Can you provide a stack trace of the crash? Do you experience this crash in the official examples?

The process was just block here and never step out when I tried to drag the normal window out of frame on the second screen.

Source Code:
image

Viewport Block:
image

Stack Trace:
image

@ocornut ocornut changed the title Crashed when using docking space on the expand screen in windows 10 Crashed when using multi-viewport on the expand screen in windows 10 Oct 15, 2022
@ocornut
Copy link
Owner

ocornut commented Oct 15, 2022

Hello, looks related to multi-viewports and has nothing to do with docking. Please check the other threads about problems on Windows with OpenGL eg #4468 and #4832.

Please also make sure you don’t have broken software like Nahimic installed #3321 #5354.

@ChivenZhang
Copy link
Author

ChivenZhang commented Oct 15, 2022

Hello, looks related to multi-viewports and has nothing to do with docking. Please check the other threads about problems on Windows with OpenGL eg #4468 and #4832.

Please also make sure you don’t have broken software like Nahimic installed #3321 #5354.

I am sure that I used a single thread for both opengl swapbuffer and imgui draw. Of course not using Nahimic software .etc.
image

@PathogenDavid
Copy link
Contributor

Since the crash is happening in external code above the implementation of SDL_GL_SwapWindow this is probably being caused by something injected into your process or buggy drivers. If you right-click the call stack window and select "Show External Code" you can get more details.

It would also be helpful to see the list of modules loaded into the process during the crash. You can open the list under Debug > Windows > Modules (default shortcut is Ctrl+Alt+U.) You can copy+paste from that table into a GitHub Gist and share it here.

@ChivenZhang
Copy link
Author

Umm, It's ok to develop my application without viewport feature. So I Just close this issure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants