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

GNOME 45 support #11

Merged
merged 1 commit into from
Jan 23, 2024
Merged

GNOME 45 support #11

merged 1 commit into from
Jan 23, 2024

Conversation

jezek
Copy link
Contributor

@jezek jezek commented Nov 16, 2023

These are minimum changes needed to run on GNOME 45.
Specific changes are described in commit(s).

NOTE: I'm creating this PR as a draft, cause the latch & lock indications are broken when running this PR in GNOME 45 and I still haven't figured out why. I'm a beginner in developing & debugging extensions. If anyone knows how to fix, help is welcome.

- imports changes
- created MyExtension class descended from Extension class
- moved enable and disable function into the class
- changed timeout_add in enable() property to work
- changed supported versions in metadata.json
@sneetsher
Copy link
Owner

Thank you @jezek for the shared effort. I will look into it. Hope they didn't change much.

@sneetsher sneetsher self-requested a review November 19, 2023 15:48
Copy link
Owner

@sneetsher sneetsher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I will continue working on it.

@@ -112,69 +110,66 @@ function _a11y_mods_update(o, latch_new, lock_new) {
// Gnome-shell extension interface
// init, enable, disable

function init() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be moved to class constructor

mods_update_id = seat.connect("kbd-a11y-mods-state-changed", _a11y_mods_update);
};

Main.panel._rightBox.insert_child_at_index(button, 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main.panel._rightBox: To be checked after migration, or go with _indicator


const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';

//
const dbg = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There few global vars here that may need to be moved inside class

};

Main.panel._rightBox.insert_child_at_index(button, 0);
timeout_id = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 200, _update);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Glib for event loop

@jezek
Copy link
Contributor Author

jezek commented Nov 20, 2023

Just a note. What I found out (from enabled logs), that the kbd-a11y-mods-state-changed is not triggering, so the _a11y_mods_update is not called ever.

@jezek
Copy link
Contributor Author

jezek commented Nov 21, 2023

Pardon me my question. You wrote some review comments. I know you also wrote Thank you, I will continue working on it. above, but I just want to be sure that I didn't misunderstood. Are the review comments just for you, or should I implement them?

@sneetsher
Copy link
Owner

@jezek Yeah, they are comments for myself. Just to know where I left off and look for what next check.

By the way, It seems there are more into Gnome 45. I still couldn't get it to enable or show debug logs. I will test upstream Gnome 45 updated demo, probable do a rewrite step by step to find what broken.

@jezek
Copy link
Contributor Author

jezek commented Nov 23, 2023

When testing & debugging I'm using the env GNOME_SHELL_SLOWDOWN_FACTOR=2 MUTTER_DEBUG_DUMMY_MODE_SPECS=1024x768 dbus-run-session -- gnome-shell --nested --wayland command, so I don't have to restart wayland session after making changes. I found out, that after this, the extension logs are being written to the output of the command, so to get just the logs I pipe the whole output to grep and filter just the extension logs (env GNOME_SHELL_SLOWDOWN_FACTOR=2 MUTTER_DEBUG_DUMMY_MODE_SPECS=1024x768 dbus-run-session -- gnome-shell --nested --wayland 2>&1 | grep KMS).

@jezek
Copy link
Contributor Author

jezek commented Dec 21, 2023

Hi @sneetsher , it's me again.

I've been using this extension, with this PR on Manjaro Linux, even when the latch & lock indications didn't work, cause it's more convenient, to see a modifier is pressed even when latch & lock indications aren't shown.

But, after last update, the latch& lock indications started working again. From what I deduce was a bug on gnome side, not a port bug, nor an API change.

@jezek jezek mentioned this pull request Jan 17, 2024
@sneetsher
Copy link
Owner

@jezek I could get some time to test it.

  • Didn't work in Ubuntu 23.10 with gnome-shell 45.2. May be bug not yet fixed there, also it is was an upgrade from 22.04/23.04/23.10 . I will give it another shot with clean install.
  • Work perfect in Fedora 39 with gnome-shell 45.0

Thank you very much for effort. I am merging it.

@sneetsher sneetsher marked this pull request as ready for review January 23, 2024 23:33
@sneetsher sneetsher merged commit 756f1d6 into sneetsher:master Jan 23, 2024
@sneetsher
Copy link
Owner

@jezek I tested Ubuntu 23.10 Vanilla installation. It works perfectly too.

@jezek jezek deleted the gnome45 branch November 30, 2024 22:09
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

Successfully merging this pull request may close these issues.

2 participants