Index: ui/gl/gl_surface_glx.cc |
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc |
index 02e5a2a3d1cd257ad735be08549198d234290b2e..2dba6d38ca4956233a98a35404cebb0dfab2f1ea 100644 |
--- a/ui/gl/gl_surface_glx.cc |
+++ b/ui/gl/gl_surface_glx.cc |
@@ -311,6 +311,7 @@ class XExposeEventForwarder : public base::MessagePumpObserver { |
XExposeEventForwarder() {} |
virtual ~XExposeEventForwarder() { |
DCHECK(child_to_parent_map_.empty()); |
+ DCHECK(parent_to_child_map_.empty()); |
} |
void AddParentChildPair(gfx::AcceleratedWidget parent_window, |
gfx::AcceleratedWidget child_window) { |
@@ -321,16 +322,33 @@ class XExposeEventForwarder : public base::MessagePumpObserver { |
child_to_parent_map_.end()); |
child_to_parent_map_.insert(std::make_pair( |
child_window, parent_window)); |
+ parent_to_child_map_.insert(std::make_pair( |
+ parent_window, child_window)); |
} |
void RemoveParentChildPair(gfx::AcceleratedWidget parent_window, |
gfx::AcceleratedWidget child_window) { |
DCHECK(child_to_parent_map_.find(child_window) != |
child_to_parent_map_.end()); |
+ DCHECK(parent_to_child_map_.find(parent_window) != |
+ parent_to_child_map_.end()); |
child_to_parent_map_.erase(child_window); |
+ parent_to_child_map_.erase(parent_window); |
if (child_to_parent_map_.empty()) |
base::MessagePumpX11::Current()->RemoveObserver(this); |
} |
+ void SetChildWindowVisible(gfx::AcceleratedWidget parent_window, |
+ bool visible) { |
+ WindowMap::const_iterator found = parent_to_child_map_.find(parent_window); |
+ if (found == parent_to_child_map_.end()) |
+ return; |
+ gfx::AcceleratedWidget child_window = found->second; |
+ if (visible) |
+ XMapWindow(g_display, child_window); |
+ else |
+ XUnmapWindow(g_display, child_window); |
+ // XFlush(g_display); |
+ } |
private: |
virtual base::EventStatus WillProcessEvent ( |
@@ -355,6 +373,7 @@ class XExposeEventForwarder : public base::MessagePumpObserver { |
typedef std::map<gfx::AcceleratedWidget, gfx::AcceleratedWidget> WindowMap; |
WindowMap child_to_parent_map_; |
+ WindowMap parent_to_child_map_; |
DISALLOW_COPY_AND_ASSIGN(XExposeEventForwarder); |
}; |
@@ -390,10 +409,6 @@ bool GLSurfaceGLX::InitializeOneOff() { |
base::MessageLoop::current() && |
base::MessageLoop::current()->type() == base::MessageLoop::TYPE_GPU; |
- // Disable this path because it is causing window contents to disappear. |
- // http://crbug.com/292655 |
- g_create_child_windows = false; |
- |
if (g_create_child_windows) |
g_display = base::MessagePumpX11::GetDefaultXDisplay(); |
else |
@@ -697,6 +712,14 @@ VSyncProvider* NativeViewGLSurfaceGLX::GetVSyncProvider() { |
return vsync_provider_.get(); |
} |
+#if defined(TOOLKIT_GTK) |
+void NativeViewGLSurfaceGLX::AcceleratedCompositingStateChange( |
+ int32 surface_id, bool compositing_active) { |
+ g_xexpose_event_forwarder.Pointer()->SetChildWindowVisible( |
+ surface_id, compositing_active); |
+} |
+#endif |
+ |
NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX() |
: parent_window_(0), |
#if defined(TOOLKIT_GTK) |