Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfixes #3

Open
BurntSushi opened this issue Dec 3, 2012 · 1 comment
Open

xfixes #3

BurntSushi opened this issue Dec 3, 2012 · 1 comment

Comments

@BurntSushi
Copy link
Owner

This program:

package main

import (
    "log"

    "github.com/BurntSushi/xgb/xfixes"
    "github.com/BurntSushi/xgb/xproto"

    "github.com/BurntSushi/xgbutil"
    "github.com/BurntSushi/xgbutil/xevent"
    "github.com/BurntSushi/xgbutil/xwindow"
)

func assert(err error) {
    if err != nil {
        log.Fatalln(err)
    }
}

func main() {
    log.SetFlags(0)

    X, err := xgbutil.NewConn()
    assert(err)

    assert(xfixes.Init(X.Conn()))

    win, err := xwindow.Generate(X)
    assert(err)
    win.Create(X.RootWin(), 0, 0, 200, 200,
        xproto.CwBackPixel | xproto.CwEventMask,
        0x3366ff, xproto.EventMaskStructureNotify)
    xevent.MapNotifyFun(
        func(X *xgbutil.XUtil, ev xevent.MapNotifyEvent) {
            assert(xfixes.HideCursorChecked(X.Conn(), win.Id).Check())
        }).Connect(X, win.Id)
    win.Map()

    xevent.Main(X)
}

Fails with:

BadRequest {NiceName: Request, Sequence: 8, BadValue: 58720259, MinorOpcode: 29, MajorOpcode: 138}

Similar errors occur with any other request in the XFIXES extension. But extension initialization is successful. What's going on?

@KenjiTakahashi
Copy link

FYI: You have to call QueryVersion after Init and before any other requests. Apparently that's the way it works. In C, XFixesQueryExtension function seems to be calling this internally, maybe xgb should do the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants