+ case Expose:
+ {
+#if wxUSE_TWO_WINDOWS && !wxUSE_NANOX
+ if (event->xexpose.window != (Window)win->GetClientAreaWindow())
+ {
+ XEvent tmp_event;
+ wxExposeInfo info;
+ info.window = event->xexpose.window;
+ info.found_non_matching = false;
+ while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event, wxX11ExposePredicate, (XPointer) &info ))
+ {
+ // Don't worry about optimizing redrawing the border etc.
+ }
+ win->NeedUpdateNcAreaInIdle();
+ }
+ else
+#endif
+ {
+ win->GetUpdateRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
+ XExposeEventGetWidth(event), XExposeEventGetHeight(event));
+ win->GetClearRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
+ XExposeEventGetWidth(event), XExposeEventGetHeight(event));
+
+#if !wxUSE_NANOX
+ XEvent tmp_event;
+ wxExposeInfo info;
+ info.window = event->xexpose.window;
+ info.found_non_matching = false;
+ while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event, wxX11ExposePredicate, (XPointer) &info ))
+ {
+ win->GetUpdateRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
+ tmp_event.xexpose.width, tmp_event.xexpose.height );
+
+ win->GetClearRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
+ tmp_event.xexpose.width, tmp_event.xexpose.height );
+ }
+#endif
+
+ // This simplifies the expose and clear areas to simple
+ // rectangles.
+ win->GetUpdateRegion() = win->GetUpdateRegion().GetBox();
+ win->GetClearRegion() = win->GetClearRegion().GetBox();
+
+ // If we only have one X11 window, always indicate
+ // that borders might have to be redrawn.
+ if (win->GetMainWindow() == win->GetClientAreaWindow())
+ win->NeedUpdateNcAreaInIdle();
+
+ // Only erase background, paint in idle time.
+ win->SendEraseEvents();
+
+ // EXPERIMENT
+ //win->Update();
+ }
+
+ return true;
+ }
+
+#if !wxUSE_NANOX
+ case GraphicsExpose:
+ {
+ wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str());
+
+ win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
+ event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+
+ 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();
+ // win->Update();
+ }
+
+ return true;
+ }
+#endif
+