swpanel: Fix focus issue when alt-tabbing
commit12b6be768e0fd8b976f1ae823c803a8f6af84302
authorCarlos R. Mafra <crmafra@gmail.com>
Sat, 19 Sep 2009 12:16:05 +0000 (19 14:16 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sat, 19 Sep 2009 14:07:47 +0000 (19 16:07 +0200)
treeb0559ef992f907eb02b40e92a0a2eaf81f49de79
parent6a0120f0149de7ff0e2bce0cf63976a1ca795f8a
swpanel: Fix focus issue when alt-tabbing

The problem was the following. While alt-tabbing from one
window to a xterm, wait for the xterm to be raised but
keep the alt key pressed. Now move the mouse cursor
over the xterm and release the alt key.

The result is a xterm in a zoombie focused state; its titlebar
has the focused color but xterm itself is not focused and does
not accept any input.

Fix this by reinstating the check for a NULL pointer from
wSwitchPanelHandleEvent() before changing focus. That function
detects if the mouse cursor moved over to the same window which
is currently being pointed out by the switchpanel, and returns
NULL in this case (the check for panel->current != focus fails).

Thanks to Paul Harris for reporting it!
src/cycling.c