- m_display = wxGetDisplay();
- Display* display = (Display*) m_display;
-
- if (sm_overlayWindow)
- {
- m_pixmap = sm_overlayWindow;
- m_deviceOriginX = - sm_overlayWindowX;
- m_deviceOriginY = - sm_overlayWindowY;
- }
- else
- m_pixmap = (WXPixmap) RootWindow(display, DefaultScreen(display));
-
- XGCValues gcvalues;
- gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
- gcvalues.background = WhitePixel (display, DefaultScreen (display));
- gcvalues.graphics_exposures = False;
- gcvalues.subwindow_mode = IncludeInferiors;
- gcvalues.line_width = 1;
- m_gc = XCreateGC (display, RootWindow (display, DefaultScreen (display)),
- GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
- &gcvalues);
-
- m_backgroundPixel = (int) gcvalues.background;
- m_ok = TRUE;
+ m_ok = false;
+
+ m_display = (WXDisplay *) wxGlobalDisplay();
+
+ int screen = DefaultScreen( (Display*) m_display );
+ m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
+
+ m_window = (WXWindow) RootWindow( (Display*) m_display, screen );
+
+ m_isScreenDC = true;
+
+#if wxUSE_UNICODE
+ m_context = wxTheApp->GetPangoContext();
+ m_fontdesc = wxNORMAL_FONT->GetNativeFontInfo()->description;
+#endif
+
+ SetUpDC();
+
+ XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, IncludeInferiors );
+ XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, IncludeInferiors );
+ XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, IncludeInferiors );
+ XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, IncludeInferiors );