x11: Split out conditions and warnings
XGetGeometry is a great piece of API, since it gets a lot of stuff that are moderately *not* geometry related - the root window, and the depth being two. Since we have multiple conditions depending on the result of that call we should split them up depending on the actual error - and each of them should have a separate error message. This makes debugging simpler.
This commit is contained in:
parent
0736cb7323
commit
a20a509584
@ -905,12 +905,26 @@ clutter_x11_set_stage_foreign (ClutterStage *stage,
|
|||||||
&border,
|
&border,
|
||||||
&depth);
|
&depth);
|
||||||
|
|
||||||
if (clutter_x11_untrap_x_errors () ||
|
if (clutter_x11_untrap_x_errors () || !status)
|
||||||
!status ||
|
|
||||||
width == 0 || height == 0 ||
|
|
||||||
depth != xvisinfo->depth)
|
|
||||||
{
|
{
|
||||||
g_warning ("Unable to retrieve the new window geometry");
|
g_critical ("Unable to retrieve the geometry of the foreign window: "
|
||||||
|
"XGetGeometry() failed (status code: %d)", status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (width == 0 || height == 0)
|
||||||
|
{
|
||||||
|
g_warning ("The size of the foreign window is 0x0");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (depth != xvisinfo->depth)
|
||||||
|
{
|
||||||
|
g_warning ("The depth of the visual of the foreign window is %d, but "
|
||||||
|
"Clutter has been initialized to require a visual depth "
|
||||||
|
"of %d",
|
||||||
|
depth,
|
||||||
|
xvisinfo->depth);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user