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 on closing last active window. #71

Merged
merged 1 commit into from
Aug 8, 2020

Conversation

foobarbyte
Copy link

As described in #61, the plugin currently crashes frequently. This can reliably be reproduced by setting the plugin to track active windows, and not show on the desktop. Then closing the last non-minimised window on a workspace will always cause the window title plugin to crash. This commit fixes this by checking whether the controlwindow argument of in on_name_changed refers to a window belonging to an existing process.

When on_name_changed is called, controlwindow may refer to a window that has been closed. If so, this leads to is_window_on_active_workspace_and_no_other_maximized_windows_above causing a segmentation fault when top_window turns out to be NULL. Since we would like to clear the displayed window title in this case, we should first check whether controlwindow refers to a closed window. It makes sense to do this where we already check if it is NULL or if it refers to the Desktop. We can check this by determining whether the window has a valid PID using wnck_window_get_pid.
@takinoy takinoy merged commit 3f1c860 into takinoy:master Aug 8, 2020
@takinoy
Copy link
Owner

takinoy commented Aug 8, 2020

Thank you for your contribution

@qarkai qarkai mentioned this pull request Dec 21, 2020
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.

None yet

2 participants