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

platform_impl/linux/x11: fix deadlock in fn set_fullscreen_inner #1579

Merged
merged 1 commit into from
May 27, 2020

Conversation

BurtonQin
Copy link
Contributor

This is a double-lock bug in windows.rs:
The first lock is at L641 in set_fullscreen_inner():

let mut shared_state_lock = self.shared_state.lock();
if let Some(position) = shared_state_lock.restore_position.take() {
self.set_position_inner(position.0, position.1).queue();

Then set_position_inner() is called, where the second lock is at L988
pub(crate) fn set_position_inner(&self, mut x: i32, mut y: i32) -> util::Flusher<'_> {
// There are a few WMs that set client area position rather than window position, so
// we'll translate for consistency.
if util::wm_name_is_one_of(&["Enlightenment", "FVWM"]) {
let extents = (*self.shared_state.lock()).frame_extents.clone();

The patch drops the MutexGuard before calling set_position_inner() in set_fullscreen_inner().

@kchibisov
Copy link
Member

Could you add a changelog entry mentioning this fix on X11?

@BurtonQin
Copy link
Contributor Author

Sure.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants