Package motif

import "github.com/BurntSushi/xgbutil/motif"
Overview
Index

Overview ▾

Package motif has a few functions to allow easy access to Motif related properties.

The main purpose here is that some applications communicate "no window decorations" to the window manager using _MOTIF_WM_HINTS. (Like Google Chrome.) I haven't seen Motif stuff used for other purposes in the wild for a long time.

As a result, only the useful bits are implemented here. More may be added on an on-demand basis, but don't count on it.

Try not to bash your head against your desk too hard: http://www.opengroup.org/openmotif/hardcopydocs.html

Example

To test if a window wants decorations or not:

mh, err := motif.WmHintsGet(XUtilValue, window-id)
if err != nil {
	log.Fatal(err)
} else {
	log.Println("Decorations? ", motif.Decor(mh))
}

Constants

const (
    HintFunctions = (1 << iota)
    HintDecorations
    HintInputMode
    HintStatus
)
const (
    FunctionAll = (1 << iota)
    FunctionResize
    FunctionMove
    FunctionMinimize
    FunctionMaximize
    FunctionClose
    FunctionNone = 0
)
const (
    DecorationAll = (1 << iota)
    DecorationBorder
    DecorationResizeH
    DecorationTitle
    DecorationMenu
    DecorationMinimize
    DecorationMaximize
    DecorationNone = 0
)
const (
    InputPrimaryApplicationModal = (1 << iota)
    InputSystemModal
    InputFullApplicationModal
    InputModeless = 0
)
const StatusTearoffWindow = 1

func Decor

func Decor(mh *Hints) bool

Decor checks a Hints value for whether or not the client has requested that the window manager paint decorations. That is, Decor returns false when the hints provided indicate no decorations and true otherwise.

func WmHintsSet

func WmHintsSet(xu *xgbutil.XUtil, win xproto.Window, mh *Hints) error

_MOTIF_WM_HINTS set

type Hints

type Hints struct {
    Flags                               uint
    Function, Decoration, Input, Status uint
}

Hints is a struct that organizes the information related to the WM_NORMAL_HINTS property.

func WmHintsGet

func WmHintsGet(xu *xgbutil.XUtil, win xproto.Window) (mh *Hints, err error)

_MOTIF_WM_HINTS get