Exemplo n.º 1
0
func (c *Client) refreshName() {
	var newName string

	defer func() {
		if newName != c.name {
			c.name = newName
			c.frames.full.UpdateTitle()
			c.prompts.updateName()
			ewmh.WmVisibleNameSet(wm.X, c.Id(), c.name)

			event.Notify(event.ChangedClientName{c.Id()})
		}
	}()

	newName, _ = ewmh.WmNameGet(wm.X, c.Id())
	if len(newName) > 0 {
		return
	}

	newName, _ = icccm.WmNameGet(wm.X, c.Id())
	if len(newName) > 0 {
		return
	}

	newName = "Unnamed Window"
}
Exemplo n.º 2
0
func (c *Client) refreshName() {
	defer func() {
		c.frames.full.UpdateTitle()
		c.prompts.updateName()
	}()

	c.name, _ = ewmh.WmNameGet(wm.X, c.Id())
	if len(c.name) > 0 {
		return
	}

	c.name, _ = icccm.WmNameGet(wm.X, c.Id())
	if len(c.name) > 0 {
		return
	}

	c.name = "Unnamed Window"
	ewmh.WmVisibleNameSet(wm.X, c.Id(), c.name)
}