X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e97f20a0f2bcff6b144b8ab81c73c1d412361864..a5e13868ca700aa39bae26b8fb13c640f466d9f0:/src/motif/dcclient.cpp?ds=sidebyside diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 9f994b2747..6ab2bd156a 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -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); @@ -1081,7 +1081,7 @@ void wxWindowDC::DrawText( const wxString &text, long x, long y, bool use16 ) if (m_font.Ok()) { - WXFontStructPtr pFontStruct = m_font.FindOrCreateFontStruct(m_userScaleY*m_logicalScaleY); + WXFontStructPtr pFontStruct = m_font.GetFontStruct(m_userScaleY*m_logicalScaleY, m_display); int direction, descent; XCharStruct overall_return; if (use16) @@ -1235,7 +1235,7 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh return; } - WXFontStructPtr pFontStruct = theFont->FindOrCreateFontStruct(m_userScaleY*m_logicalScaleY); + WXFontStructPtr pFontStruct = theFont->GetFontStruct(m_userScaleY*m_logicalScaleY, m_display); int direction, ascent, descent2; XCharStruct overall; @@ -1265,7 +1265,7 @@ long wxWindowDC::GetCharWidth(void) if (!m_font.Ok()) return 0; - WXFontStructPtr pFontStruct = m_font.FindOrCreateFontStruct(m_userScaleY * m_logicalScaleY); + WXFontStructPtr pFontStruct = m_font.GetFontStruct(m_userScaleY * m_logicalScaleY, m_display); int direction, ascent, descent; XCharStruct overall; @@ -1281,7 +1281,7 @@ long wxWindowDC::GetCharHeight(void) if (!m_font.Ok()) return 0; - WXFontStructPtr pFontStruct = m_font.FindOrCreateFontStruct(m_userScaleY*m_logicalScaleY); + WXFontStructPtr pFontStruct = m_font.GetFontStruct(m_userScaleY*m_logicalScaleY, m_display); int direction, ascent, descent; XCharStruct overall; @@ -1348,7 +1348,7 @@ void wxWindowDC::SetFont( const wxFont &font ) return; } - WXFontStructPtr pFontStruct = m_font.FindOrCreateFontStruct(m_userScaleY*m_logicalScaleY); + WXFontStructPtr pFontStruct = m_font.GetFontStruct(m_userScaleY*m_logicalScaleY, m_display); Font fontId = ((XFontStruct*)pFontStruct)->fid; XSetFont ((Display*) m_display, (GC) m_gc, fontId); @@ -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;