Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / desktop_capture / mouse_cursor_monitor_x11.cc
index f09593d..f5c454e 100644 (file)
@@ -182,9 +182,13 @@ bool MouseCursorMonitorX11::HandleXEvent(const XEvent& event) {
 void MouseCursorMonitorX11::CaptureCursor() {
   assert(have_xfixes_);
 
-  XFixesCursorImage* img = XFixesGetCursorImage(display());
-  if (!img)
-     return;
+  XFixesCursorImage* img;
+  {
+    XErrorTrap error_trap(display());
+    img = XFixesGetCursorImage(display());
+    if (!img || error_trap.GetLastErrorAndDisable() != 0)
+       return;
+   }
 
   scoped_ptr<DesktopFrame> image(
       new BasicDesktopFrame(DesktopSize(img->width, img->height)));