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

Primary windows does't continuously refresh its content while resized #422

Closed
abey79 opened this issue Dec 31, 2020 · 4 comments
Closed
Labels
state: ready Fixed/Added and will be present in an upcoming release type: improvement improvements or optimizations are needed

Comments

@abey79
Copy link

abey79 commented Dec 31, 2020

Version of Dear PyGui:

Version: 0.6.117

OS

Operating System: macOS 10.15.7
(but according to @hoffstadt this issue probably affects all OSs)

Issue

When a non-primary window is resized, its content is refreshed continuously. For a primary window, the content is not refreshed until the user releases the mouse. Instead, the frame buffer is simply scaled which leads to an inelegant display in most cases.

Video demo:

Screen.Recording.2020-12-30.at.18.11.30.mp4

The first half exhibits the issue, the second shows the result when using the proposed workaround.

Workaround

Add this code before start_dearpygui():

def redraw(sender, data):
    render_dearpygui_frame()


def post_init(sender, data):
    set_resize_callback(redraw)


set_start_callback(post_init)

Notes

  • Going through set_start_callback() is required because otherwise redraw() is first called too early and leads to a crash at boot.
  • The workaround is not perfect because some "scaled frame buffer" frames are still visible between properly rendered frame. This is visible in the video above (a few glitches when the plot window is non-primary, and a wobbly effect when it is primary). The result is still vastly superior than the default situation.
@abey79
Copy link
Author

abey79 commented Dec 31, 2020

@hoffstadt hoffstadt added type: improvement improvements or optimizations are needed Platform Dependent labels Dec 31, 2020
@hoffstadt hoffstadt removed the 0.6.x label Jun 30, 2021
@hoffstadt hoffstadt added priority: low low priority and removed Platform Dependent labels Oct 13, 2021
@hoffstadt
Copy link
Owner

Fixed in next release!

@hoffstadt hoffstadt added state: ready Fixed/Added and will be present in an upcoming release and removed priority: low low priority labels Jan 19, 2022
@abey79
Copy link
Author

abey79 commented Jan 19, 2022

@hoffstadt This commit appears to only address the Windows platform. Has this been fixed on Mac (and Linux?) before?

@hoffstadt
Copy link
Owner

I believe it was fixed for those platforms in the past, however it's been a while since I've been on those platforms so I could be wrong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: ready Fixed/Added and will be present in an upcoming release type: improvement improvements or optimizations are needed
Projects
None yet
Development

No branches or pull requests

2 participants