Currently I use Xlib for just one function XRestackWindows, rest is XCB and QT5. The requirement is to use only XCB and QT5.
I would like to know a way to have a proper XRestackWindows in XCB, I have tried a solution from here but the windows would flash
It must work almost exactly how it does in XLIB. No windows flashes upon restack, if I restack same order of windows then no screen flash should occur.
XCB code that didn’t work well (issue: flashed windows upon restack):
void restackWindows(std::vector<xcb_window_t> list)
{
xcb_connection_t *conn = QX11Info::connection();
unsigned int arg[1] = { XCB_STACK_MODE_ABOVE };
for ( auto win : list )
{
xcb_configure_window(conn, win, XCB_CONFIG_WINDOW_STACK_MODE, arg);
}
xcb_flush(conn);
}
Note: I have tried diferent methods without luck, I have been looking at XRestackWindows function, it appears they use LockDisplay and UnlockDisplay, I couldn't find it in XCB.