~3v1n0/compiz/gtk-decorator-finalize-menu-0.9.10

« back to all changes in this revision

Viewing changes to tests/xorg-gtest/src/compiz-xorg-gtest.cpp

  • Committer: Tarmac
  • Author(s): Sam Spilsbury
  • Date: 2013-07-18 13:06:24 UTC
  • mfrom: (3745.2.3 compiz.fix_1171314)
  • Revision ID: tarmac-20130718130624-wdwqqxwkrphvu4kv
Don't add the frame to the toplevel stack if it hasn't been created yet.

In the event that a window is unreparented or destroyed, we usually need
to add its frame window to the toplevel window stack until the time at
which we recieve a DestroyNotify for it, as there may be incoming
ConfigureNotify events puporting to stack other windows relative to
that frame.

However, this does not apply in the case where we have not yet received
a CreateNotify for the frame window. In that case, it is not possible
for any stacking requests to be made relative to this window, so it
does not need to be added immediately. Instead, we can add it at the
time that we recieve a CreateNotify for it as a regular override
redirect window until the time that it is later destroyed.

(LP: #1171314). Fixes: https://bugs.launchpad.net/bugs/1171314.

Approved by PS Jenkins bot, MC Return.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
    return parentReturn;
108
108
}
109
109
 
 
110
Window
 
111
ct::GetTopmostNonRootParent (Display *display,
 
112
                             Window  w)
 
113
{
 
114
    Window rootReturn = 0;
 
115
    Window parentReturn = w;
 
116
    Window lastParent = 0;
 
117
 
 
118
    do
 
119
    {
 
120
        lastParent = parentReturn;
 
121
 
 
122
        parentReturn = GetImmediateParent (display,
 
123
                                           lastParent,
 
124
                                           rootReturn);
 
125
 
 
126
    } while (parentReturn != rootReturn);
 
127
 
 
128
    return lastParent;
 
129
}
 
130
 
110
131
bool
111
132
ct::AdvanceToNextEventOnSuccess (Display *dpy,
112
133
                                 bool waitResult)