#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
XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask);
-// wxSetDetectableAutoRepeat( TRUE );
+ wxSetDetectableAutoRepeat( TRUE );
if (!wxApp::Initialize())
return -1;
wxWindow* win = NULL;
Window window = event->xany.window;
Window actualWindow = window;
-
+
// Find the first wxWindow that corresponds to this event window
// Because we're receiving events after a window
// has been destroyed, assume a 1:1 match between
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)
{
win->GetClearRegion().Union( event->xexpose.x, event->xexpose.y,
event->xexpose.width, event->xexpose.height);
+
+ if (event->xexpose.count == 0)
+ {
+ // Only erase background, paint in idle time.
+ win->SendEraseEvents();
+ }
+ }
+
+ return;
+ }
+ case GraphicsExpose:
+ {
+ if (win)
+ {
+ // 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);
- // if (event->xexpose.count == 0)
- // win->Update();
+ win->GetClearRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
+ event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+
+ if (event->xgraphicsexpose.count == 0)
+ {
+ // Only erase background, paint in idle time.
+ win->SendEraseEvents();
+ }
}
return;
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:
if (win && event->xfocus.detail != NotifyPointer)
#endif
{
- wxLogDebug( "FocusOut from %s\n", win->GetName().c_str() );
+ wxLogDebug( "FocusOut from %s", win->GetName().c_str() );
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
focusEvent.SetEventObject(win);
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)