eonpatapon / gnome-shell-extension-caffeine

Disable screensaver and auto suspend
GNU General Public License v2.0
571 stars 107 forks source link

Freezes gnome shell when compiling unity project #332

Open youpie opened 4 months ago

youpie commented 4 months ago

When this extension is enabled. And I build an android APK on unity, gnome shell freezes for a few seconds to a few minutes. I have verified that this extension is causing it by individually enabling and disabling all extensions 1 for 1. Caffeine does not need to be poured for it to freeze, just enabling it causes this.

If you need any logs of extra information, please let me know :)

stuarthayhurst commented 4 months ago

That's very strange, does journalctl -xb have anything to say about it?

youpie commented 4 months ago

in the console i see

mei 30 18:30:19 hendrick-jan gnome-shell[82501]: JS ERROR: TypeError: this._settings is null
                                                 _sync@resource:///org/gnome/shell/ui/dateMenu.js:795:28
                                                 _updateCount@resource:///org/gnome/shell/ui/dateMenu.js:791:14
                                                 _onSourceAdded@resource:///org/gnome/shell/ui/dateMenu.js:778:14
                                                 _addSource@resource:///org/gnome/shell/ui/messageTray.js:857:14
                                                 _onSourceEnableChanged@resource:///org/gnome/shell/ui/messageTray.js:876:22
                                                 add@resource:///org/gnome/shell/ui/messageTray.js:846:14
                                                 _getSourceForApp@resource:///org/gnome/shell/ui/notificationDaemon.js:108:26
                                                 NotifyAsync@resource:///org/gnome/shell/ui/notificationDaemon.js:175:24
                                                 _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35
                                                 _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34
                                                 @resource:///org/gnome/shell/ui/init.js:21:20
mei 30 18:30:19 hendrick-jan gnome-shell[82501]: Object .Gjs_ui_calendar_NotificationSection (0x55846a6b29e0), has been already disposed — impossible to connect to any signal on it. This might be caused by the object having been destroyed from C code using something such as destroy>
                                                 == Stack trace for context 0x558465253b00 ==
                                                 #0   7ffc51501140 b   resource:///org/gnome/shell/misc/signalTracker.js:123 (10e24c487ba0 @ 101)
                                                 #1   7ffc51501200 b   resource:///org/gnome/shell/misc/signalTracker.js:157 (392fad86b290 @ 47)
                                                 #2   7ffc51501300 b   resource:///org/gnome/shell/misc/signalTracker.js:245 (3baaa906a4c0 @ 727)
                                                 #3   7ffc515013d0 b   resource:///org/gnome/shell/ui/environment.js:246 (2527a2ef6330 @ 126)
                                                 #4   7ffc515014b0 b   resource:///org/gnome/shell/ui/calendar.js:869 (2527a2e3d880 @ 48)
                                                 #5   55846531f738 i   resource:///org/gnome/shell/ui/messageTray.js:857 (2527a2e346a0 @ 155)
                                                 #6   55846531f698 i   resource:///org/gnome/shell/ui/messageTray.js:876 (2527a2e347e0 @ 98)
                                                 #7   55846531f5f8 i   resource:///org/gnome/shell/ui/messageTray.js:846 (2527a2e34600 @ 210)
                                                 #8   55846531f558 i   resource:///org/gnome/shell/ui/notificationDaemon.js:108 (33a8a1560740 @ 210)
                                                 #9   55846531f418 i   resource:///org/gnome/shell/ui/notificationDaemon.js:175 (33a8a1560880 @ 1358)
                                                 #10   55846531f338 i   resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373 (3baaa908af10 @ 945)
                                                 #11   55846531f288 i   resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408 (3baaa90920b0 @ 34)
                                                 #12   55846531f1f8 i   resource:///org/gnome/shell/ui/init.js:21 (3baaa9070bf0 @ 48)
mei 30 18:30:19 hendrick-jan gnome-shell[82501]: JS ERROR: TypeError: this._settings is null
                                                 _sync@resource:///org/gnome/shell/ui/dateMenu.js:795:28
                                                 _updateCount@resource:///org/gnome/shell/ui/dateMenu.js:791:14
                                                 _onSourceAdded@resource:///org/gnome/shell/ui/dateMenu.js:778:14
                                                 _addSource@resource:///org/gnome/shell/ui/messageTray.js:857:14
                                                 _onSourceEnableChanged@resource:///org/gnome/shell/ui/messageTray.js:876:22
                                                 add@resource:///org/gnome/shell/ui/messageTray.js:846:14
                                                 _getSourceForApp@resource:///org/gnome/shell/ui/notificationDaemon.js:108:26
                                                 NotifyAsync@resource:///org/gnome/shell/ui/notificationDaemon.js:175:24
                                                 _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35
                                                 _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

however I am not sure this is relevant as it appears a lot in the logs. One thing I do notice is that gnome shell will use 100% cpu of one core, that is probably why it freezes. afbeelding

If you want I can record some video's as proof that only disabling the extension fixes the freezing.

stuarthayhurst commented 4 months ago

Thanks for the log, just to rule out another extension interfering if they don't clean up properly, can you disable all other extensions, reboot and then check it still happens?

youpie commented 3 months ago

Thanks for the log, just to rule out another extension interfering if they don't clean up properly, can you disable all other extensions, reboot and then check it still happens?

Hi,,

I've already done that. Here are my results: If I keep all extensions enabled it lags. If I keep all extensions enabled except caffiene, it doesn't lag. If I disable all extensions it also does not lag. So by that I ruled out any other extensions causing the issue.

stuarthayhurst commented 3 months ago

Ok thanks, the reboot was important since there's no guarantee that extensions clean up properly, just wanted to check :)

Does changing any settings help, such as "Enable for fullscreen apps"?

Weird that this only happens when compiling an APK with Unity, I have no idea how that would be interfering with the extension at all.

youpie commented 3 months ago

I have disabled "enable for fullscreen apps" as it was already enabled. But that did not change the behaviour. I am not 100% certain it only happens when compiling to apk's but that is the only device I need to build for :)

stuarthayhurst commented 3 months ago

Could you test https://github.com/stuarthayhurst/gnome-shell-extension-caffeine/tree/refactor-manager please? My best guess is that something triggered Caffeine to get stuck in a loop with the shell, so this was enough motivation to rewrite some of the extension's tangled logic.

I did try and reproduce this myself, but Unity had absolutely no interest in working at all in my VM, Caffeine or not :/

youpie commented 3 months ago

A quick test running a build with this version enabled did not freeze my shell. So I think indeed this version has fixed the bug. Thank you very much :))