[compiz] Focus problem for shaded windows
Danny Baumann
dannybaumann at web.de
Mon Aug 6 01:15:36 PDT 2007
>> today, I noticed a problem in focus handling for shaded windows which is
>> pretty easy to reproduce:
>>
>> - Disable "Click to focus"
>> - Shade a window
>> - Hover another window
>> - Hover back to the window frame of the shaded window
>> - Press Ctrl+Alt+S
>>
>> Expected behaviour would be that the shaded window is unshaded. What
>> happens is that the last active window is shaded.
>>
>> I investigated this a bit and found the cause for this behaviour, but
>> wasn't able to work out a proper fix for that:
>> - The function shade() uses d->activeWindow to determine the window to
>> (un)shade via the "window" option.
>> - d->activeWindow is set from the FocusIn event handler, but only if
>> w->managed is set for the window which is hovered or whose frame is
>> hovered
>> - As w->managed is unset in the UnmapNotify handler (and so after a
>> window is shaded), hovering a shaded window frame does not set
>> d->activeWindow to that window.
>>
>> Any idea regarding that one?
> w->managed should not be unset when getting an UnmapNotify event cause
> by shading. The window is still managed by compiz while being shaded.
> w->pendingUnmaps should be greater than 1 when a window is shaded but I
> guess that's broken somehow...
You are right. This also works as intended. I walked a false path there, sorry.
The real problem is that we don't select for FocusChange events for frame windows and thus never get FocusIn events for them.
Correcting this revealed another problem: The lastFoundWindow variable was (IMO incorrectly) sometimes also set to frame windows.
The attached patch seems to do the trick - any comments?
Regards,
Danny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: focus-shaded-windows-fix.diff
Type: text/x-patch
Size: 1254 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070806/4f1aaf25/attachment.bin
More information about the compiz
mailing list