From: Paul Cornett <paulcor@bullseye.com>
Date: Fri, 14 Dec 2012 06:25:00 +0000 (+0000)
Subject: Get DC size from GDK window if possible, client size can unfortunately be wrong
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ffc28384ca01bf09551aeca9d7e22edf5e2ea356

Get DC size from GDK window if possible, client size can unfortunately be wrong
This should fix wxDC::Clear() not clearing the whole window on Ubuntu 12.04 with overlay scrollbars
see #14871


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp
index 7aba0eab72..3754531c01 100644
--- a/src/gtk/app.cpp
+++ b/src/gtk/app.cpp
@@ -288,10 +288,6 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
     if ( !wxAppBase::Initialize(argc_, argv_) )
         return false;
 
-    // disable Ubuntu "overlay scrollbar" until we figure out how to keep it
-    // from messing up our window contents when scrolling, see ticket #14871
-    wxSetEnv(wxS("LIBOVERLAY_SCROLLBAR"), wxS("0"));
-
 #if wxUSE_THREADS
     if (!g_thread_supported())
     {
diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp
index 0ad9159ef5..4c4416ebe1 100644
--- a/src/gtk/dcclient.cpp
+++ b/src/gtk/dcclient.cpp
@@ -2103,7 +2103,10 @@ void wxClientDCImpl::DoGetSize(int *width, int *height) const
 {
     wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
 
-    m_window->GetClientSize( width, height );
+    if (m_window->m_wxwindow && m_gdkwindow)
+        gdk_drawable_get_size(m_gdkwindow, width, height);
+    else
+        m_window->GetClientSize(width, height);
 }
 
 //-----------------------------------------------------------------------------