本文整理匯總了Golang中github.com/BurntSushi/xgb/xproto.ConfigureNotifyEvent類的典型用法代碼示例。如果您正苦於以下問題:Golang ConfigureNotifyEvent類的具體用法?Golang ConfigureNotifyEvent怎麽用?Golang ConfigureNotifyEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ConfigureNotifyEvent類的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))
}