Skip to content
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

Fails to load in Cinnamon 6.4.0 #76

Open
acmpo6ou opened this issue Nov 29, 2024 · 7 comments
Open

Fails to load in Cinnamon 6.4.0 #76

acmpo6ou opened this issue Nov 29, 2024 · 7 comments

Comments

@acmpo6ou
Copy link

Hello! Thanks for creating this wonderful applet.

I'm on Arch Linux, and after a recent update of Cinnamon, the applet doesn't work anymore. Here is the log that I get:

Gjs-Message: 15:38:21.658: JS LOG: [LookingGlass/error] 
[[email protected]]: GObject_Object.prototype._init called on incompatible Object
[[email protected]]: Failed to evaluate 'main' function on applet: [email protected]/16
Gjs-Message: 15:38:21.658: JS LOG: [LookingGlass/trace] 
<----------------
_init@/usr/share/cinnamon/js/ui/overrides.js:33:22
_init@/usr/share/cinnamon/js/ui/modalDialog.js:70:15
_init@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:1001:49
PomodoroSetFinishedDialog@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:994:16
_createLongBreakDialog@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:721:22
_init@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:117:38
PomodoroApplet@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:52:16
main@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:46:20
createApplet@/usr/share/cinnamon/js/ui/appletManager.js:597:25
addAppletToPanels@/usr/share/cinnamon/js/ui/appletManager.js:372:34
finishExtensionLoad@/usr/share/cinnamon/js/ui/appletManager.js:98:14
_init/<@/usr/share/cinnamon/js/ui/extension.js:286:32
---------------->

The applet doesn't show up on the taskbar, but I'm able to open its settings in Cinnamon Settings -> Applets, and finding the applet there.

Is there a fix for this? Thank you.

@gfreeau
Copy link
Owner

gfreeau commented Nov 30, 2024

First I've heard of this issue but happy to help figure it out. Looks like something changed in how to extend from ModalDialog. Can you confirm you are using the latest version of applet.js in this repo or have you made any changes to it? I just want to work from the same code you have.

I can see https://github.com/linuxmint/cinnamon/blob/master/js/ui/modalDialog.js has updated ModalDialog to now extend St.Widget and so the error is the _init function needs to be called directly in the newer versions.

@gfreeau
Copy link
Owner

gfreeau commented Nov 30, 2024

I haven't tested this yet but in applet.js there is 3 dialog windows created.

PomodoroSetFinishedDialog
PomodoroShortBreakFinishedDialog
PomodoroFinishedDialog

In the constructor of each just try replacing super(); with super._init();

e.g

class PomodoroSetFinishedDialog extends ModalDialog.ModalDialog {
    constructor() {
        super._init();
        this._subjectLabel = new St.Label();
        this.contentLayout.add(this._subjectLabel);

Then restart cinnamon and check the logs again.

@gfreeau
Copy link
Owner

gfreeau commented Nov 30, 2024

Also give this branch a try: master...fix-modal-dialog

I will have more time to test next week and get the newer cinnamon versions installed but let me know how you go.

@acmpo6ou
Copy link
Author

Thank you for your quick replies. I tried your branch, just copied the [email protected] folder to .local/share/cinnamon/applets/.

But it still doesn't work, here is the new log:

Gjs-Message: 12:22:50.890: JS LOG: [LookingGlass/error] 
[[email protected]]: Tried to construct an object without a GType
[[email protected]]: Failed to evaluate 'main' function on applet: [email protected]/25
Gjs-Message: 12:22:50.890: JS LOG: [LookingGlass/trace] 
<----------------
ModalDialog@/usr/share/cinnamon/js/ui/modalDialog.js:61:4
PomodoroSetFinishedDialog@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:842:1
_createLongBreakDialog@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:619:33
PomodoroApplet@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:111:14
main@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:43:12
createApplet@/usr/share/cinnamon/js/ui/appletManager.js:597:25
addAppletToPanels@/usr/share/cinnamon/js/ui/appletManager.js:372:34
finishExtensionLoad@/usr/share/cinnamon/js/ui/appletManager.js:98:14
_init/<@/usr/share/cinnamon/js/ui/extension.js:286:32
---------------->
Gjs-Message: 12:22:50.890: JS LOG: [LookingGlass/error] 
[[email protected]]: Applet [email protected]: Could not create applet object.
[[email protected]]: Error importing applet.js from [email protected]
Gjs-Message: 12:22:50.890: JS LOG: [LookingGlass/trace] 
<----------------
_init/<@/usr/share/cinnamon/js/ui/extension.js:287:23
---------------->

@gfreeau
Copy link
Owner

gfreeau commented Nov 30, 2024

Ok we're definitely on the right track with the fix. I just made a new commit I'd like you to try, it's in the same branch: bc8f286

The applet was using class inheritance to extend Cinnamon's ModalDialog class. This approach broke in newer versions of Cinnamon which require proper GObject class registration.

I switched from using class inheritance to factory functions for creating dialog windows. This change should make the applet work with both old and new versions of Cinnamon.

I have tested this on Cinnamon 6.0.4. I will get to testing it on 6.4.0 but please give it a try first.

@acmpo6ou
Copy link
Author

I got a new error:

Gjs-Message: 21:07:23.699: JS LOG: [LookingGlass/error] 
[[email protected]]: No signal 'switch-off-pomodoro' on object 'Gjs_ui_modalDialog_ModalDialog'
[[email protected]]: Failed to evaluate 'main' function on applet: [email protected]/25
Gjs-Message: 21:07:23.699: JS LOG: [LookingGlass/trace] 
<----------------
_createLongBreakDialog@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:621:31
PomodoroApplet@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:111:14
main@/home/sun/.local/share/cinnamon/applets/[email protected]/applet.js:43:12
createApplet@/usr/share/cinnamon/js/ui/appletManager.js:597:25
addAppletToPanels@/usr/share/cinnamon/js/ui/appletManager.js:372:34
finishExtensionLoad@/usr/share/cinnamon/js/ui/appletManager.js:98:14
_init/<@/usr/share/cinnamon/js/ui/extension.js:286:32
---------------->
Gjs-Message: 21:07:23.699: JS LOG: [LookingGlass/error] 
[[email protected]]: Applet [email protected]: Could not create applet object.
[[email protected]]: Error importing applet.js from [email protected]
Gjs-Message: 21:07:23.699: JS LOG: [LookingGlass/trace] 
<----------------
_init/<@/usr/share/cinnamon/js/ui/extension.js:287:23
---------------->

@gfreeau
Copy link
Owner

gfreeau commented Nov 30, 2024

Leave it with me, signal handling has also changed. Existing ModalDialog has Signals.addSignalMethods(ModalDialog.prototype); added automatically whereas this new set up is using something else. Other applets are affected by 6.4.0 in the same way so I will see if we can drive a fix there for all applets. Kind of annoying to introduce a breaking change like this in Cinnamon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants