Fix screen messing up if client docking fails

The client window has to be added to the save set after it has been
reparented. Otherwise if the reparenting fails weird stuff happens
(windows in the save set have to be child windows of windows created by
the current connection).
This commit is contained in:
patrick96 2022-03-07 12:20:45 +01:00
parent ab7612ea4a
commit 9544130b9c
No known key found for this signature in database
GPG Key ID: 521E5E03AEBCA1A7

View File

@ -727,9 +727,6 @@ void tray_manager::process_docking_request(xcb_window_t win) {
m_log.trace("tray: Configure client size"); m_log.trace("tray: Configure client size");
client.reconfigure(0, 0); client.reconfigure(0, 0);
m_log.trace("tray: Add client window to the save set");
m_connection.change_save_set_checked(XCB_SET_MODE_INSERT, client.window());
// TODO properly support tray icon backgrounds // TODO properly support tray icon backgrounds
auto p = XCB_BACK_PIXMAP_NONE; auto p = XCB_BACK_PIXMAP_NONE;
m_connection.change_window_attributes_checked(client.window(), XCB_CW_BACK_PIXMAP, &p); m_connection.change_window_attributes_checked(client.window(), XCB_CW_BACK_PIXMAP, &p);
@ -737,6 +734,9 @@ void tray_manager::process_docking_request(xcb_window_t win) {
m_connection.reparent_window_checked( m_connection.reparent_window_checked(
client.window(), m_tray, calculate_client_x(client.window()), calculate_client_y()); client.window(), m_tray, calculate_client_x(client.window()), calculate_client_y());
m_log.trace("tray: Add client window to the save set");
m_connection.change_save_set_checked(XCB_SET_MODE_INSERT, client.window());
if (client.is_xembed_supported()) { if (client.is_xembed_supported()) {
m_log.trace("tray: Send embbeded notification to client"); m_log.trace("tray: Send embbeded notification to client");
xembed::notify_embedded(m_connection, client.window(), m_tray, client.get_xembed().get_version()); xembed::notify_embedded(m_connection, client.window(), m_tray, client.get_xembed().get_version());