sugarlabs / fifty-two-activity

GNU General Public License v2.0
0 stars 5 forks source link

Activity does not quit after pressing Stop button #7

Open SudoSu-bham opened 6 months ago

SudoSu-bham commented 6 months ago

I have tested the activity in Sugar with the GNOME desktop environment. To stop it, I had to manually kill the activity process.

This can be reproduce by

git clone https://github.com/sugarlabs/fifty-two-activity.git
cd fifty-two-activity
sugar-activity3 .
chimosky commented 6 months ago

Did you notice the same issue when starting the activity from the activity ring?

SudoSu-bham commented 6 months ago

Yes, the issue persist when I start the activity from the activity ring.

Started Sugar by typing sugar in the terminal. Launched the fifty-two-activity from the activity ring. After quitting the activity, attempted to logout from Sugar, which resulted in the following error message:

An activity is not responding

Even after Sugar stops, I still observe a PID running with the name sugar-activity3 All other activities are working fine.

chimosky commented 6 months ago

Do the activity logs show anything?

SudoSu-bham commented 6 months ago

All other activities have this output at the end in log Normal successful completion, pid 77032 activity_id eaeb28e94dfdf2cd3284abd215e4cbf27df48d85

but fifty-two-activity does not show anything unusual in logs except that its missing the above line

<frozen importlib._bootstrap>:241: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation.

(sugar-activity3:62931): Gtk-WARNING **: 22:55:51.838: Theme parsing error: gtk-widgets.css:16:32: The style property GtkExpander:expander-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(sugar-activity3:62931): Gtk-WARNING **: 22:55:51.838: Theme parsing error: gtk-widgets.css:17:35: The style property GtkExpander:expander-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version
quozl commented 6 months ago

Works for me. Doesn't work with certain Pygame versions though, I had to upgrade Pygame first. I'm surprised you haven't told us what Pygame version you tried; it should be stated just after typing sugar-activity3.

quozl commented 6 months ago

Oh, and really doubt that typing sugar inside GNOME will give meaningful results. That's not how we run Sugar. It's like typing gnome-session inside KDE. Result will be conflicting desktop services.

SudoSu-bham commented 6 months ago

I am using pygame 2.5.2 (SDL 2.30.0, Python 3.11.8) and its the latest version. There is a guide for using sugar with another desktop environment I was following that only. am I doing something wrong? However I have tried to run the activity from the activity ring, while I was using Sugar as a Desktop Environment and I got the error message again An activity is not responding.

quozl commented 6 months ago

Given that we can't reproduce the issue, you're best placed to work it further.

Log in as a Sugar session as described in fedora.md, start Terminal from the Sugar activity ring (type Term, wait for it to autocomplete, press enter), then change directory to the activity, and use "sugar-activity3" there. That will exclude GNOME.

Note that fedora.md never said to type sugar. Let's get away from that, as it isn't how we use it.

What release of Fedora are you using?

SudoSu-bham commented 6 months ago

I am using Fedora 39. I have tested Fifty-two-activity on VirtualBox with fedora 39 and ubuntu 22.04 LTS. They both showed the same result. When I stop all other activities their logs has this Normal successful completion, pid 77032 activity_id eaeb28e94dfdf2cd3284abd215e4cbf27df48d85 at the end. While Fifty-two-activity doesn't have this, instead when I was testing it on Ubuntu. Terminated by signal 9, pid 1357 activity_id eaeb28e9eaeb28d3284ab4dfdf2cbf27dd215e4c appeared in logs after 50-60 seconds. I have tried to provide as much details as I can. However I will work on it further.

quozl commented 6 months ago

Thanks.

The activity calls show_all but the Sugargame test activity does not.

The activity handles a size-changed signal on the Gdk screen by calling pygame.display.set_mode, but the Sugargame test activity handles the Pygame signal instead.

The activity calls pygame.init in the Game.run method, but the Sugargame test activity does not do this.

My guess is that the activity had not been ported to Sugargame 1.3 yet, even though the source files of Sugargame were changed the cascade of redesigning in the calling functions was not done.

This reminds me, so I checked the code and repository state. https://github.com/sugarlabs/fifty-two-activity/pull/5 is yet to be merged, and has a fix for the problem you describe. Please try the fix. Thanks.