-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Display splash screen with win32 api on the first run so that Gtk can… #1263
Conversation
How does it actually look like? |
belachbit_windows_splash.mp4 |
Nice! I didn't expect the video, but now I know that it takes 45 seconds to load the fonts, which is a HUGE startup time. The screen doesn't explain that font caching is only done one time after the installation. If there is nothing right now to speed up Is there a way to get some progress values out of |
The window is spartan (not stylish), but it's functional. What other work might be needed for this?
It depends on quantity of fonts, hardware speed, etc. Without this, the user spends 45 seconds wondering what is going on. |
Or just uninstalls the app. |
… load its font cache.
…run from installer.
This pull request introduces 1 alert and fixes 1 when merging e15dfc6 into 5cb0cba - view on LGTM.com new alerts:
fixed alerts:
|
I've found a way (with fc-scan.exe) to collect information about all fonts in a folder that contains which font for which languages could be used. So this may help us create a mapping between the system language and its corresponding fonts. The font info is like this: Pattern has 23 elts (size 32) |
The fix is still not perfect as the splash screen doesn't come on top on some systems. |
In this case, it is not worse than before. If the startup crashes, could the splash screen thread be orphaned?
Interesting. I compared it to the code pages listed on https://docs.microsoft.com/en-us/typography/font-list/tahoma . Here mentions Russian (ru), while the documentation mentions Cyrillic, so that makes sense. Both mention Vietnamese (vi/1258). The docs mention Turkish (1254), but fc-scan does not mention language code tr. Hmm. Still, this could be useful. |
@@ -203,19 +203,6 @@ def environment_check(): | |||
NSIS_EXE, 'NSIS executable not found: will try to build portable BleachBit') | |||
|
|||
|
|||
def remove_windir_from_fonts_conf(): | |||
filepath = 'dist\\etc\\fonts\\fonts.conf' | |||
dom = xml.dom.minidom.parse(filepath) |
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.
lgtm warned that this change makes the import xml
unneeded.
bleachbit/Windows.py
Outdated
vcenter_rect = (0, rect[3] // 2 - 50, rect[2], rect[3]) | ||
win32gui.DrawText( | ||
hDC, | ||
("Welcome to Bleachbit, it is loading fonts.\n" |
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.
@rados
This is informative text, but for now please let's go with simple instead like "BleachBit is starting".
If there could be a progress bar or spinner, I would make the text simpler, and many Android apps I tested use just a logo. Let's not worry about these for now, though.
bleachbit/Windows.py
Outdated
return 0 | ||
|
||
elif message == win32con.WM_DESTROY: | ||
print('Being destroyed') |
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 this is needed, please use logger
bleachbit/CLI.py
Outdated
@@ -174,6 +174,7 @@ def process_cmd_line(): | |||
if 'nt' == os.name: | |||
parser.add_option("--update-winapp2", action="store_true", | |||
help=_("update winapp2.ini, if a new version is available")) | |||
parser.add_option("--run-from-installer", action="store_true") |
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.
parser.add_option("--run-from-installer", action="store_true") | |
parser.add_option("--run-from-installer", action="store_true", help=optparse.SUPPRESS_HELP) |
There is one more entry for family: 'Tahoma' that includes tr: Pattern has 23 elts (size 32) |
This pull request introduces 1 alert and fixes 1 when merging 3e029b6 into e5b5763 - view on LGTM.com new alerts:
fixed alerts:
|
I've done the following tests to verify that the splash screen is always on top of all other windows (it was a challenge): win 8 64 bit: win server 2019 64 bit: win 7 32 bit: win 10 64 bit: |
Thank you for working hard on this. Is this PR now ready for review and merge? |
This pull request introduces 1 alert and fixes 1 when merging 955572b into e837e56 - view on LGTM.com new alerts:
fixed alerts:
|
Looks like an unrelated test is failing. It happened last week and today, and I don't get this error from the main branch. It makes it hard to test the PR because there is no build artifact on AppVeyor. I will look more into this later
|
I see a 406 return code on the update server coming from AppVeyor IP address (67.225.164.41) and user agent "Python-urllib/3.4" |
I fixed the HTTP 406 error and now it will be easier to review this PR |
Looks OK I tested build 4.4.1.2119 on Windows 10 build 19042 (20H2). First, I deleted fontconfig directory, installed it, ran as admin, and splash screen stayed up for 40 seconds. Then it proceeded normally. Second, I started again as admin, and splash screen flickered and disappeared under one second. Third, I repeated 1 and 2 as non-admin, and it worked the same except time was 25 seconds the first time to rebuild the cache. |
@az0 I found something unusual with this .. First I am testing 4.4.1 beta as described here https://www.bleachbit.org/news/bleachbit-441-beta On windows 10 home, 21H1, OS build 19043.1348 Note well - All tests requested, Windows + Linux, and Windows Only tests, completed succesfully without issue except one thing unusual cropped up ... During the following procedure Within the folder %localappdata%\fontconfig there is a cache folder which I am also deleting. On first install of BleachBit-4.4.1-setup.exe (double click the downloaded installer, not run through the command line), and choosing "Install only for me", before we get to the splash screen there is a command line opens - See attached screenshot below - for fc-cache.exe This command window opens for quite a long period (circa 5-10 seconds) before it closes and the rest of the installation goes ahead. I mention it because it is an unusual and unexpected part of the installation process Would this ordinarily be silent, if so then it is probably a none issue and maybe due to me launching the beta installer via icon instead of command line, and having deleted the cache folder within fontconfig aswell as fontconfig. As mentioned already though all other tests on the page linked at the start of this post went well for my setup. Edit: Just one minor cosmetic thing though .. That splash screen, the Bleachbit Icon looks a bit odd being so close to the left edge of the splash. |
The command window that shows up during the installer is normal. It is building the font cache, so the first time the application starts is faster. I'll write a note in the release notes, and I added code to the installer to explain what is happening (718bdee). By the way, the font cache building (command window) is not directly related to this pull request about the splash screen.
Yes, it could have a more aesthetic design. Let's come back to this in a future release. |
… load its font cache.
Please see related message in the discussion in issue #1207