]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcclient.cpp
fixes
[wxWidgets.git] / src / motif / dcclient.cpp
index ebe87a10d51277a1dfbc10d453f4291e20b0af19..6ab2bd156ae7d29c4a198def5a6a8d94e4ea52bb 100644 (file)
@@ -146,7 +146,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
 
 wxWindowDC::~wxWindowDC(void)
 {
-    if ((m_oldFont != (WXFont) 0) && ((long) m_oldFont != -1))
+    if (m_gc && (m_oldFont != (WXFont) 0) && ((long) m_oldFont != -1))
     {
       XSetFont ((Display*) m_display, (GC) m_gc, (Font) m_oldFont);
 
@@ -1855,7 +1855,9 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
 
   int pixel = m_backgroundBrush.GetColour().AllocColour(m_display);
 
-  XSetWindowBackground ((Display*) m_display, (Pixmap) m_pixmap, pixel);
+  // XSetWindowBackground doesn't work for non-Window pixmaps
+  if (!this->IsKindOf(CLASSINFO(wxMemoryDC)))
+      XSetWindowBackground ((Display*) m_display, (Pixmap) m_pixmap, pixel);
 
   // Necessary for ::DrawIcon, which use fg/bg pixel or the GC.
   // And Blit,... (Any fct that use XCopyPlane, in fact.)
@@ -2174,7 +2176,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
   }
 }
 
-void wxWindowDC::DrawOpenSpline( wxList *points )
+void wxWindowDC::DrawSpline( wxList *points )
 {
     wxPoint *p;
     double           cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;