Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Commit bbe7e97

Browse files
authored
Merge pull request #1365 from mu-editor/isolate-splash
Isolate assets used in the splash screen away from the main program.
2 parents d737b4b + 6ebe9cc commit bbe7e97

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

mu/app.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,18 +294,14 @@ def run():
294294
app.setApplicationVersion(__version__)
295295
app.setAttribute(Qt.AA_DontShowIconsInMenus)
296296

297-
# Create the "window" we'll be looking at.
298-
editor_window = Window()
299-
300-
def splash_context(app=app, editor_window=editor_window):
297+
def splash_context():
301298
"""
302299
Function context (to ensure garbage collection) for displaying the
303300
splash screen.
304301
"""
305302
# Display a friendly "splash" icon.
306303
splash = AnimatedSplash(load_movie("splash_screen"))
307304
splash.show()
308-
app.processEvents()
309305

310306
# Create a blocking thread upon which to run the StartupWorker and which
311307
# will process the events for animating the splash screen.
@@ -323,11 +319,14 @@ def splash_context(app=app, editor_window=editor_window):
323319
thread.finished.connect(thread.deleteLater)
324320
thread.start()
325321
initLoop.exec() # start processing the pending StartupWorker.
326-
splash.finish(editor_window)
322+
splash.close()
327323
splash.deleteLater()
328324

329325
splash_context()
330326

327+
# Create the "window" we'll be looking at.
328+
editor_window = Window()
329+
331330
@editor_window.load_theme.connect
332331
def load_theme(theme):
333332
if theme == "contrast":

tests/test_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ class Win(mock.MagicMock):
248248
assert qa.call_count == 1
249249
# foo.mock_calls are method calls on the object
250250
if hasattr(Qt, "AA_EnableHighDpiScaling"):
251-
assert len(qa.mock_calls) == 10
252-
else:
253251
assert len(qa.mock_calls) == 9
252+
else:
253+
assert len(qa.mock_calls) == 8
254254
assert qsp.call_count == 1
255255
assert len(qsp.mock_calls) == 4
256256
assert ed.call_count == 1
@@ -312,7 +312,7 @@ def start(self, t):
312312
VE, "ensure_and_create"
313313
):
314314
run()
315-
assert splash.finish.call_count == 1
315+
assert splash.close.call_count == 1
316316

317317

318318
def test_excepthook():

0 commit comments

Comments
 (0)