ecore_x: Only use att if call succeeds.

XGetWindowAttributes isn't guaranteed to succeed.

Fixes CID 1039692
This commit is contained in:
Sebastian Dransfeld 2013-12-07 17:53:34 +01:00
parent 6b1438af05
commit 31d0a2d71c
1 changed files with 8 additions and 6 deletions

View File

@ -1591,14 +1591,16 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
else
{
/* ewww - round trip */
XGetWindowAttributes(_ecore_x_disp, parent, &att);
if (_ecore_xlib_sync) ecore_x_sync();
for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
if (XGetWindowAttributes(_ecore_x_disp, parent, &att))
{
if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
if (_ecore_xlib_sync) ecore_x_sync();
for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
{
scr = i;
break;
if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
{
scr = i;
break;
}
}
}
}