X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4125131be6577c7770c9991b22fee98eff9e0e7f..fb7b53892f14285e5c662c3bead9bf0729bd6a51:/src/x11/app.cpp diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 9f7b82c9d7..d45ff95d4a 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -26,6 +26,9 @@ #include "wx/intl.h" #include "wx/evtloop.h" +#include "wx/univ/theme.h" +#include "wx/univ/renderer.h" + #if wxUSE_THREADS #include "wx/thread.h" #endif @@ -248,7 +251,7 @@ int wxEntryStart( int& argc, char *argv[] ) XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask); -// wxSetDetectableAutoRepeat( TRUE ); + wxSetDetectableAutoRepeat( TRUE ); if (!wxApp::Initialize()) return -1; @@ -481,8 +484,8 @@ void wxApp::ProcessXEvent(WXEvent* _event) if (win && !win->IsEnabled()) return; - Atom wm_delete_window = XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True);; - Atom wm_protocols = XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True);; + Atom wm_delete_window = XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True); + Atom wm_protocols = XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True); if (event->xclient.message_type == wm_protocols) { @@ -541,9 +544,12 @@ void wxApp::ProcessXEvent(WXEvent* _event) win->GetClearRegion().Union( event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height); - - // if (event->xexpose.count == 0) - // win->Update(); + + if (event->xexpose.count == 0) + { + // Only erase background, paint in idle time. + win->SendEraseEvents(); + } } return; @@ -552,9 +558,9 @@ void wxApp::ProcessXEvent(WXEvent* _event) { if (win) { - wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(), - event->xgraphicsexpose.x, event->xgraphicsexpose.y, - event->xgraphicsexpose.width, event->xgraphicsexpose.height); + // wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(), + // event->xgraphicsexpose.x, event->xgraphicsexpose.y, + // event->xgraphicsexpose.width, event->xgraphicsexpose.height); win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, event->xgraphicsexpose.width, event->xgraphicsexpose.height); @@ -562,8 +568,11 @@ void wxApp::ProcessXEvent(WXEvent* _event) win->GetClearRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, event->xgraphicsexpose.width, event->xgraphicsexpose.height); - // if (event->xgraphicsexpose.count == 0) - // win->Update(); + if (event->xgraphicsexpose.count == 0) + { + // Only erase background, paint in idle time. + win->SendEraseEvents(); + } } return; @@ -574,15 +583,23 @@ void wxApp::ProcessXEvent(WXEvent* _event) case ButtonRelease: case MotionNotify: { - if (win && !win->IsEnabled()) + if (!win) return; - - if (win) + + if (!win->IsEnabled()) + return; + +#if 1 + if (event->type == ButtonPress) { - wxMouseEvent wxevent; - wxTranslateMouseEvent(wxevent, win, window, event); - win->GetEventHandler()->ProcessEvent( wxevent ); + if ((win != wxWindow::FindFocus()) && win->AcceptsFocus()) + win->SetFocus(); } +#endif + + wxMouseEvent wxevent; + wxTranslateMouseEvent(wxevent, win, window, event); + win->GetEventHandler()->ProcessEvent( wxevent ); return; } case FocusIn: @@ -858,37 +875,9 @@ bool wxApp::Yield(bool onlyIfNeeded) return TRUE; } -// XPM hack: make the arrays const -#define static static const - -#include "wx/generic/info.xpm" -#include "wx/generic/error.xpm" -#include "wx/generic/question.xpm" -#include "wx/generic/warning.xpm" - -#undef static - -wxIcon -wxApp::GetStdIcon(int which) const +wxIcon wxApp::GetStdIcon(int which) const { - switch(which) - { - case wxICON_INFORMATION: - return wxIcon(info_xpm); - - case wxICON_QUESTION: - return wxIcon(question_xpm); - - case wxICON_EXCLAMATION: - return wxIcon(warning_xpm); - - default: - wxFAIL_MSG("requested non existent standard icon"); - // still fall through - - case wxICON_HAND: - return wxIcon(error_xpm); - } + return wxTheme::Get()->GetRenderer()->GetStdIcon(which); } void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)