mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Flush the reparent from 0c7dbe8
This should add a root reparent to prevent that X11 error, but it should still prevent flickering by doing it just before closing the window.
This commit is contained in:
@@ -147,12 +147,18 @@ DeferredWindow::~DeferredWindow() {
|
|||||||
// Note that we capture a copy of `destroy_timer` here. This way we don't
|
// Note that we capture a copy of `destroy_timer` here. This way we don't
|
||||||
// have to manage the timer instance ourselves as it will just clean itself
|
// have to manage the timer instance ourselves as it will just clean itself
|
||||||
// up after this lambda gets called.
|
// up after this lambda gets called.
|
||||||
destroy_timer->async_wait([destroy_timer, handle = this->handle](
|
destroy_timer->async_wait([destroy_timer, handle = this->handle,
|
||||||
|
x11_connection = this->x11_connection](
|
||||||
const boost::system::error_code& error) {
|
const boost::system::error_code& error) {
|
||||||
if (error.failed()) {
|
if (error.failed()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is the flush for the reparent done above. We'll also do this as
|
||||||
|
// late as possible to prevent the window from being drawn in the
|
||||||
|
// meantime, as that would cause flickering.
|
||||||
|
xcb_flush(x11_connection.get());
|
||||||
|
|
||||||
// The actual destroying will happen as part of the Win32 message loop
|
// The actual destroying will happen as part of the Win32 message loop
|
||||||
PostMessage(handle, WM_CLOSE, 0, 0);
|
PostMessage(handle, WM_CLOSE, 0, 0);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user