Add error trap for XFixesGetCursorImage()
BUG=https://code.google.com/p/webrtc/issues/detail?id=3245 R=jiayl@webrtc.org Review URL: https://webrtc-codereview.appspot.com/31519004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7362 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
325cff01b4
commit
76819d315d
@ -182,9 +182,13 @@ bool MouseCursorMonitorX11::HandleXEvent(const XEvent& event) {
|
||||
void MouseCursorMonitorX11::CaptureCursor() {
|
||||
assert(have_xfixes_);
|
||||
|
||||
XFixesCursorImage* img = XFixesGetCursorImage(display());
|
||||
if (!img)
|
||||
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)));
|
||||
|
Loading…
Reference in New Issue
Block a user