X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/809934d22ad2e97d67655ecb4b06b29b5d2a361d..d2e4966591dade8bd2885c8eb834bb55bf15dddd:/src/gtk1/dcclient.cpp diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 8c72dd103b..15b1c16e4b 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type ) { wxGCPool[i].m_gc = gdk_gc_new( window ); gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE ); + // This allows you to e.g. copy from the screen + // without clipping the windows on it. + gdk_gc_set_subwindow( wxGCPool[i].m_gc, + GDK_INCLUDE_INFERIORS ); wxGCPool[i].m_type = type; wxGCPool[i].m_used = FALSE; } @@ -342,10 +346,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") ); } -bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const +bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const { - wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") ); - return FALSE; + // Generic (and therefore rather inefficient) method. + // Could be improved. + wxMemoryDC memdc; + wxBitmap bitmap(1, 1); + memdc.SelectObject(bitmap); + memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1); + memdc.SelectObject(wxNullBitmap); + wxImage image(bitmap); + col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0)); + return TRUE; } void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )