BurntSushi / xgbutil

A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)
Do What The F*ck You Want To Public License
194 stars 46 forks source link

ShowingDesktopReq failed #21

Open kosl90 opened 10 years ago

kosl90 commented 10 years ago

the ShowingDesktopReq will fail, because you pass the argument with uint type and NewClientMessage uses data[i].(int). You'd better make much more check on NewClientMessage(xevent/types_manual:24).

BurntSushi commented 10 years ago

Thanks for the bug report!

This will be fixed when I merge #20.

mhersson commented 5 years ago

First of all thanks for creating these libraries

I guess this is releated. ewmh.WMDesktopReq fails with error: interface conversion: interface {} is int, not uint

I got it working by creating a new function sending int to the xevent.NewClientMessage

func sendDesktopReq(xu *xgbutil.XUtil, win xproto.Window, desk int) {
    mstype, err := xprop.Atm(xu, "_NET_WM_DESKTOP")
    if err != nil {
        log.Fatal(err)
    }

    evMask := (xproto.EventMaskSubstructureNotify |
        xproto.EventMaskSubstructureRedirect)

    cm, err := xevent.NewClientMessage(32, win, mstype, desk)
    if err != nil {
        log.Fatal(err)
    }

    xevent.SendRootEvent(xu, cm, uint32(evMask))
}