本文整理匯總了Golang中github.com/BurntSushi/xgbutil.XUtil.ExtInitialized方法的典型用法代碼示例。如果您正苦於以下問題:Golang XUtil.ExtInitialized方法的具體用法?Golang XUtil.ExtInitialized怎麽用?Golang XUtil.ExtInitialized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/BurntSushi/xgbutil.XUtil
的用法示例。
在下文中一共展示了XUtil.ExtInitialized方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: query
func query(X *xgbutil.XUtil) xinerama.Heads {
if X.ExtInitialized("XINERAMA") {
heads, err := xinerama.PhysicalHeads(X)
if err != nil || len(heads) == 0 {
if err == nil {
logger.Warning.Printf("Could not find any physical heads " +
"with the Xinerama extension.")
} else {
logger.Warning.Printf("Could not load physical heads via "+
"Xinerama: %s", err)
}
logger.Warning.Printf("Assuming one head with size equivalent " +
"to the root window.")
} else {
return heads
}
}
// If we're here, then something went wrong or the Xinerama extension
// isn't available. So query the root window for its geometry and use that.
rgeom := xwindow.RootGeometry(X)
return xinerama.Heads{
xrect.New(rgeom.X(), rgeom.Y(), rgeom.Width(), rgeom.Height()),
}
}
示例2: headGeom
func headGeom(X *xgbutil.XUtil) xrect.Rect {
if X.ExtInitialized("XINERAMA") {
heads, err := xinerama.PhysicalHeads(X)
if err == nil {
return heads[0]
}
}
geom, err := xwindow.New(X, X.RootWin()).Geometry()
fatal(err)
return geom
}