MCPcopy Create free account
hub / github.com/BobdaProgrammer/doWM / OnEnterNotify

Method OnEnterNotify

wm/window_manager.go:1958–1975  ·  view source on GitHub ↗
(event xproto.EnterNotifyEvent)

Source from the content-addressed store, hash-verified

1956 )
1957}
1958func (wm *WindowManager) OnEnterNotify(event xproto.EnterNotifyEvent) {
1959 // set focus when we enter a window and change border color
1960 err := xproto.SetInputFocusChecked(wm.conn, xproto.InputFocusPointerRoot, event.Event, xproto.TimeCurrentTime).Check()
1961 Col := wm.config.BorderActive
1962 err = xproto.ChangeWindowAttributesChecked(
1963 wm.conn,
1964 event.Event,
1965 xproto.CwBackPixel|xproto.CwBorderPixel,
1966 []uint32{
1967 Col, // background
1968 Col, // border color
1969 },
1970 ).Check()
1971 if err != nil {
1972 slog.Error("couldn't set focus on window", "error:", err)
1973 }
1974 wm.setNetActiveWindow(event.Event)
1975}
1976
1977func (wm *WindowManager) findWindow(window xproto.Window) (bool, int, xproto.Window) {
1978 // look through all workspaces and windows to find a window (this is for if a window is deleted by a window from another workspace, we need to search for it)

Callers 1

RunMethod · 0.95

Calls 1

setNetActiveWindowMethod · 0.95

Tested by

no test coverage detected