[compiz] [PATCH] Notification on window restacking

Mike Dransfield mike at blueroot.co.uk
Sun Mar 25 08:23:57 PDT 2007


Erkin Bahceci wrote:
> On 3/24/07, Mike Dransfield <mike at blueroot.co.uk> wrote:
>> Erkin Bahceci wrote:
>> > This patch adds notification on window restacking. Plugins may need to
>> > do something when that happens. For example, it is used in the new
>> > version of animation plugin to perform a fade effect when a window
>> > moves above or below other windows (in the plugin's settings this
>> > effect is selected as a focus effect, but it's actually a restack
>> > effect).
>>
>> Are you not able to listen for restacking client messages,
>> or changes to _NET_CLIENT_LIST_STACKING ?
>>
>
> Ok, but that way don't we need to store a list of windows (current
> order) in the plugin and compare the list with the new list when
> _NET_CLIENT_LIST_STACKING changes just to find the window that has
> been restacked (like updateClientListForScreen() does)? (Is there an
> easier way to find that window with the method you suggest?) The
> restacked window is already identified in restackWindow(). Wouldn't it
> be more efficient to use this already available information and send a
> notification from there instead of doing an extra list comparison in
> each plugin that needs that notification?
>

I assume that you are fading the windows up through the other
ones when they change stacking order, if you do then this might
work.

Add a private variable to each window, call it stackNum or something.

Every time the _NET_CLIENT_LIST_STACKING changes, loop up through
the stack and compare the old position to the new position.

You can start looping up from the old position.  If you do not find the
window then it must have gone down.  If it went up, then all the windows
which are between the old position and the new position need to be faded
through.  It should be easy to work out which ones were actually faded
through just because they overlap the window moving up.

Hope this make some sense.





More information about the compiz mailing list