-
Notifications
You must be signed in to change notification settings - Fork 206
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
Windows Documentation Build #5978
Merged
Merged
Conversation
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
Otherwise these attempt to be set as strings, I assume due to differences between shell argument evaluation on Linux and Windows. There's likely more to be investigated here.
On Windows capturing a window with a visible popup menu will only include the popup menu if we capture the entire screen and crop. This appears to be due to Qt's `grabWindow()` not supporting the capture of windows with transparent pixels on Windows. GafferUI.PopupWindow sets `QtCore.Qt.WA_TranslucentBackground`, which triggers this case and prevents the popup from being captured along with the parent window. The Qt documentation advises to grab the entire desktop instead...
This requires similar Windows work-arounds to `GafferUI.WidgetAlgo.grab()`, where to capture popup menus we need to grab the whole screen and crop.
Otherwise the bookmark menu items appear disabled in the Windows screengrabs.
Otherwise they may be resized partially off-screen and not be entirely captured on Windows.
Otherwise they can overlap subsequent screengrabs taken on Windows.
This ensures the window size on Windows matches that on Linux. We also increase the width to allow all of the example expression code to be on screen for the Windows and gcc11 screengrabs.
Editor widths can vary between desktop environments on our Linux build containers and on Windows, so we now adjust the Rectangle width based on the grabbed image width to prevent the outline from overshooting narrow screengrabs.
As the menu width can also vary based on platform and desktop environment. This keeps the submenu from overlapping the menu or appearing disconnected from it. The vertical alignment of the submenu isn't perfect across the gcc9, gcc11 & windows docs builds, but the vertical placement of the submenu seems more forgiving than the horizontal position and we could tidy this up more easily once we drop the gcc9 builds.
Make outline taller to account for differences in fonts and layout of menu items between the gcc9 and gcc11 desktop environments. This results in a slightly unhappy medium where the single outline works for both but is not great for either, but we'll be able to tidy this once we drop the gcc9 builds. We also offset the outlines on Windows to account for additional "Drives" bookmark item that is not present on Linux.
This works around infrequent corruption of these screengrabs on Windows where the grabbed section appears only partially drawn and then stretched to fill the remaining area. As this occurs infrequently it's tricky to reliably reproduce on CI, but this delay appears to do the trick...
This has proven to be more reliable than the default driver when generating documentation screengrabs on the Windows CI runners.
This matches the resolution used on Linux for documentation screengrabs.
A few of the `sphinxcontrib-` package versions installed here are slightly older than those we use in the Linux build containers. This is required because the Windows build environment is Python 3.7 and the newer packages have dropped support for that version. This doesn't appear to make a difference in practice.
Windows security appears to block us from opening "file://" URLs so instead we just open the file path directly, which Windows seems entirely OK with... Fixes #5861.
Top effort! I've checked over the windows version of the docs, and diffed the new linux images against the old ones, and all looks good. Rebased and merging... |
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.
This adjusts the documentation build process to allow it to run on Windows, sets up CI to produce documentation as part of the Windows build, and makes a few adjustments to the screengrab annotation and post-processing scripts to account for UI/font/layout differences between Linux and Windows. These adjustments also help to improve the annotation of screengrabs produced in the gcc11 build container.