remove resizeEvent on screen change#2546
Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom Dec 4, 2022
Merged
Conversation
size is given in virtual pixel size. thus even on change to a screen with a different device pixel ratio, the (virtual) size does not change.
Member
|
Hi @pijyoi I think that code (which I believe I was the author of) behaved slightly differently before we migrated to QOpenGLWidget vs. QGLWidget... regardless, always appreciate PRs that remove existing code, doubly so if they fix an existing issue! Thanks for the PR, LGTM, merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ISSUE: On Qt 6.4.x and Linux, the OpenGL examples making use of
GLViewWidgetwill start up with a black window. Resizing the window will make it return to normal. i.e. render something.The issue is caused by a section of code that was originally meant to handle change in device pixel ratio when dragging the window to another screen. Upon inspection, the remaining section of code (that is deleted in this PR) actually does nothing useful. The code sends a resize event upon change of screen. But in fact, even when changing device pixel ratio, the size will not change as sizes are expressed as virtual pixels.
e.g. Screen 1 has DPR 2 and Screen 2 has DPR 1. On both screens, the program will have the same virtual size of say (640, 480).
Note:
GLViewWidgetalready knows to use thedeviceWidthanddeviceHeightwhen necessary.For simpler testing of this PR, a standalone simplified version of
GLViewWidgetis included below.By commenting or uncommenting the
showEventmethod, the changes that this PR makes can be tested.