-
Notifications
You must be signed in to change notification settings - Fork 72
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
Show loading screen on startup #581
base: master
Are you sure you want to change the base?
Conversation
Adds a loading screen shown on startup. Also refactors library and window classes to reduce coupling and move most of the slow work done in the window constructor to library.initialize().
Adds game ids for "Cyberpunk 2077 Digital Goodies" and "Xenonauts 2 alpha demo".
9c60040
to
58e8c47
Compare
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.
I'm seeing some issues on my system. First time I started it, Minigalaxy froze and the main window was not shown at all. Now I've tried again a couple of times and I'm seeing this:
wouter@wouter-gridscale:~/Personal/minigalaxy$ bin/minigalaxy
(minigalaxy:31402): Gtk-CRITICAL **: 11:21:59.893: gtk_widget_get_toplevel: assertion 'GTK_IS_WIDGET (widget)' failed
(minigalaxy:31402): Gtk-CRITICAL **: 11:21:59.893: _gtk_widget_captured_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
wouter@wouter-gridscale:~/Personal/minigalaxy$ bin/minigalaxy
(minigalaxy:31444): Gdk-ERROR **: 11:22:08.672: The program 'minigalaxy' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadImplementation (server does not implement operation)'.
(Details: serial 528 error_code 17 request_code 20 (core protocol) minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)
I think there is an issue with multithreading again. Threads outside of the main thread cannot use gtk objects without potentially causing crashes. Using Glib.idle_add
prevents this issue, by scheduling it on the main thread. I'm not sure if the main thread does not get stuck somewhere, though.
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.
Could you use the Minigalaxy logo that's used for the about window instead of this one?
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.
Will do.
I was testing this on Ubuntu 22.04. Just so you know. When I tested this on Debian earlier, it was working. It's a bit odd. |
Sorry it took this long to review this. I really appreciate the work! Thanks! |
Thanks for the review! I suspect there could be a race condition where the
GTK work is sometimes done on the main thread (and working as expected) and
sometimes done on a separate thread (and crashing). I will do another pass
through the code and use GTK.idle_add where necessary.
I will also replace the image.
…On Thu, 5 Oct 2023, 11:26 Wouter Wijsman, ***@***.***> wrote:
I was testing this on Ubuntu 20.04. Just so you know. When I tested this
on Debian earlier, it was working. It's a bit odd.
—
Reply to this email directly, view it on GitHub
<#581 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOGO5KANTCEQVUWML27LATX5Z4MZAVCNFSM6AAAAAA4OQFWF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBYGQ3TGMZZGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
After moving the GUI-related function calls in |
Thanks for the update! I appreciate the work you put in this. I'm sorry for not getting back to you earlier, I had quite the situation in my private life. Now I'll be able to support you again, though, so let me know if I can do anything. |
Description
Adds a loading screen (splash screen) that is shown during application startup so that the application does not appear unresponsive if e.g. the network is slow. I moved most of the heavy initialization work from the Window class constructor to the
library.initialize()
method. In order to get the splash screen to work, some changes to initialization order had to be done in theminigalaxy
file, and the initialization in the Library class had to be moved to a thread so that the GTK initialization was not blocked.Additionally, the related unit tests were updated, an AI-generated splash screen image was added and two additional useless game ids were added to the
constants.py
file.This PR solves #575 .
Checklist