Revert "skip double focus taking"

The commit actually introduced an windowEvent processing for new created clients
and caused

BUG: 290392
FIXED-IN: 4.8.1

This makes the original code a bit more straight and less confusing and
effectively reverts commit ce97e4fd586ff225f2b2e8c5042baf6821bc52c0.
This commit is contained in:
Thomas Lübking 2012-02-03 23:31:13 +01:00
parent b2c81216a2
commit 993f4ba583

View file

@ -342,29 +342,23 @@ bool Workspace::workspaceEvent(XEvent * e)
case MapRequest: {
updateXTime();
// e->xmaprequest.window is different from e->xany.window
// TODO this shouldn't be necessary now
Client* c = findClient(WindowMatchPredicate(e->xmaprequest.window));
if (!c) {
// don't check for the parent being the root window, this breaks when some app unmaps
// a window, changes something and immediately maps it back, without giving KWin
// a chance to reparent it back to root
// since KWin can get MapRequest only for root window children and
// children of WindowWrapper (=clients), the check is AFAIK useless anyway
// Note: Now the save-set support in Client::mapRequestEvent() actually requires that
// this code doesn't check the parent to be root.
// if ( e->xmaprequest.parent == root ) {
if (c = createClient(e->xmaprequest.window, false))
c->windowEvent(e);
else // refused to manage, simply map it (most probably override redirect)
XMapRaised(display(), e->xmaprequest.window);
return true;
} else {
if (Client* c = findClient(WindowMatchPredicate(e->xmaprequest.window))) {
// e->xmaprequest.window is different from e->xany.window
// TODO this shouldn't be necessary now
c->windowEvent(e);
updateFocusChains(c, FocusChainUpdate);
return true;
} else if ( true /*|| e->xmaprequest.parent != root */ ) {
// NOTICE don't check for the parent being the root window, this breaks when some app unmaps
// a window, changes something and immediately maps it back, without giving KWin
// a chance to reparent it back to root
// since KWin can get MapRequest only for root window children and
// children of WindowWrapper (=clients), the check is AFAIK useless anyway
// NOTICE: The save-set support in Client::mapRequestEvent() actually requires that
// this code doesn't check the parent to be root.
if (!createClient(e->xmaprequest.window, false))
XMapRaised(display(), e->xmaprequest.window);
}
break;
return true;
}
case MapNotify: {
if (e->xmap.override_redirect) {