summaryrefslogtreecommitdiff
path: root/kiosk-shell
Commit message (Collapse)AuthorAgeFilesLines
* libweston: Use weston_coord in struct weston_viewDerek Foreman2023-02-242-21/+21
| | | | Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Use weston_coord in struct weston_pointerDerek Foreman2023-02-171-6/+6
| | | | | | | | | | Convert the bare x,y coordinates into struct weston_coord and update all users. We keep the surface position in wl_fixed_t for now so it still exactly matches the position most recently sent to clients. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston: Use weston_coord space conversion functionsDerek Foreman2023-02-011-6/+11
| | | | | | | Update users of the old coordinate space conversion functions that take x, y pairs to the new weston_coord versions. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* libweston, shared: Move out weston_shell_get_binding_modifierMarius Vlad2023-01-091-1/+1
| | | | | | | | This doesn't really belong into shell-utils, so better move it out to shared/config-parser. Renamed to weston_config_get_binding_modifier to maintain the same namespace. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* shell-utils: Integrate shell-utils into libwestonMarius Vlad2023-01-092-10/+10
| | | | | | | | | | | These shell utils functions are potentially useful to other shells as well, so make them widely available. Renamed all functions to weston_shell_utils namespace. No functional change, copied ad litteram. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Don't use a modifier for surface activation bindingsAlexandros Frantzis2022-10-211-3/+3
| | | | | | | | | The mouse button and touch bindings to activate a surface shouldn't use the binding modifier. Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/679 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* kiosk-shell: Update view transform after activation.Alexandros Frantzis2022-10-111-0/+1
| | | | | | | | | | | | The activation of a view implies, among other things, a change in the associated view layer which is initially unset. In order for this change to be reflected in the corresponding surface's output mask, and hence allow surface damage to trigger output repaints, we need to update the view transform. Fixes #674 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* libweston/desktop: Migrate libweston-desktop/libweston-desktop.hMarius Vlad2022-09-231-1/+1
| | | | | | | | | | | With commit 'Move libweston-desktop into libweston' we've moved out libweston-desktop DSO into libweston. Move also the header to libweston/desktop. This removes removes the libweston-desktop pc file and bumps libweston major version to 12. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Enable debug keybindingsMarius Vlad2022-08-081-3/+9
| | | | | | | We are missing debug keybinds in kiosk-shell so install them. Adds the binding-modifier like in desktop-shell in a helper. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* shells: Add libweston-desktop API to query position and add to shellsDerek Foreman2022-06-291-0/+12
| | | | | | | | We're going to need this to properly send xwayland events later, so add API to get the current x,y co-ordinates of a shell surface and add it to the kiosk and desktop shells. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* Move libweston-desktop into libwestonDaniel Stone2022-06-281-1/+0
| | | | | | | | | | It's not really useful to have libweston without libweston-desktop. It's also very little code. Merging both into the same DSO will allow us to cut out a bunch of indirection and pain. Signed-off-by: Daniel Stone <daniels@collabora.com>
* kiosk-shell: Don't link desktop-shell protocolsDaniel Stone2022-06-281-2/+0
| | | | | | We don't need these. Signed-off-by: Daniel Stone <daniels@collabora.com>
* weston-curtain: Always mark surface as mappedDaniel Stone2022-06-161-1/+0
| | | | | | The surface always has valid content, hence it can always be mapped. Signed-off-by: Daniel Stone <daniels@collabora.com>
* libweston: Add weston_surface_map() wrapperDaniel Stone2022-06-161-2/+2
| | | | | | | Change all instances of surface->is_mapped = true, to a specialised function. Signed-off-by: Daniel Stone <daniels@collabora.com>
* Move shell-utils to its own directoryDaniel Stone2022-03-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shell-utils contains a number of helpers which are currently in use by both desktop-shell and kiosk-shell. In order to extend this use to fullscreen-shell as well (which can benefit from reusing the weston_curtain infrastructure to be able to create solid-colour views which may or may not be opaque, as well as one function within fullscreen-shell which was copied wholesale to shell-utils), we need to create a separate Meson dependency object, and avoid the existing pattern of including the source from shared/ within the source list for each shell. This requires creating a new top-level directory for these shared helper functions which are required by each shell, but are not part of libweston in and of itself. shell-utils depends on libweston-desktop; libweston-desktop depends on libweston; libweston depends on shared. Thus it is not possible to expose a dependency object from the shared/ directory which declares a dependency on the libweston-desktop dependency, as Meson processes directories in order and resolves variable references as they are parsed. In order to break this deadlock, this commit creates a new top-level directory called 'shell-utils' containing only this file, which can be parsed by Meson after libweston-desktop (making the libweston-desktop Meson dependency variable available to the build file to declare a dependency on that), but before the shells (making the new Meson depenendency object available to each shell which wishes to use it). This commit contains no functional changes to any observable code. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Encapsulate weston_curtain in its own structDaniel Stone2022-03-312-12/+12
| | | | | | | This will allow us to create a solid weston_buffer as well, since we need to store that separately. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Make input capture optional for curtainsDaniel Stone2022-03-311-0/+2
| | | | | | | desktop-shell's focus surfaces want to reuse this, but they don't want to capture the input, instead allowing it to fall through. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Add alpha to weston_curtain_createDaniel Stone2022-03-311-0/+1
| | | | | | | Not all solid-colour views want to be opaque: sometimes we use them with non-opaque alpha values in order to shade views underneath them. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Move weston_curtain_create params into the structDaniel Stone2022-03-311-4/+6
| | | | | | | | | | Given that we have a struct for argument params, we might as well use it rather than have them split between the struct and native params. For consistency between the implementations, this also includes a shift from float to int positioning for the base offset within the compositor's global co-ordinate space. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Rename weston_solid_color_surface to weston_curtain_paramsDaniel Stone2022-03-311-8/+8
| | | | | | | | | | The name implied that it was a surface in and of itself, rather than parameters used by a helper to create a surface and view. Rename it now that we have weston_curtain as a name, and clean up initialisers. Signed-off-by: Daniel Stone <daniels@collabora.com>
* shell: Rename solid_color_surface to weston_curtainDaniel Stone2022-03-311-6/+5
| | | | | | | | create_solid_color_surface actually returns a weston_view that it creates internally. Since weston_solid_color_view is long and dull, rename it to weston_curtain. Signed-off-by: Daniel Stone <daniels@collabora.com>
* kiosk-shell: Favor out views on same outputMarius Vlad2022-02-031-2/+12
| | | | | | | | | In multiple output cases, finding the succesor from the inactive layer might result in picking the wrong view when there are multiple views being stacked in the inactive layer. This adds two additional checks to favor views on the same output as the one being destroyed/removed. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Don't occlude shsurf on other outputsMarius Vlad2022-02-031-2/+4
| | | | | | | | | | | | This adds an additional check to make sure the current focus surface is on the same output as the surface that is going to be activated. This is necessary in order to avoid placing the currently focused one in the inactive layer, which shouldn't happen in situations where the new surface is going to be placed on a different output than the currently focused one. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Check if app_ids have been set after initial commitMarius Vlad2022-02-032-1/+26
| | | | | | | | | | | | | Some applications would set-up the app_id after the initial commit (without a buffer) which is too late to correctly assign the application to the corresponding output set-up in the configuration file. This patch fixes that by checking one more time, after a buffer has been attached, if indeed there's an output with an app_id set. Fixes: #469 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Do not leave views on layers on shell destroyMarius Vlad2021-12-171-4/+22
| | | | | | | | | Nothing special, but avoids hitting the warning about terminating/finishing a layer with views on it. Fixes #509. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Add a border fill to non-fullscreen viewsMarius Vlad2021-12-082-3/+25
| | | | | | | | | | | | | According to xdg-shell spec, if the surface doesn't cover the whole output we should center it and install a border fill covering the rest of the output. While we center out the surface we never got around installing the border fill. This patch re-uses the activation of a surface to control this bit as well, by making use of an new layer to place the surface while not being active. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Remove keyboard_focus and seat_caps listenersMarius Vlad2021-11-122-40/+0
| | | | | | | | The seat_cap listener was to register a signal for keyboard_focus, which we no longer use. Remove it entirely to avoid dead code. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Suggested-by: Derek Foreman <derek.foreman@collabora.com>
* kiosk-shell: ignore additional seatsMarius Vlad2021-11-121-1/+12
| | | | | | | | As kiosk-shell can't cope with multiple seat add a warning and avoid creating any new seats. With it, this guards against potentially receiving an invalid seat. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Handle child top-level windows at destructionMarius Vlad2021-11-121-0/+8
| | | | | | | | | | With the seperation of surface activation and keyboard input, a special corner case arose for child top-level windows when surfaces are being destroyed. To make sure we never pick the wrong window to activate upon destruction, we verify if the current focused surface is different than the one being destroyed. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Embed keyboard focus activation codeMarius Vlad2021-11-121-31/+76
| | | | | | | | | | | | | | | Just like desktop-shell, we shouldn't be dependent on having a keyboard be present in order to activate a window/surface. This adds a libweston helper to retrieve the first available seat, and to use it in order to avoid going over the seat list. We also encapsulate the activation of the surface in one place, and use it on surface removal, when the surface has been committed, or for touch/pointer events. With it we also deal with the keyboard focus and shell activation in one place. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Allow to retrieve surface labelsMarius Vlad2021-11-021-0/+3
| | | | | | Nothing special, but allows scene-graph to display surface labels. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* desktop-shell, kiosk-shell: Migrate helpers to create a view to shell-utilsMarius Vlad2021-11-024-119/+13
| | | | | | Incidentally fixes #553 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* shared/shell-utils: Create common helpers functions for shellsMarius Vlad2021-11-024-110/+2
| | | | | | | Group common functions found in both kiosk-shell and deskop-shell to a shared utils file. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* libweston: Rename weston_view_activate() to weston_view_activate_input()Marius Vlad2021-11-021-3/+3
| | | | | | | This way, we try to differentiate between input focus and window/surface activation. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Swap green with blue for the background-colorMarius Vlad2021-11-011-2/+2
| | | | | | | Fix a trivial typo, where the green channel was swapped with the blue channel, resulting in rbg instead of rgb. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: call weston_layer_fini()Pekka Paalanen2021-05-281-0/+3
| | | | | | | | This ensures the layers are torn down properly. See commit: libweston: add weston_layer_fini() Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* kiosk-shell: Read background-color from ini fileMarius Vlad2021-04-042-1/+20
| | | | | | | | | desktop-shell's client is able to read-up from the config file, [shell] section the background, but for kiosk-shell we don't actually have client that does that, so instead allow the shell do that directly. Seems to be a useful thing to have, as a default background color. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Add transform_handler to correctly position xwayland surfacesMarius Vlad2021-04-042-0/+38
| | | | | | | | | | | | When using xwayland surfaces and multiple outputs we need to notify xwayland surface that the surface position has changed, otherwise we're going to end up with pop-ups being displayed on other outputs rather than the one were the main surface resides. Stolen from desktop-shell. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Suggested-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* kiosk-shell: Enable screenshooter in kiosk-shellMarius Vlad2021-04-041-0/+2
| | | | Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Give keyboard focus when mapping the surfaceMarius Vlad2021-02-281-4/+5
| | | | | | | | | | Doing it when the surface is being added would cause clients that wait for frame callbacks to wait indefinitely as the surface being activated is not yet, committed. Fixes: #473 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Keep track of seats created and destroy them at endMarius Vlad2020-11-042-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kiosk_shell_destroy() will free up weston_desktop, but still keeping listeners set-up (keyboard/seat/caps), which will fire when the the compositor is stopped/shutdown by clients still connected. This patch maintains a list of seats and uses it to remove any listeners when calling kiosk_shell_destroy(). desktop-shell and ivi-shell do not appear to be using weston_desktop_destroy() in their respective destroy parts. This avoids an illegal access happening when calling one of the listeners, after weston_desktop has been free'ed, like the following: ==2002== at 0x10F3F8FD: weston_desktop_get_display (libweston-desktop.c:125) ==2002== by 0x10F450A7: weston_desktop_xdg_surface_schedule_configure (xdg-shell.c:1022) ==2002== by 0x10F44793: weston_desktop_xdg_toplevel_set_activated (xdg-shell.c:643) ==2002== by 0x10F41AA5: weston_desktop_surface_set_activated (surface.c:468) ==2002== by 0x10F32E7E: kiosk_shell_seat_handle_keyboard_focus (kiosk-shell.c:329) ==2002== by 0x4A726A7: wl_signal_emit (wayland-server-core.h:478) ==2002== by 0x4A75BD1: weston_keyboard_set_focus (input.c:1586) ==2002== by 0x4A776FE: notify_keyboard_focus_out (input.c:2314) ==2002== by 0x5902BC1: udev_seat_destroy (libinput-seat.c:469) ==2002== by 0x59028C5: udev_input_destroy (libinput-seat.c:375) ==2002== by 0x58F0449: drm_destroy (drm.c:2571) ==2002== by 0x4A6EE39: weston_compositor_destroy (compositor.c:7814) ==2002== Address 0x10bd1780 is 0 bytes inside a block of size 152 free'd ==2002== at 0x48399AB: free (vg_replace_malloc.c:538) ==2002== by 0x10F3F8DA: weston_desktop_destroy (libweston-desktop.c:112) ==2002== by 0x10F34357: kiosk_shell_destroy (kiosk-shell.c:1009) ==2002== by 0x4A5F618: wl_signal_emit (wayland-server-core.h:478) ==2002== by 0x4A6EE06: weston_compositor_destroy (compositor.c:7809) ==2002== by 0x4855548: wet_main (main.c:3420) ==2002== by 0x109154: main (executable.c:33) ==2002== Block was alloc'd at ==2002== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==2002== by 0x10F3F681: zalloc (zalloc.h:38) ==2002== by 0x10F3F724: weston_desktop_create (libweston-desktop.c:65) ==2002== by 0x10F34458: wet_shell_init (kiosk-shell.c:1045) ==2002== by 0x484F83D: wet_load_shell (main.c:924) ==2002== by 0x48552D3: wet_main (main.c:3361) ==2002== by 0x109154: main (executable.c:33) Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
* kiosk-shell: Introduce kiosk/fullscreen shell for desktop appsAlexandros Frantzis2020-07-307-0/+1764
kiosk-shell is fullscreen shell for apps that use the xdg-shell protocol. The goal is to make life easier for people shipping embedded devices with simple fullscreen shell requirements, and reduce the proliferation of desktop-shell hacks. Top level surfaces are made fullscreen, whereas dialogs are placed on top in the center of the output and retain their natural sizes. Dialogs can be moved and (un)maximized, but resizing is currently not supported. An app can be directed to a particular output by populating the "app-ids" field with the app's XDG app id, in the relevant "[output]" section in the weston config file. Fixes: #277 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>