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

BadMatch {NiceName: Match, Sequence: 6, BadValue: 1272, MinorOpcode: 0, MajorOpcode: 73} #57

Open
mateors opened this issue Oct 6, 2024 · 0 comments

Comments

@mateors
Copy link

mateors commented Oct 6, 2024

it gives me error when i ran the following code on my ubuntu 22.04 LTS

BadMatch {NiceName: Match, Sequence: 6, BadValue: 1272, MinorOpcode: 0, MajorOpcode: 73}

// Example screenshot shows how to take a screenshot of the current desktop
// and show it in a window. In a comment, it also shows how to save it as
// a png.
//
// It works by getting the image of the root window, which automatically
// includes all child windows.
package main

import (
	"log"

	"github.com/BurntSushi/xgb/xproto"

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

func main() {
	X, err := xgbutil.NewConn()
	if err != nil {
		log.Fatal(err)
	}

	// Use the "NewDrawable" constructor to create an xgraphics.Image value
	// from a drawable. (Usually this is done with pixmaps, but drawables
	// can also be windows.)
	ximg, err := xgraphics.NewDrawable(X, xproto.Drawable(X.RootWin()))
	if err != nil {
		log.Fatal(err)
	}

	// Shows the screenshot in a window.
	ximg.XShowExtra("Screenshot", true)

	// If you'd like to save it as a png, use:
	err = ximg.SavePng("screenshot.png")
	if err != nil {
	 log.Fatal(err)
	 }

	xevent.Main(X)
}

2024/10/06 10:10:10 BadMatch {NiceName: Match, Sequence: 6, BadValue: 1272, MinorOpcode: 0, MajorOpcode: 73}

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

1 participant