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 crash when when swallowed window is closed #5554

Closed
wants to merge 1 commit into from

Conversation

Bartkk0
Copy link

@Bartkk0 Bartkk0 commented Apr 11, 2024

Describe your PR, what does it fix/add?

Fixes a crash when a swallowed window is closed. From what I've discovered it happens randomly depending on which window is closed first, at least it appears to be the cause.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

I don't know if it's the right way to fix this crash, but it works.

Is it ready for merging, or does it need work?

Ready

src/events/Windows.cpp Outdated Show resolved Hide resolved
@Bartkk0 Bartkk0 force-pushed the swallow_crash_fix branch from a2daaa3 to 9a92787 Compare April 11, 2024 19:09
@Bartkk0 Bartkk0 requested a review from vaxerski April 11, 2024 19:27
@@ -687,7 +687,7 @@ void Events::listener_unmapWindow(void* owner, void* data) {
g_pHyprOpenGL->makeWindowSnapshot(PWINDOW);

// swallowing
if (PWINDOW->m_pSwallowed && g_pCompositor->windowExists(PWINDOW->m_pSwallowed)) {
if (PWINDOW->m_pSwallowed && g_pCompositor->windowExists(PWINDOW->m_pSwallowed) && !PWINDOW->m_pSwallowed->m_bReadyToDelete) {
Copy link
Member

Choose a reason for hiding this comment

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

check should be for m_bIsMapped

Copy link
Author

Choose a reason for hiding this comment

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

Tried it, doesn't work

@vaxerski
Copy link
Member

should be fixed by #5548 I think

@Bartkk0
Copy link
Author

Bartkk0 commented Apr 14, 2024

Yeah, compiled the PR and Hyprland no longer crashes, closing.

@Bartkk0 Bartkk0 closed this Apr 14, 2024
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