-
Notifications
You must be signed in to change notification settings - Fork 357
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
fix #3190 #3464
Closed
Closed
fix #3190 #3464
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the window position is only saved when not maximised, then the move(x,y) is possibly undefined or wrong.
This probably comes into play for multi-monitor set-ups ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've seen with debug under Win10 lead me to the conclusion that retrieving window coordinates while in maximized (and similar) modes returns invalid values. Especially the coordinate of the upper left window corner has negative values. It seems that line 2860 was introduced to fix this. So I assume that maximized/fullscreen needs to be handled by flags not by coordinates.
Be aware that the code retrieves coordinates from different things: The window corner as mentioned before and the size of the pdf widget. This can introduce problems because we and Qt have no access to the geometry of the window decoration (how thick are the border lines of the window surrounding the widget, height of the window title, and so on, which are under control of the window manager). Typically we don't need to know these details when all changes to the coordinates (and flags) are retrieved. Because with these values we should be able to restore a correct window at any time. So the move should be no problem here. Can you reproduce some case?
But this is currently not the case. After my PR I observed following: Maximize and restore pdf window. Thus window coordinates are retrieved and stored. Now move or resize the window, then maximize it, then end txs. When starting txs again the maximized window mode is restored with my PR, but when the maximized flag is cleared, then the normal window has the last saved coordinates instead of the last ones used. I tried to improve this with following code where I need help:
But I couldn't figure out how to find the window as the sender of the signal. If this would work then the current coordinates of the window could be retrieved by txs on maximizing the window (and the like). This should be sufficient for single monitor setups.
In multi monitor setups this may lead to cases where the window is placed on the wrong screens. And what about the case that one drags the maximized window to another screen such that it appears maximized (or normal) there?