cloudef / wlc Goto Github PK
View Code? Open in Web Editor NEWHigh-level Wayland compositor library
License: MIT License
High-level Wayland compositor library
License: MIT License
Stop rendering and pass the buffer directly to kms.
My goal is to suppress wlc logs on sway unless the user enables debug logging.
Exactly what title says. Currently wlc just does naive AABB tests that of course fail.
Most useful drawing for example view borders, background, or any other custom behavior where it makes sense.
wlc_interface.compositor.tick
Link against these plugins and dlopen the plugins instead. Just like orbment / bemenu does.
It would be nice to have documentation syntax in code so we can generate for example man pages for wlc API. Doxygen has been used before, but it may be worth to resee what are the options nowadays.
The current workaround is to run
ln -s /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/dbus-1.0/include/ /usr/lib/dbus-1.0/
and it finds dbus
I guess Ubuntu has the dbus-arch-deps.h file there
Alternatively:
Currently wlc handles display power management, but this task should be moved outside.
This patch for drm.c will fix it.
286c286
< if (drm.api.drmModeSetCrtc(drm.fd, dsurface->encoder->crtc_id, fb->fd, 0, 0, &dsurface->connector->connector_id, 1, &dsurface->connector->modes[o->active.mode]))
---
> if (drm.api.drmModeSetCrtc(drm.fd, dsurface->crtc->crtc_id, fb->fd, 0, 0, &dsurface->connector->connector_id, 1, &dsurface->connector->modes[o->active.mode]))
292c292
< if (drm.api.drmModePageFlip(drm.fd, dsurface->encoder->crtc_id, fb->fd, DRM_MODE_PAGE_FLIP_EVENT, bsurface))
---
> if (drm.api.drmModePageFlip(drm.fd, dsurface->crtc->crtc_id, fb->fd, DRM_MODE_PAGE_FLIP_EVENT, bsurface))
375c375
< if (encoder->encoder_id == connector->encoder_id)
---
> //if (encoder->encoder_id == connector->encoder_id)
408c408
< if (!(crtc = drm.api.drmModeGetCrtc(drm.fd, encoder->crtc_id))) {
---
> if (!(crtc = drm.api.drmModeGetCrtc(drm.fd, resources->crtcs[encoder->crtc_id]))) {
Support logind. Drops the need for SUID on logind enabled systems, saner VT switching and DRM management, etc.
I'm not sure if it's possible for wlc to handle this, but I'd like to give my users the ability to remap keys (i.e. switch caps lock and escape). Can keyboard.key be called with pointers to the key info instead of values?
$ uname -a
Linux itsuka 3.14.14-gentoo-gnu #5 SMP Wed Nov 5 21:39:53 EST 2014 x86_64 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux
$ make
[ 2%] Generating wayland-xdg-shell-protocol.c
[ 5%] Generating wayland-xdg-shell-server-protocol.h
Scanning dependencies of target wlc
[ 8%] Building C object src/CMakeFiles/wlc.dir/compositor/buffer.c.o
[ 11%] Building C object src/CMakeFiles/wlc.dir/compositor/callback.c.o
[ 14%] Building C object src/CMakeFiles/wlc.dir/compositor/client.c.o
[ 17%] Building C object src/CMakeFiles/wlc.dir/compositor/compositor.c.o
[ 20%] Building C object src/CMakeFiles/wlc.dir/compositor/data.c.o
[ 22%] Building C object src/CMakeFiles/wlc.dir/compositor/output.c.o
/home/kotori/wlc/src/compositor/output.c: In function ‘wl_output_bind’:
/home/kotori/wlc/src/compositor/output.c:79:19: error: ‘WL_OUTPUT_SCALE_SINCE_VERSION’ undeclared (first use in this function)
/home/kotori/wlc/src/compositor/output.c:79:19: note: each undeclared identifier is reported only once for each function it appears in
/home/kotori/wlc/src/compositor/output.c:96:19: error: ‘WL_OUTPUT_DONE_SINCE_VERSION’ undeclared (first use in this function)
src/CMakeFiles/wlc.dir/build.make:182: recipe for target 'src/CMakeFiles/wlc.dir/compositor/output.c.o' failed
make[2]: *** [src/CMakeFiles/wlc.dir/compositor/output.c.o] Error 1
CMakeFiles/Makefile2:78: recipe for target 'src/CMakeFiles/wlc.dir/all' failed
make[1]: *** [src/CMakeFiles/wlc.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
Easings, timings, conflict handling and such coupled with custom drawing. Of course we want wobbly windows and desktop cubes. Having this API in wlc allows render loop to be efficient as possible.
Multiple keyboards with different layouts and rules is useful.
So may be other device specific configuration (like disabling touchpad and so on).
Suppose I don't have libxcb-composite0-dev installed, I get:
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find XCB (missing: XCB_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
CMake/FindXCB.cmake:23 (find_package_handle_standard_args)
src/CMakeLists.txt:68 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/aengelen/dev/wlc/CMakeFiles/CMakeOutput.log".
Changing XCB_LIBRARIES to ${XCB_LIBRARIES} in CMake/FindXCB.cmake gives a more enlightening error, but my cmake skills are too limited to determine whether that makes any sense :)
I think it would be useful to define something among the lines of WLC_HANDLE_FORMAT
to an appropriate printf format specifier. The usage and use case is the same as the format specifier defines provided by inttypes.h
(POSIX).
I'd choose among these candidates: PRIoPTR
, PRIuPTR
, PRIxPTR
and PRIXPTR
(from inttypes.h
).
I don't think octal representation is useful for the handle.
There could also be more fine-grained control as something like WLC_HANDLE_FORMAT_U
, WLC_HANDLE_FORMAT_x
and WLC_HANDLE_FORMAT_X
for decimal, hexadecimal with lower case letter and hexadecimal with upper case letters.
Hi
I have Arch linux running in VirtualBox. I can't get the hardware rendering to work properly so for now I am using software rendering. Weston works fine under X using SHM. However, if I run the wlc example under X I get this error (regardless if set WLC_SHM=1 or not):
wlc: Work done, dropping permissions and checking communication
wlc: Activating tty
created output (1)
wlc: Xwayland :1 -rootless -terminate -listen 14 -listen 15 -wm 19
libEGL warning: DRI2: failed to authenticate
wlc: EGL context is double buffered
wlc: EGL version: 1.4 (DRI2)
wlc: EGL vendor: Mesa Project
wlc: EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3
wlc: EGL context (RGB888)
wlc: GLES2 renderer initialized
wlc: Set new bsurface to output (1)
wlc: Added output (1)
wlc: become active
wlc: SIGFPE signal received
#7 0x00007fc2c6a9bff1 in ?? ()
#8 0x3f0000003f000000 in ?? ()
#9 0x3f0000003f000000 in ?? ()
#10 0x3fa2f9833fa2f983 in ?? ()
#11 0x3fa2f9833fa2f983 in ?? ()
#12 0x0000000400000004 in ?? ()
#13 0x0000000400000004 in ?? ()
#14 0x3f8000003f800000 in ?? ()
#15 0x3f8000003f800000 in ?? ()
#16 0x0000000200000002 in ?? ()
#17 0x0000000200000002 in ?? ()
#18 0xb3222169b3222169 in ?? ()
#19 0xb3222169b3222169 in ?? ()
#20 0xfffffffefffffffe in ?? ()
#21 0xfffffffefffffffe in ?? ()
#22 0xbe2aaaa3be2aaaa3 in ?? ()
#23 0xbe2aaaa3be2aaaa3 in ?? ()
#24 0xb97da000b97da000 in ?? ()
#25 0xb97da000b97da000 in ?? ()
#26 0x7fffffff7fffffff in ?? ()
#27 0x7fffffff7fffffff in ?? ()
#28 0x8000000080000000 in ?? ()
#29 0x8000000080000000 in ?? ()
#30 0x7fc000007fc00000 in ?? ()
#31 0x7fc000007fc00000 in ?? ()
#32 0x403851eb403851eb in ?? ()
#33 0x403851eb403851eb in ?? ()
#34 0xb94ca1f9b94ca1f9 in ?? ()
#35 0xb94ca1f9b94ca1f9 in ?? ()
#36 0xbf800000bf800000 in ?? ()
#37 0xbf800000bf800000 in ?? ()
#38 0x000000019975df00 in ?? ()
#39 0xc108af6500000000 in ?? ()
#40 0x0000000000000001 in ?? ()
#41 0x0000000000cd5340 in ?? ()
#42 0x0000000000ce4270 in ?? ()
#43 0x00007fc2c108af65 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#44 0x00007fc2c137bb7c in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#45 0x00000000000000ce in ?? ()
#46 0x0000000000000d00 in ?? ()
#47 0x0000000000cd2980 in ?? ()
#48 0x0000000000cd5340 in ?? ()
#49 0x00007fc2c108b0bd in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#50 0x00007fc2c1079e31 in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#51 0x00007fc2c0f7da5f in ?? () from /usr/lib/xorg/modules/dri/swrast_dri.so
#52 0x00000000000008e2 in ?? ()
#53 0xffffffffff600001 in ?? ()
#54 0x0000000c00000000 in ?? ()
#55 0xffffffffff600001 in ?? ()
#56 0xfce00000fe200000 in ?? ()
#57 0x0000000001e00000 in ?? ()
#58 0x0000000001473a2d in ?? ()
#59 0x0000000000000009 in ?? ()
#60 0x00007ffd3cc73f30 in ?? ()
#61 0x00007fc2c671c140 in ?? () from /home/mirama/Development/wlc/target/src/libwlc.so.0
#62 0x00007ffd3cc73e54 in ?? ()
#63 0x00007ffd3cc73f20 in ?? ()
#64 0x0000000000c840e0 in ?? ()
#65 0x0000000000000022 in ?? ()
#66 0x0000000000000000 in ?? ()
[mirama@JVM target]$ wlc: Parent exit (513)
wlc: Cleanup wlc
Maybe this is something I'm meant to implement myself?
aengelen@yinka ~/dev/wlc % make
[ 2%] Building C object lib/chck/CMakeFiles/chck_wlc.dir/src/chck/pool/pool.c.o
[ 4%] Building C object lib/chck/CMakeFiles/chck_wlc.dir/src/chck/lut/lut.c.o
[ 7%] Building C object lib/chck/CMakeFiles/chck_wlc.dir/src/chck/string/string.c.o
Linking C static library libchck_wlc.a
[ 7%] Built target chck_wlc
[ 9%] Building C object src/CMakeFiles/wlc.dir/compositor/compositor.c.o
[ 11%] Building C object src/CMakeFiles/wlc.dir/compositor/output.c.o
[ 14%] Building C object src/CMakeFiles/wlc.dir/compositor/seat/data.c.o
/home/aengelen/dev/wlc/src/compositor/seat/data.c:109:4: error: unknown field ‘release’ specified in initializer
.release = wlc_cb_resource_destructor
^
/home/aengelen/dev/wlc/src/compositor/seat/data.c:110:1: warning: excess elements in struct initializer
};
^
/home/aengelen/dev/wlc/src/compositor/seat/data.c:110:1: warning: (near initialization for ‘wl_data_device_implementation’)
src/CMakeFiles/wlc.dir/build.make:110: recipe for target 'src/CMakeFiles/wlc.dir/compositor/seat/data.c.o' failed
make[2]: *** [src/CMakeFiles/wlc.dir/compositor/seat/data.c.o] Error 1
CMakeFiles/Makefile2:1008: recipe for target 'src/CMakeFiles/wlc.dir/all' failed
make[1]: *** [src/CMakeFiles/wlc.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
When highlighting text in a window, if the mouse either moves out of the window or crosses over another window, the pointer movement handler is no longer called on the, and events stop being passed to the window.
Hey there, nice project.
Looks quite nice already(loliwm)
I was just playing around a little bit with it, and found an issue while moving a window. If moving the cursor slowly while dragging a window, it wont move(I think because delta values under 0 are cut to 0), also after moving a window a lot, the cursor seems to go other ways than the window, it kinda drifts away. My experience says, that it is a float to int typecast issue(had some similar issues playing with touch and android).
Currently wlc is hardcoded to card0, but multiple cards is possiblity and even render nodes.
It should also be possible to have outputs tied to cards instead of whole drm system, this would allow multiple GPUs used with multiple outputs.
Make sure nothing is called on wlc_init.
Make sure they are called on correct order, eg. view.request.geometry before view.created is not valid.
Include information on which tasks to start contributing from. What kind of things are expected from contributions, and include configuration for uncrustify (or astyle) and additionally explain code styling briefly for those who don't want to use the tools.
This is better interface than exposing keysym in wlc_interface function. Sometimes you may not want to build the keysym with all the modifiers applied, thus function would make this more flexible.
For some reason wlc_view_get_type comes back as 0
.
If there is a normal XServer running on $DISPLAY=:0.0, the following loop will not terminate; if the normal XServer is instead running on $DISPLAY=:1.0, the loop will terminate and XWayland will be loaded correctly:
Lines 81 to 107 in ef296c5
UPDATE1: The infinite loop happens because after continuing the loop after the decrease in
Line 104 in ef296c5
UPDATE2: It seems to me that
Line 100 in ef296c5
Needed for hidpi clients and scaling non hidpi clients.
We implement the interface, but it's actually stubbed.
If you have no x windows open, and run dmenu, it will not receive key presses.
What is the bool return value supposed to be?
https://github.com/Cloudef/wlc/blob/master/include/wlc/wlc.h#L133
In the refactor branch wlc.h
ends up in /usr/include/include/wlc/wlc.h
. Is that expected? One include should be enough :) (I don't know cmake so I can't fix it myself.)
wlc's main job is mainly abstracting away various backends and APIs (x11, drm, libinput, udev, etc...), but it also has lots of manual code for state (when view should be drawn, what is the state of view, when to commit, damages, etc...) which could probably be abstracted as a state machine.
I'm not yet sure how this idea would work, but if ragel is up to the task, all the "moving parts" in wlc are easily graphed and generated, and debugging is easier. It also would increase reliability, that is, wlc works as described in state machine.
This makes sense due to uncontrolled environment where dangling pointers are real problem. Handles would be simple indexes. This gives additional bonus that the underlying memory management could be optimized for iterations.
Right now, outputs which are sleeping will be woken up again when the tty is switched. A handler for the tty switch event would prevent this.
drm is not listed in wl_registry outputs.
Linked lists are not very efficient and can easily cause access to dangling pointers or otherwise bad memory regions.
Use chck data structures instead. #2 is related,
Hi.
It seems that running in DRM mode, results in an error due to an unsupported shader
I get
wlc error: extension 'GL_OES_EGL_image_external' unsupported in fragment shader
It works in x11 mode
Thanks
Having information such as adapter names is useful.
The crash occurs immediately after an SDL surface is created. The backtrace is usually empty. The same applications work in Weston.
Linux 4.0.6-1-Arch
wlc r387
orbment r385
Are there any details i can provide to help identify the source of the problem?
Easily reproduced with mpv by playing 2 videos.
Most likely regressed by commit: 23f6c03
I remember implementing this sometime. Doesn't seem to work anymore as mouse in wlc.
Provide log callback. Remove wlc_get/set_log_file functions.
When creating a new view, the geometry request handler is run before the view created handler. The ordering should be swapped around so that the client program can properly handle the geometry request.
If there is no mode with CURRENT flag check, try PREFERRED mode, and lastly the biggest resolution available.
Sometimes some drivers never have CURRENT check (though this may be driver bug), we still want to fallback instead of assert.
Provide wlc-wayland.h for registering listener for extension and functions for converting Wayland resources to wlc ones. This allows WMs to implement higher level protocol extensions. However lower level stuff such as surface roles need to be in wlc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.