// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ============================================================================
// declarations
// ============================================================================
wxAdoptedWindow* wxReparenter::sm_toReparent = NULL;
wxWindow* wxReparenter::sm_newParent = NULL;
wxString wxReparenter::sm_name;
wxAdoptedWindow* wxReparenter::sm_toReparent = NULL;
wxWindow* wxReparenter::sm_newParent = NULL;
wxString wxReparenter::sm_name;
// If windowName is empty, then wait for the next overrideRedirect window.
bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent,
const wxString& windowName,
// If windowName is empty, then wait for the next overrideRedirect window.
bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent,
const wxString& windowName,
Display* display = wxGlobalDisplay();
XSelectInput(display,
RootWindowOfScreen(DefaultScreenOfDisplay(display)),
Display* display = wxGlobalDisplay();
XSelectInput(display,
RootWindowOfScreen(DefaultScreenOfDisplay(display)),
if (xevent->type == MapNotify && !xevent->xmap.override_redirect &&
(client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name)))
{
wxLogDebug(_T("Found a client window, about to reparent"));
wxASSERT(sm_toReparent->GetParent() == NULL);
if (xevent->type == MapNotify && !xevent->xmap.override_redirect &&
(client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name)))
{
wxLogDebug(_T("Found a client window, about to reparent"));
wxASSERT(sm_toReparent->GetParent() == NULL);
sm_toReparent->SetHandle((WXWindow) client);
sm_newParent->AddChild(sm_toReparent);
sm_done = Reparent(sm_newParent, sm_toReparent);
sm_toReparent->SetHandle((WXWindow) client);
sm_newParent->AddChild(sm_toReparent);
sm_done = Reparent(sm_newParent, sm_toReparent);
sm_toReparent->SetHandle((WXWindow) xevent->xmap.window);
sm_newParent->AddChild(sm_toReparent);
wxASSERT(sm_toReparent->GetParent() == NULL);
sm_toReparent->SetHandle((WXWindow) xevent->xmap.window);
sm_newParent->AddChild(sm_toReparent);
wxASSERT(sm_toReparent->GetParent() == NULL);
Xerror = False;
old = XSetErrorHandler(ErrorHandler);
rvalue = XGetWindowProperty((Display*) wxGetDisplay(),
Xerror = False;
old = XSetErrorHandler(ErrorHandler);
rvalue = XGetWindowProperty((Display*) wxGetDisplay(),
XFree((char *) propreturn);
}
XFetchName((Display*) wxGetDisplay(), (Window) window, &clientName);
XFree((char *) propreturn);
}
XFetchName((Display*) wxGetDisplay(), (Window) window, &clientName);
bool matches;
if (sm_exactMatch)
matches = (name == wxString::FromAscii(clientName));
else
matches = (str1.Contains(str2) || str2.Contains(str1));
bool matches;
if (sm_exactMatch)
matches = (name == wxString::FromAscii(clientName));
else
matches = (str1.Contains(str2) || str2.Contains(str1));
old = XSetErrorHandler(ErrorHandler);
if (!XQueryTree((Display*) wxGetDisplay(), (Window) window, &returnroot, &returnparent,
&children, &numchildren) || Xerror)
old = XSetErrorHandler(ErrorHandler);
if (!XQueryTree((Display*) wxGetDisplay(), (Window) window, &returnroot, &returnparent,
&children, &numchildren) || Xerror)
result = 0;
for (i=0; i<(int)numchildren && !result ;i++) {
result = (Window) FindAClientWindow((WXWindow) children[i], name);
result = 0;
for (i=0; i<(int)numchildren && !result ;i++) {
result = (Window) FindAClientWindow((WXWindow) children[i], name);