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

Window stop refreshing when main viewport minimized (glfw backend) #2416

Closed
seoyeon01 opened this issue Mar 11, 2019 · 5 comments
Closed

Window stop refreshing when main viewport minimized (glfw backend) #2416

seoyeon01 opened this issue Mar 11, 2019 · 5 comments

Comments

@seoyeon01
Copy link

Version/Branch of Dear ImGui:

Version: 1.69 WIP
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl2.cpp + imgui_impl_glfw.cpp
Compiler: Visual Studio 2017
Operating System: Win10

My Issue/Question:
Screenshots/Video

3

  1. minimize main window
  2. resize other viewport
  3. window turns black

Standalone, minimal, complete and verifiable example:

// Please do not forget this!
ImGui::Begin("test window");
// just begin~end window also have same issue(in gif example)
ImGui::End();
@ocornut ocornut changed the title window resize when main viewport minimized Window refresh when main viewport minimized (glfw backend) Mar 11, 2019
@ocornut
Copy link
Owner

ocornut commented Mar 11, 2019

Hello,
I noticed this happen with the GLFW backend. It doesn't actually have anything to do with resizing in particular: if you display anything in those window you'll notice they are not refreshed at all when the parent is minimized. This needs to be investigated.

@seoyeon01
Copy link
Author

You're right.

I know that the rules here only deal with the contents of the imgui,
and not with anything else."(Glfw, opensl, directX etc...)
But for the purpose of resolving the current problem (at least temporarily).
I'm going to talk about options for GLFW.

For your precious time.
The story I'm going to tell you below is temporary and my immature way of doing things.
(This is also the story of the GLFW Option.
That's why I don't write new articles. and use long comment...)
If you're looking for the right solution, you don't read it.
You'd better move on.

If you are interested, I would appreciate it
if you could read it and offer a better solution.

@seoyeon01
Copy link
Author

seoyeon01 commented Mar 11, 2019

To solve this problem without modifying the code of imgui
as much as possible (backend bind, imgui.h/cpp etc), I used the following methods:
(I think this method is messy and can cause other problems.
But it can be achieved to act in the way it is intended.)

point is

  1. don't use main window(hide)
  2. make other window and use it like a main window

When create window :
glfwWindowHint(GLFW_VISIBLE, false );
window = glfwCreateWindow (1, 1, title_name, NULL );

And don't use the main window.(it is invisible and 1x1 pixel)
(because if size is bigger than 1x1, your new window can included in invisible window)

You can create a window that has a main window as a parent.
( ImGui::Begin ~ End() )
Use the new window as the main window.

There are several reasons for doing this stupid thing.
it can help slove the many problem of GLFW things...

like border issue, render issue, task bar issue,,, many many issue.....
(caused by my inept ability. and GLFW problem)

for example
(You don't have to read. But I'd appreciate it if you could give me a better solution.)


-- boder issue ---------------------------------
I dont want to use the default border(button of the window
and the binder that displays the name)

i want to use my custom border and
can resize, move like other window.(like adobe photoshop)

it need "glfwWindowHint( GLFW_DECORATED, GLFW_FALSE );"
but! there is many restrictions.
cant move, cant resize, fix position at ( 0, 0 )..

if you want border function(move, resize, basic thing) and custom border
u will made all function and callback etc........

but. there is easy way to solve problem.
use ImGui docking and don't use main window,
make new window and use it as main window.

and customizing style, make border u want.
it can resize, move, minimize, maximize with out
make all function!


anyway..
this solution is work.

and it can solve this refreshed issue(temporarily)

@ocornut
Copy link
Owner

ocornut commented Mar 11, 2019

Thank you. I will investigate this further, as I don't understand why the issue is happening.
As we strive to support multi-viewport with our default backends and GLFW is popular, I want to fix it.

@ocornut ocornut added the bug label Mar 12, 2019
ocornut added a commit that referenced this issue Mar 12, 2019
…ort is minimized. (This is particularly useful for the viewport branch because we are not supporting per-viewport frame-buffer scale. It fixes windows not refreshing when main viewport is minimized.) (#2416)
@ocornut ocornut changed the title Window refresh when main viewport minimized (glfw backend) Window stop refreshing when main viewport minimized (glfw backend) Mar 12, 2019
@ocornut
Copy link
Owner

ocornut commented Mar 12, 2019

I have fixed this bug now!

(The fix is a little short-sighted as I don't want to incorporate the full DPI/framebufferscale design in the viewport/docking branch just yet, but it does the job.)

@ocornut ocornut closed this as completed Mar 12, 2019
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

2 participants