x11: Send window maximization hints correctly (#363)

Previously, the maximization hints were being sent as two separate client messages: one for
horizontal, and one for vertical. That resulted in the window only being maximized
horizontally (at least with my WM). The corrected client message sets both of these hints at
once.

In the process of implementing that, the relevant components were refactored to use the util
module, as we gradually move towards a hopeful future of a more readable X11 backend.
This commit is contained in:
Francesca Sunshine 2017-12-15 14:37:09 -05:00 committed by GitHub
parent 9698d0a8d8
commit 8f18dab061
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 105 additions and 60 deletions

View file

@ -276,12 +276,15 @@ impl EventsLoop {
// This results in the SelectionNotify event below
self.dnd.convert_selection(xwindow, time);
}
self.dnd.send_status(xwindow, source_window, DndState::Accepted);
self.dnd.send_status(xwindow, source_window, DndState::Accepted)
.expect("Failed to send XDnD status message.");
}
} else {
unsafe {
self.dnd.send_status(xwindow, source_window, DndState::Rejected);
self.dnd.send_finished(xwindow, source_window, DndState::Rejected);
self.dnd.send_status(xwindow, source_window, DndState::Rejected)
.expect("Failed to send XDnD status message.");
self.dnd.send_finished(xwindow, source_window, DndState::Rejected)
.expect("Failed to send XDnD finished message.");
}
self.dnd.reset();
}
@ -296,7 +299,8 @@ impl EventsLoop {
}
}
unsafe {
self.dnd.send_finished(xwindow, source_window, DndState::Accepted);
self.dnd.send_finished(xwindow, source_window, DndState::Accepted)
.expect("Failed to send XDnD finished message.");
}
}
self.dnd.reset();