Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / desktop_capture / x11 / x_server_pixel_buffer.cc
index 6983a6d..be00fa7 100644 (file)
@@ -213,6 +213,18 @@ bool XServerPixelBuffer::InitPixmaps(int depth) {
   return true;
 }
 
+bool XServerPixelBuffer::IsWindowValid() const {
+  XWindowAttributes attributes;
+  {
+    XErrorTrap error_trap(display_);
+    if (!XGetWindowAttributes(display_, window_, &attributes) ||
+        error_trap.GetLastErrorAndDisable() != 0) {
+      return false;
+    }
+  }
+  return true;
+}
+
 void XServerPixelBuffer::Synchronize() {
   if (shm_segment_info_ && !shm_pixmap_) {
     // XShmGetImage can fail if the display is being reconfigured.