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

Method isAbove

wm/window_manager.go:2155–2189  ·  view source on GitHub ↗
(w xproto.Window)

Source from the content-addressed store, hash-verified

2153}
2154
2155func (wm *WindowManager) isAbove(w xproto.Window) {
2156 fmt.Println(wm.atoms)
2157 stateAtom, ok := wm.atoms["_NET_WM_STATE"]
2158 if ok {
2159 stateAboveAtom, ok := wm.atoms["_NET_WM_STATE_ABOVE"]
2160 if ok {
2161
2162 // Get property
2163 prop, err := xproto.GetProperty(wm.conn, false, w, stateAtom,
2164 xproto.AtomAtom, 0, 1024).Reply()
2165 if err != nil {
2166 slog.Error("Error getting _NET_WM_STATE", "error:", err)
2167 return
2168 }
2169
2170 // Iterate through atoms in the property
2171 for i := 0; i+4 <= len(prop.Value); i += 4 {
2172 atom := xproto.Atom(uint32(prop.Value[i]) |
2173 uint32(prop.Value[i+1])<<8 |
2174 uint32(prop.Value[i+2])<<16 |
2175 uint32(prop.Value[i+3])<<24)
2176
2177 if atom == stateAboveAtom {
2178 xproto.ConfigureWindow(
2179 wm.conn,
2180 w,
2181 xproto.ConfigWindowStackMode,
2182 []uint32{xproto.StackModeAbove},
2183 )
2184 break
2185 }
2186 }
2187 }
2188 }
2189}
2190
2191func (wm *WindowManager) OnMapRequest(event xproto.MapRequestEvent) {
2192

Callers 1

FrameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected