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

Update extension.js #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

road2react
Copy link
Contributor

Fixes #180

@@ -245,9 +247,25 @@ class ClipboardIndicator extends PanelMenu.Button {
this.menu.actor.connect('key-press-event', (_, event) =>
this._handleGlobalKeyEvent(event),
);

this._settingsChangedId = this.settings.connect(
Copy link
Owner

Choose a reason for hiding this comment

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

Why are these changes necessary? I believe they'll cause a crash if fields like entries haven't been initialized yet.

Copy link
Contributor Author

@road2react road2react Aug 7, 2024

Choose a reason for hiding this comment

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

There's a race condition that occurs if entries disappear before Store.buildClipboardStateFromLog is finished.

this.searchEntry.get_clutter_text() segfaults since the searchEntry UI element no longer exists in the shell when locking the screen.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes but isn't the point of the isDestroying variable to avoid calling that code? Why do we need both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isDestroying wasn't enough in my testing, I still got segfaults using that variable

Copy link
Owner

Choose a reason for hiding this comment

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

Huh, well that's annoying. Do you know why? To me that means this code isn't actually related because I don't see how it could possible be run if you have the destroying flag is set.

I'd really like to know why the flag doesn't work, but we can also flip the problem around. Add an _isLoaded variable that we set to true at the end of buildClipboardStateFromLog and then check for it in each of the callbacks. _setupSelectionChangeListener will be annoying cuz you'll have to add the if check inside the relevant callbacks initialized by that method.

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.

GNOME segfaults on rapid screen lock/unlock with extension enabled
2 participants