本文整理汇总了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
}