mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 20:12:06 +00:00
framebuffer: in onscreen_x11_get_xid return foreign xids
If a foreign xid has been set on a CoglOnscreen then cogl_onscreen_x11_get_window_xid doesn't need to defer to the winsys to get the underlying window xid. This also means it's possible to read back the xid before the framebuffer is allocated which fixes a crash in the x11-foreign example app.
This commit is contained in:
parent
ccd0079b57
commit
680c173947
@ -1641,9 +1641,14 @@ guint32
|
|||||||
cogl_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
|
cogl_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||||
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
|
|
||||||
|
|
||||||
return winsys->onscreen_x11_get_window_xid (onscreen);
|
if (onscreen->foreign_xid)
|
||||||
|
return onscreen->foreign_xid;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
|
||||||
|
return winsys->onscreen_x11_get_window_xid (onscreen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
|
Loading…
Reference in New Issue
Block a user