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

Windows Documentation Build #5978

Merged
merged 17 commits into from
Jul 31, 2024
Merged

Windows Documentation Build #5978

merged 17 commits into from
Jul 31, 2024

Conversation

murraystevenson
Copy link
Contributor

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.

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.
@johnhaddon
Copy link
Member

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...

@johnhaddon johnhaddon merged commit 9b21ea2 into 1.4_maintenance Jul 31, 2024
4 of 5 checks passed
@johnhaddon johnhaddon deleted the windowsDocs branch July 31, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants