Skip to content

Commit

Permalink
Unset override-redirect flag when docking, instead of preventing dock
Browse files Browse the repository at this point in the history
Apparently some applications do try to dock override-redirect window.
While in theory it is harmless (override-redirect flag applies to top
level windows only), QSB-072 shows that both window manager
and gui-daemon can be easily confused about who should manage such
window, when combined with other features/states. For this reason, unset
the override redirect flag before docking the window. This avoids having
unexpected override-redirect toplevel window if the panel (dock) is ever
terminated.
  • Loading branch information
marmarek committed Sep 29, 2021
1 parent fc03906 commit 157ca14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gui-daemon/xside.c
Original file line number Diff line number Diff line change
Expand Up @@ -3055,9 +3055,15 @@ static void handle_dock(Ghandles * g, struct windowdata *vm_window)
return;
}
if (vm_window->override_redirect) {
fprintf(stderr, "cannot dock override-redirect window 0x%x\n",
XSetWindowAttributes attr;
fprintf(stderr, "docking an override-redirect window 0x%x - "
"clearing override-redirect\n",
(int) vm_window->local_winid);
return;
/* changing directly is safe, because window is not mapped here yet */
attr.override_redirect = vm_window->override_redirect;
XChangeWindowAttributes(g->display, vm_window->local_winid,
CWOverrideRedirect, &attr);
vm_window->override_redirect = 0;
}
if (vm_window->parent) {
fprintf(stderr, "cannot dock non-top level window 0x%x\n",
Expand Down

0 comments on commit 157ca14

Please sign in to comment.