Beispiel #1
0
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()))
}
Beispiel #2
0
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))
}