// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: (c) Julian Smart
// 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;
old = XSetErrorHandler(ErrorHandler);
XReparentWindow( wxGlobalDisplay(),
old = XSetErrorHandler(ErrorHandler);
XReparentWindow( wxGlobalDisplay(),
- (Window) toReparent->GetMainWindow(),
- (Window) newParent->GetMainWindow(),
+ (Window) toReparent->X11GetMainWindow(),
+ (Window) newParent->X11GetMainWindow(),
&returnroot, &returnparent,
&children, &numchildren) || Xerror)
{
XSetErrorHandler(old);
&returnroot, &returnparent,
&children, &numchildren) || Xerror)
{
XSetErrorHandler(old);
"Reparenting child at offset %d and position %d, %d.\n",
parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
XReparentWindow( wxGlobalDisplay(),
"Reparenting child at offset %d and position %d, %d.\n",
parentOffset, parentOffset+xwa.x, parentOffset+xwa.y);
XReparentWindow( wxGlobalDisplay(),
// 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)))
{
if (xevent->type == MapNotify && !xevent->xmap.override_redirect &&
(client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name)))
{
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);