summaryrefslogtreecommitdiff
path: root/clients
Commit message (Collapse)AuthorAgeFilesLines
* clients/scaler: check viewporter availabilitySimon Ser2023-05-021-0/+5
| | | | | | | | I just got bitten by this: I thought my compositor was dropping the viewport somehow, but it just didn't expose the viewporter global. Signed-off-by: Simon Ser <contact@emersion.fr>
* clients/simple-dmabuf-feedback: get buffer size from configure eventsSebastian Wick2023-04-201-6/+17
| | | | | | | | | instead of the output mode. The mode doesn't say anything about the actual output geometry which could lead to buffers extending the output region on rotated monitors. This now also works with moving the window to different monitors. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* clients/simple-dmabuf-feedback: create buffers on demandSebastian Wick2023-04-201-34/+42
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* clients/simple-dmabuf-feedback: fullscreen surface from the startSebastian Wick2023-04-201-2/+1
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* clients/simple-dmabuf-feedback: fix dangling pointersSebastian Wick2023-04-201-1/+6
| | | | | | to presentation feedback objects. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* simple-dmabuf-v4l: Add support to NV12 devices that combine planesBram Stolk2023-04-181-19/+145
| | | | | | | | | | There are V4L2 devices that will output NV12 but will do so using one dma buffer. To support this, we need to add the same dma buffer twice but with a different offset for the chrominance plane. Also supports situations of 3 planes (e.g. YU12) inside a single dma buffer. Fixes: #712 Signed-off-by: Bram Stolk (b.stolk@gmail.com)
* client-shm: Add basic keyboard supportmarius vlad2023-04-121-0/+73
| | | | | | | And use it to exit with using the KEY_ESC, similar to simple-egl. This was ripped from simple-egl ad litteram. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* simple-shm: Add maximized/fullscreen supportmarius vlad2023-04-121-1/+48
| | | | Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* simple-shm: Use buffers as a listmarius vlad2023-04-121-16/+83
| | | | | | | Rather than having them as an array. This would simplify handling of maximized and fullscreen and make things easier to reason with. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* simple-touch: Add maximized/fullscreen statesMarius Vlad2023-04-121-7/+48
| | | | | | | Helpful to have other states like maximized or fullscreen for the simple-touch client. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients/window: dismiss window on tablet tool up eventsMichael Olbrich2023-03-311-0/+11
| | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients: Add demo application for tabletsLyude Paul2023-03-312-0/+261
| | | | | | | | | | | | | | | | Note that this application does not follow best practices for handling tablet events. The events are grouped by frame, all processing should be done in the frame instead of the respective handler. A good toolkit would accumulate the data in the events and provide them as one event to the actual client once the frame is received. toytoolkit just hooks up the handler one-by-one, so we're doing this here as well. Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Lyude Paul <thatslyude@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients/desktop-shell: Add tablet support to the top panel of the desktop shellLyude Paul2023-03-312-0/+60
| | | | | | | | Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Lyude Paul <thatslyude@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients: Add support for tablet cursor motion to window frames in libtoytoolkitLyude Paul2023-03-311-0/+54
| | | | | | | | | | | | | | When it comes to a window frame, a tablet tool and cursor act almost identical; they click things, drag things, etc. The tool type and extra axes don't serve any use in the context of a window frame, so tablet pointers share the frame_pointer structures used for the mouse pointer. Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Lyude Paul <thatslyude@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients/window: Add tablet cursor support into libtoytoolkitLyude Paul2023-03-312-6/+147
| | | | | | | | | | | | Again, a lot of this is code that has been reused from the cursor code for pointers. Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Lyude Paul <thatslyude@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients/window: add support for handling tabletsMichael Olbrich2023-03-313-0/+595
| | | | | | | | Based on a patch from: Peter Hutterer <peter.hutterer@who-t.net> Lyude Paul <thatslyude@gmail.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* clients/simple-egl: Implement fractional-scale protocol supportRobert Mader2023-03-312-13/+97
| | | | | | | | | | | Fractional scale is increasingly common in the Wayland ecosystem. Thus, given simple-egl's role as egl example client, implement support for the new protocol - even though Weston itself does not support it yet. Together with buffer_scale and buffer_transform this ensures simple-egl provides optimally sized and oriented buffers. Signed-off-by: Robert Mader <robert.mader@collabora.com>
* clients/simple-dmabuf-feedback: drop outdated commentLeandro Ribeiro2023-03-281-33/+21
| | | | | | | | | | | | | | | | There's a comment explaining how to hack the DRM-backend in order to fake that a certain format is not supported by the KMS device. This is useful in order to test dma-buf feedback implementations using the simple-dmabuf-feedback client. But with recent changes on the DRM-backend, this got outdated. Drop this comment, as everyone interested in this client is probably familiar enough with the DRM-backend in order to do that. Also made some adjustments to other comments explaining how this client works. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
* clients/simple-dmabuf-feedback: Remove unsupported f suffixesDaniel van Vugt2023-03-171-1/+1
| | | | | | | | | | | NVIDIA is more pedantic than Mesa and correctly complains that `1.0f` is not valid syntax in the OpenGL ES Shading Language version 1.00. And we are indeed using SL version 1.00 by virtue of using an ES 2.0 context. So use the syntax compatible with the context we've created. Signed-off-by: Daniel van Vugt <daniel.van.vugt@canonical.com>
* clipping: Use struct weston_coord in vertex clipping codeDerek Foreman2023-02-092-52/+72
| | | | | | | Remove the independent x, y floats from the clipping code and replace them with struct weston_cord. This includes the polygon8 structure as well. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* clients/simple-egl: Add a vertical bar modeDerek Foreman2023-02-011-3/+66
| | | | | | | Add an animation that moves a vertical bar from left to right. This is nice for testing the tearing extension. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* clients/simple-egl: Refactor out drawing codeDerek Foreman2023-02-011-43/+52
| | | | | | | Pull the triangle draw code into its own function so we can more readily add other animations later. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* clients: Add tearing control to simple-eglDerek Foreman2023-02-012-1/+44
| | | | | | Add a new command line option to test the tearing-control protocol. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* ttk: Use weston_matrix_init_transform in toy toolkitDerek Foreman2023-01-162-70/+10
| | | | | | Setup the cairo matrix with our new transform function. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* ivi-shell: add screenshot capabilityMarco Felsch2022-12-071-1/+1
| | | | | | | | Various shells provide the functionality to take screenshots using the weston-screenshooter or a key combination. This is useful on the ivi-shell, too. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
* clients/screenshot: build screenshooter with kiosk-shell and fullscreen-shellMichael Tretter2022-12-071-13/+14
| | | | | | | | The output capture protocol is also provided by the kiosk shell and the fullscreen shell. Therefore, the weston-screenshooter to take screenshots should be built if the desktop shell is disabled, too. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
* clients: rewrite screenshot.c for new protocolPekka Paalanen2022-11-292-162/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functionality of this screenshooting helper client is kept exactly the same as before: if you have multiple outputs, some transformed, some scale, in any layout, this will create a "multi-image" where the framebuffer (the physical image) of each output is pasted into a row of images in the order the outputs were advertised thrugh wl_registry. Output transform or scale are not accounted for. If you have a monitor rotated sideways, the screenshot will have the image of that monitor reverse-sideways. Otherwise the client is almost completely re-written, so trying to read the diff is not that useful. The old screenshooting protocol is replaced with the new weston-output-capture protocol. This makes it unnecessary to listen for wl_output information (since we do not handle output transform or scale anyway). The buffer sizes and formats are dictated by the compositor, which also means we cannot hardcode the format. Hence, use Pixman for the blitting, in case it needs to do format conversion. It is good to get rid of hand-crafted pixel data manipulation code too. For that reason we also need a pixel format database to convert between DRM fourcc, wl_shm and Pixman codes. We link to libweston to borrow its database instead of inventing another partial copy of it. It's weird to use compositor library private API in a client, but better than the alternative. The original code had no tear-down code at all. Now, if everything succeeds, the program ends with no unfreed memory according to ASan. If something fails, it still YOLO's it (doesn't free stuff). That's how far my pedantry carried. I also did not bother taking output transform or scale into account, since the old code did not either. It would be nice to create a seamless image of the desktop with shots rotated and scaled to align, in the max scale over all outputs. Meh. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* simple-dmabuf-feedback: Correct the rectangle orientationMarius Vlad2022-11-071-1/+4
| | | | | | | | Similar to changes in simple-dmabuf-egl, this perform a x-axis reflection as it has the same NDC values as simple-dmabuf-egl and we get an inverted image. We do it straight in the shader this time. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients/simple-dmabuf-egl: drop Y_INVERT flagSimon Ser2022-11-072-14/+39
| | | | | | | | | | | | | | | | | | | | The motivations for this are: - Y_INVERT is not used by most real-world clients. weston-simple-dmabuf-egl and weston-simple-dmabuf-v4l are one only known users. Thus this creates a special case just for these demo clients. - Some compositors (wlroots) have dropped support for DMA-BUF flags, so the client no longer runs there. - Dropping the flag allows compositors to use a KMS hardware plane to display the buffer. It keeps the same axis orientation we had in place where we had the y-invert flag enabled by default, by doing a reflection about x-axis. Signed-off-by: Simon Ser <contact@emersion.fr> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Closes: https://gitlab.freedesktop.org/wayland/weston/-/issues/675
* helpers: Add a u64 from 2 u32 helperDerek Foreman2022-10-274-4/+4
| | | | | | | We do this enough that having a single implementation for it is probably a win. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* simple-egl: Add option for fixed width/height fullscreen ratioRobert Mader2022-10-051-0/+12
| | | | | | | | | | As a realistic scenario used by clients. The motivation is to have an easy way to test correct fullscreen behavior of compositors, as they have to compensate for the smaller buffer size by adding black bars. Signed-off-by: Robert Mader <robert.mader@collabora.com>
* clients/eventdemo: Remove duplicated param entriesMarius Vlad2022-09-141-2/+0
| | | | | | | | Removes doxygen warning. Fixes #664 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients: Fix cursors when compositor gives wl_seat before wl_compositorDerek Foreman2022-09-121-2/+11
| | | | | | | | | | | | | We have no guarantee that we can create a surface for the pointer at the instant we receive a seat that will (probably eventually) need one. Hold off until we receive an enter event before creating this - at that point we know with certainty that wl_compositor is available, since we've used it to create the surface that was entered. Fixes #659 Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* simple-egl: Update buffer_size dimensions when starting as maximizedMarius Vlad2022-08-221-83/+89
| | | | | | | | | | | | | | With commit 62ab6891db9763dd44228, 'clients/simple-egl: Handle buffer scale and transform' we changed the way we resized the client, by encapsulating the resize in update_buffer_geometry() function. we didn't correct that when creating the EGL window, which might be problematic if you attempt to start the window with different a different state, like maximized. Fixes 62ab6891db9763dd4 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients/simple-egl: call eglSwapInterval after eglMakeCurrentErik Kurzinger2022-08-121-3/+3
| | | | | | | | | | | If weston-simple-egl is run with the "-b" flag, it will attempt to set the swap interval to 0 during create_surface. However, at that point, it will not have made its EGLContext current yet, causing the eglSwapInterval call to have no effect. To fix this, wait until the EGLContext has been made current in init_gl before updating the swap interval. Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
* clients: Set the hotspot with attach if we already have a valid cursorDerek Foreman2022-08-101-5/+24
| | | | | | | | We want atomic hotspot updates - this can't happen with wl_pointer_set_cursor. So if we have a surface that already has a cursor role, just update the hotspot when attaching new content. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* Revert "clients/window: atomically update pointer cursor"Derek Foreman2022-08-101-14/+5
| | | | | | | | | | This reverts commit 992ee045f1b59c037165ecdd752c2f2d78f16ee4. Recreating the surface for every cursor change causes flickering cursors on some compositors, and is not the best way to achieve atomic cursor updates Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* Revert "clients/window: Fix animated cursors"Derek Foreman2022-08-101-8/+17
| | | | | | | | | | | | This reverts commit f079f43658d9cbffa402a84101b31072775d3619. This only partially fixed a problem introduced in 992ee045f1b59c037165ecdd752c2f2d78f16ee4 I'm reverting that commit in favor of a different fix, so this broken fix needs to go first. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* clients/window: Bump xdg-shell version to latestMarius Vlad2022-07-261-1/+17
| | | | | | | | It seems we've missed an update from 3 to 4 (bounds events). With it, this updates to version 5 which sends the capabilities event. Stubs, as we're not using them. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients/simple-touch: use xzalloc() for bufferPekka Paalanen2022-07-201-4/+2
| | | | | | | | | This file relied on shared/xalloc.h to include <libweston/zalloc.h>. That would be a problem if xalloc.h stopped doing that. Just use xzalloc(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* shared: rewrite fail_on_null() as abort_oom_if_null()Pekka Paalanen2022-07-201-6/+6
| | | | | | | | | | | | | | | | | | | | | Recently I learnt that fprintf() is not async-signal-safe. Maybe it also attempts to allocate memory sometimes. Hence, using it when we presumably are out of memory is wishful thinking. Therefore replace that with async-signal-safe code. If you have to check pointers from traditional signal handlers, now you could do that too! While doing this, we also lose the string formatting for line number. I would argue that printing file and line number is not that useful, if the system really is out of memory. If not out of memory, a core dump would give us much more detailed information about what went wrong. clients/window.c had some calls to fail_on_null() and these are simply replaced. They were used for checking that creating new wl_proxy by issuing a protocol request worked, and IIRC that only fails on out-of-memory, so the same rationale applies here. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* desktop-shell: Use custom_env to launch panel clientsDaniel Stone2022-07-191-58/+16
| | | | | | | Rather than open-coding our own implementation of parsing a string to construct an envp and an argp, just use custom_env's implementation. Signed-off-by: Daniel Stone <daniels@collabora.com>
* clients/presentation-shm: Bind to xdg_wm_base version 1Michel Dänzer2022-06-301-1/+1
| | | | | | | | | | | | It was binding to any advertised version, but it can't actually work with version 4 (because it doesn't handle the new configure_bounds event). Other sample clients in the tree are hard-coding version 1, so do the same here. Fixes: 6d9fda715609 ("clients/presentation-shm: use xdg_shell instead of wl_shell") Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
* cairo-util: Clean up more Cairo detritus; almost all of itDaniel Stone2022-06-291-0/+1
| | | | | | | | | Pango, Cairo, and fontconfig, all want to leave thread-global data hanging around in order to maintain a cache. Try to clean up as much of it as we possibly can on exit, apart from the Pango language string which appears to be unfreeable, so has been added to LSan suppressions. Signed-off-by: Daniel Stone <daniels@collabora.com>
* weston-terminal: Don't leak Cairo fontsDaniel Stone2022-06-291-0/+3
| | | | | | The docs say they're ours to unref. Signed-off-by: Daniel Stone <daniels@collabora.com>
* weston-terminal: Make exit path a little more obviousDaniel Stone2022-06-291-3/+5
| | | | Signed-off-by: Daniel Stone <daniels@collabora.com>
* weston-terminal: Fix some egregious memory leaksDaniel Stone2022-06-291-2/+12
| | | | | | | Some of the Pango bits still leak, but this takes care of a lot of the worst. Signed-off-by: Daniel Stone <daniels@collabora.com>
* toytoolkit: Delete remnants of EGL supportDaniel Stone2022-06-294-1894/+0
| | | | | | | This code was all dead, since neither cairo-glesv2 nor the sample nested compositor ever made it to the Meson build. Signed-off-by: Daniel Stone <daniels@collabora.com>
* clients/window: Defer closing of windowMarius Vlad2022-06-221-3/+14
| | | | | | | | | | | | | | | | | Instead of closing the window directly by calling close_handler() use a deferred task to do that instead. That way we avoid a potential invalid access on a link which was previously removed, due to the fact both window_destroy() and touch_handle_up() traverse the same list. This is an alternative to 841. Fixes: #607. Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reported-by: He Yong <hyyoxhk@163.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* clients/simple-egl: Fix angle reset on benchmark intervalRobert Mader2022-06-141-3/+7
| | | | | | | | | | | | | | | | | | | Commit 62ab6891db976 intended to change the angle calculation so that the a time delta since the first frame would be used instead of the absolute time. That was done in order to ensure the angle would always start with the same value, allowing users to differentiate left and right, which again is needed when testing flipped transforms. However, the `benchmark_time` variable is unsuitable for that purpose as it gets reset on each benchmark interval, abruptly changing the angle. Thus introduce a dedicated variable. Fixes 62ab6891db976 Signed-off-by: Robert Mader <robert.mader@collabora.com>