Пример #1
0
    ///////////////////////////////////////////////////////////////////////
    ///  Function: ProcessPeekXEvent
    ///
    ///    Author: $author$
    ///      Date: 8/16/2012
    ///////////////////////////////////////////////////////////////////////
    virtual bool ProcessPeekXEvent()
    {
        Display* xDisplay;
        XEvent* xEvent;

        if ((xDisplay = m_display.Attached()))
        if ((xEvent = (XEvent*)(m_event)))
        if ((PeekXEvent(*xEvent, *xDisplay)))
            return ProcessXEvent(*xEvent, *xDisplay);

        return false;
    }
Пример #2
0
// Wait for an appropriate window to be created.
// If exactMatch is FALSE, a substring match is OK.
// If windowName is empty, then wait for the next overrideRedirect window.
bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent,
                                   const wxString& windowName,
                                   bool exactMatch)
{
    sm_newParent = newParent;
    sm_toReparent = toReparent;
    sm_exactMatch = exactMatch;
    sm_name = windowName;
    
    Display* display = wxGlobalDisplay();
    XSelectInput(display,
        RootWindowOfScreen(DefaultScreenOfDisplay(display)),
        SubstructureNotifyMask);

    if (!WM_STATE)
        WM_STATE = XInternAtom(display, "WM_STATE", False);

#ifdef __WXDEBUG__
    if (!windowName.IsEmpty())
        wxLogDebug(_T("Waiting for window %s"), windowName.c_str());
#endif
    
    sm_done = FALSE;

    wxEventLoop eventLoop;
    while (!sm_done)
    {
        if (eventLoop.Pending())
        {
            XEvent xevent;
            XNextEvent(display, & xevent);
            if (!wxTheApp->ProcessXEvent((WXEvent*) & xevent))
            {
                // Do the local event processing
                ProcessXEvent((WXEvent*) & xevent);
            }
        }
        else
        {
#if wxUSE_TIMER
            wxTimer::NotifyTimers();
            wxTheApp->ProcessIdle();
#endif
        }
    }
    return TRUE;
}
Пример #3
0
// Wait for an appropriate window to be created.
// If exactMatch is false, a substring match is OK.
// If windowName is empty, then wait for the next overrideRedirect window.
bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent,
                                   const wxString& windowName,
                                   bool exactMatch)
{
    sm_newParent = newParent;
    sm_toReparent = toReparent;
    sm_exactMatch = exactMatch;
    sm_name = windowName;

    Display* display = wxGlobalDisplay();
    XSelectInput(display,
        RootWindowOfScreen(DefaultScreenOfDisplay(display)),
        SubstructureNotifyMask);

    if (!WM_STATE)
        WM_STATE = XInternAtom(display, "WM_STATE", False);

    sm_done = false;

    wxEventLoop eventLoop;
    while (!sm_done)
    {
        if (eventLoop.Pending())
        {
            XEvent xevent;
            XNextEvent(display, & xevent);
            if (!wxTheApp->ProcessXEvent((WXEvent*) & xevent))
            {
                // Do the local event processing
                ProcessXEvent((WXEvent*) & xevent);
            }
        }
        else
        {
#if wxUSE_TIMER
            wxGenericTimerImpl::NotifyTimers();
            wxTheApp->ProcessIdle();
#endif
        }
    }
    return true;
}