mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +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,10 +1641,15 @@ guint32
|
||||
cogl_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
|
||||
|
||||
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
|
||||
cogl_onscreen_x11_get_visual_xid (CoglOnscreen *onscreen)
|
||||
|
Loading…
Reference in New Issue
Block a user