GithubHelp home page GithubHelp logo

Initial Draw Sequence about hello_imgui HOT 8 CLOSED

pthom avatar pthom commented on May 18, 2024
Initial Draw Sequence

from hello_imgui.

Comments (8)

pthom avatar pthom commented on May 18, 2024 1

I’m on the slopes right now .

from hello_imgui.

pthom avatar pthom commented on May 18, 2024

Hum, the initial sequence on Windows is a bit hard.

What you are seeing is:

Docking layout:

  • docking layout is applied on the second frame: if I remember well, ImGui requires that all windows must have been displayed once in order to be able to assign them to splits.

Window sizing:

  • On windows, windows sizing on multiple screen with different dpis is also cumbersome. If you do not specify the screen there is no easy way to know what is the scaling of the screen on which the window will appear before opening it.
    Are you using multiple displays with different scalings?

Anyhow; I know it would be interesting to study this. Perhaps by hiding the window on the first frames.

I'll study that a bit later.

from hello_imgui.

Guillaume227 avatar Guillaume227 commented on May 18, 2024

I am on high DPI monitor (dell XPS 15 laptop). I just unplugged the extra display I was using (which is not high DPI) and I can confirm the behavior I described also happens when I use a single (laptop) screen. I am more than happy to help/test/validate any changes you have in mind.

from hello_imgui.

pthom avatar pthom commented on May 18, 2024

Hi,

This should be solved with d6af807

from hello_imgui.

Guillaume227 avatar Guillaume227 commented on May 18, 2024

The glitch is gone, that looks much nicer now. Thanks Thom for the quick turnaround (and I hope you get to do other fun stuff besides coding during your week of vacation)!

from hello_imgui.

Guillaume227 avatar Guillaume227 commented on May 18, 2024

I was doing some more testing of that change and noticed an undesirable side effect : the hello_imgui app window now forces its way to the forefront all the time (e.g. I alt-tab to some other app and the hello_imgui app jumps back again to the front).

I think it's down to calling showWindow() for every frame index >= 3.
I tried this locally:
if (mIdxFrame >= 3)
if (mIdxFrame == 3)
in src/hello_imgui/internal/backend_impls/abstract_runner.cpp, around line 484

and that fixes that behavior. Any reason not to use an equality there?

from hello_imgui.

pthom avatar pthom commented on May 18, 2024

from hello_imgui.

Guillaume227 avatar Guillaume227 commented on May 18, 2024

Ok - I sent my simple change as a PR if that makes it easier for you: #47

from hello_imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.