本文整理汇总了Golang中github.com/BurntSushi/xgb/xproto.ConfigureNotifyEvent.Bytes方法的典型用法代码示例。如果您正苦于以下问题:Golang ConfigureNotifyEvent.Bytes方法的具体用法?Golang ConfigureNotifyEvent.Bytes怎么用?Golang ConfigureNotifyEvent.Bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/BurntSushi/xgb/xproto.ConfigureNotifyEvent
的用法示例。
在下文中一共展示了ConfigureNotifyEvent.Bytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: sendConfigureNotify
func (c *Client) sendConfigureNotify() {
geom := c.Frame().Geom()
ev := xproto.ConfigureNotifyEvent{
Event: c.Id(),
Window: c.Id(),
AboveSibling: 0,
X: int16(geom.X()),
Y: int16(geom.Y()),
Width: uint16(c.win.Geom.Width()),
Height: uint16(c.win.Geom.Height()),
BorderWidth: 0,
OverrideRedirect: false,
}
xproto.SendEvent(wm.X.Conn(), false, c.Id(),
xproto.EventMaskStructureNotify, string(ev.Bytes()))
}
示例2: handleConfigureRequest
func handleConfigureRequest(e xp.ConfigureRequestEvent) {
mask, values := uint16(0), []uint32(nil)
if w := findWindow(func(w *window) bool { return w.xWin == e.Window }); w != nil {
cne := xp.ConfigureNotifyEvent{
Event: w.xWin,
Window: w.xWin,
X: w.rect.X,
Y: w.rect.Y,
Width: w.rect.Width,
Height: w.rect.Height,
}
check(xp.SendEventChecked(xConn, false, w.xWin,
xp.EventMaskStructureNotify, string(cne.Bytes())))
return
}
if e.ValueMask&xp.ConfigWindowX != 0 {
mask |= xp.ConfigWindowX
values = append(values, uint32(e.X))
}
if e.ValueMask&xp.ConfigWindowY != 0 {
mask |= xp.ConfigWindowY
values = append(values, uint32(e.Y))
}
if e.ValueMask&xp.ConfigWindowWidth != 0 {
mask |= xp.ConfigWindowWidth
values = append(values, uint32(e.Width))
}
if e.ValueMask&xp.ConfigWindowHeight != 0 {
mask |= xp.ConfigWindowHeight
values = append(values, uint32(e.Height))
}
if e.ValueMask&xp.ConfigWindowBorderWidth != 0 {
mask |= xp.ConfigWindowBorderWidth
values = append(values, uint32(e.BorderWidth))
}
if e.ValueMask&xp.ConfigWindowSibling != 0 {
mask |= xp.ConfigWindowSibling
values = append(values, uint32(e.Sibling))
}
if e.ValueMask&xp.ConfigWindowStackMode != 0 {
mask |= xp.ConfigWindowStackMode
values = append(values, uint32(e.StackMode))
}
check(xp.ConfigureWindowChecked(xConn, e.Window, mask, values))
}