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

fix: avoid activating a window that was/is being destroyed #1573

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

mmstick
Copy link
Member

@mmstick mmstick commented Jan 23, 2023

@masip85 Check if this fixes the issue

Closes #1572

@mmstick mmstick requested review from a team January 23, 2023 14:22
@jacobgkau jacobgkau self-assigned this Jan 23, 2023
Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

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

Regression testing passed: shell-pr1537-jammy.txt

@Arcitec
Copy link

Arcitec commented Feb 5, 2023

@mmstick Hi, just checking if there's a typo in this part of the patch:

    actor_exists(): boolean {
        return this.meta.get_compositor_private() !== null || this.destroying;
    }

So this thing says that the actor exists "if the actor has a non-null compositor assignment, or if it LACKS a compositor assignment BUT the actor window is currently being destroyed".

Is that intentional? Or should it have said the following instead:

    actor_exists(): boolean {
        // compositor exists and window is not currently in the process of being destroyed
        return this.meta.get_compositor_private() !== null && !this.destroying;
    }

Logically the latter seems to make more sense, at a glance. But there could be some reason for the "weird" logic that I'm totally missing!

@mmstick
Copy link
Member Author

mmstick commented Feb 5, 2023

Yeah, should be !destroying.

@Arcitec
Copy link

Arcitec commented Feb 9, 2023

@mmstick Sweet, I see that the fix has been committed:

a08804d#diff-9e13cab61f6b4bbb06ef29422f0dc0251bcdfd15a9f139008b491f7d1a78e981R129-R131

I'm just curious about one thing to make sure: Is it proper to treat a window actor as "existing" even if it lacks a compositor? The || confuses me, since I had thought && might make more sense there?

But I suppose that an actor can exist, not be in a destructing state, and not be assigned to any compositor, but still be a valid actor? In that case, yeah the final || makes sense there. :) 👍

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.

Attempting to run a JS callback during garbage collection - forever spewing syslog
4 participants