Code Monkey home page Code Monkey logo

go-wlroots's People

Contributors

alexbakker avatar dominikh avatar jchv avatar jwijenbergh avatar mewmew avatar nbsp avatar ptrcnull avatar raqbit avatar shtirlic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-wlroots's Issues

Multiple errors while building tinywl

# github.com/swaywm/go-wlroots/wlroots
In file included from wlroots.go:25,
                 from _cgo_export.c:4:
/usr/include/wlr/types/wlr_surface.h:1:2: warning: #warning "wlr/types/wlr_surface.h has been deprecated and will be removed in the future. Use wlr/types/wlr_compositor.h and wlr/types/wlr_subcompositor.h." [-Wcpp]
    1 | #warning "wlr/types/wlr_surface.h has been deprecated and will be removed in the future. Use wlr/types/wlr_compositor.h and wlr/types/wlr_subcompositor.h."
      |  ^~~~~~~
# github.com/swaywm/go-wlroots/wlroots
In file included from wlroots/wlroots.go:25:
/usr/include/wlr/types/wlr_surface.h:1:2: warning: #warning "wlr/types/wlr_surface.h has been deprecated and will be removed in the future. Use wlr/types/wlr_compositor.h and wlr/types/wlr_subcompositor.h." [-Wcpp]
    1 | #warning "wlr/types/wlr_surface.h has been deprecated and will be removed in the future. Use wlr/types/wlr_compositor.h and wlr/types/wlr_subcompositor.h."
      |  ^~~~~~~
# github.com/swaywm/go-wlroots/wlroots
wlroots/wlroots.go:197:30: not enough arguments in call to (_Cfunc_wlr_xdg_shell_create)
	have (*_Ctype_struct_wl_display)
	want (*_Ctype_struct_wl_display, _Ctype_uint)
wlroots/wlroots.go:258:96: cannot use _cgo0 (variable of type *_Ctype_struct_wlr_xdg_surface) as type *_Ctype_struct_wlr_xdg_toplevel in argument to _Cfunc_wlr_xdg_toplevel_set_activated
wlroots/wlroots.go:262:62: cannot use _Ctype_uint32_t(width) (value of type _Ctype_uint) as type _Ctype_int in variable declaration
wlroots/wlroots.go:262:81: cannot use _Ctype_uint32_t(height) (value of type _Ctype_uint) as type _Ctype_int in variable declaration
wlroots/wlroots.go:262:82: cannot use _cgo0 (variable of type *_Ctype_struct_wlr_xdg_surface) as type *_Ctype_struct_wlr_xdg_toplevel in argument to _Cfunc_wlr_xdg_toplevel_set_size
wlroots/wlroots.go:266:88: cannot use _cgo0 (variable of type *_Ctype_struct_wlr_xdg_surface) as type *_Ctype_struct_wlr_xdg_toplevel in argument to _Cfunc_wlr_xdg_toplevel_set_tiled
wlroots/wlroots.go:270:71: cannot use _cgo0 (variable of type *_Ctype_struct_wlr_xdg_surface) as type *_Ctype_struct_wlr_xdg_toplevel in argument to _Cfunc_wlr_xdg_toplevel_send_close
wlroots/wlroots.go:574:73: cannot use _cgo1 (variable of type *_Ctype_struct_wlr_input_device) as type *_Ctype_struct_wlr_keyboard in argument to _Cfunc_wlr_seat_set_keyboard
wlroots/wlroots.go:940:22: event.time_msec undefined (type *_Ctype_struct_wlr_event_keyboard_key has no field or method time_msec)
wlroots/wlroots.go:940:47: event.keycode undefined (type *_Ctype_struct_wlr_event_keyboard_key has no field or method keycode)
wlroots/wlroots.go:940:47: too many errors

build error: too many arguments in call to _Cfunc_wlr_output_commit

Hi @alexbakker,

My friend and I just came across go-wlroots today, and we just wanted to say we are quite impressed with what you've managed to implement thus far. It is really exciting to see a bare bones Wayland compositor implemented in Go, that is still useful.

When we tried to build the project, we ran into a minor build error (at rev e84b42a):

# github.com/swaywm/go-wlroots/wlroots
wlroots/wlroots.go:754:21: too many arguments in call to _Cfunc_wlr_output_commit
	have (*_Ctype_struct_wlr_output, nil, nil)
	want (*_Ctype_struct_wlr_output)
wlroots/wlroots.go:814:19: m.p.flags undefined (type *_Ctype_struct_wlr_output_mode has no field or method flags)
make: *** [Makefile:6: tinywl] Error 2

I have wlroots v0.7.0 installed.

$ pacman -Q wlroots
wlroots 0.7.0-1

Wish you a really lovely start of the autumn and can't state how excited I am to have found this project of yours!

Cheerful regards,
Robin & Daniel

Question

has the sway team abandoned go-wlroots?

Using channels instead of callbacks

It would be a more idiomatic API to use channels to pass events like OnNewInput and OnNewOutput. I'm not 100% sure how to would be implemented but it should probably be function that return a channel and the function itself will register a callback, something like that:

func (b Backend) NewOutputChan() chan Output {
	var c chan Output
	b.OnNewOutput(func(o Output) {
		c <- o
	})
	return c
}

Error while running make all

Whenever I build i have some errors thrown

mkdir -p build/bin wayland-scanner private-code /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml wlroots/xdg-shell-protocol.c wayland-scanner server-header /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml wlroots/xdg-shell-protocol.h go build -o build/bin/tinywl github.com/swaywm/go-wlroots/cmd/tinywl In file included from _cgo_export.c:4: log.go: In function '_wlr_log_inner_cb': log.go:14:3: warning: implicit declaration of function 'vasprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]

this is on a fresh arch install with wlroots, wayland, wayland protocols, and go installed.

Incompatible to wlroots 0.6

Quoting the official release notes:

To migrate from the old API to the new one:

    Replace wlr_output_make_current calls with wlr_output_attach_render
    Replace wlr_output_swap_buffers calls with wlr_output_set_damage and wlr_output_commit
    Replace wlr_output_damage_make_current calls with wlr_output_damage_attach_render
    Replace wlr_output_damage_swap_buffers with wlr_output_set_damage and wlr_output_commit
    Replace wlr_output.needs_swap with wlr_output.needs_frame
    Replace wlr_output.events.swap_buffers with wlr_output.events.precommit

This applies at least to

  • func (o Output) MakeCurrent() (int, error) (output.go:68)
  • func (o Output) SwapBuffers() (output.go:84)

and maybe some others.

Go modules

Would be nice if this supported Go modules instead of being a legacy-style project

Poorly comented

It would be great to comment each function in go-wlroots and export it as godoc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.