summaryrefslogtreecommitdiff
path: root/desktop-shell/shell.h
Commit message (Collapse)AuthorAgeFilesLines
* desktop-shell: Make zapping configurableBob Ham2016-01-121-0/+1
| | | | | | | | Add a new boolean weston.ini option, "allow-zap" to enable or disable the Ctrl-Alt-Backspace key combination. Signed-off-by: Bob Ham <bob.ham@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* xwm: let the shells decide the position of X windowsGiulio Camuffo2015-12-181-0/+1
| | | | | | | | | | | | | The xwm used to automatically send to Xwayland the position of X windows when that changed, using the x,y of the primary view of the surface. This works fine for the desktop shell but less so for others. This patch adds a 'send_position' vfunc to the weston_shell_client that the shell will call when it wants to let Xwayland know what the position of a window is. The logic used by the desktop-shell for that is exactly the same the xwm used to have. Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: David Fort <contact@hardening-consulting.com>
* desktop-shell: Rename protocol weston_desktop_shellJonas Ådahl2015-11-191-2/+2
| | | | | | | | | | | | | In the effort of going away from generic names of protocols only relevant for weston, rename the weston desktop shell weston_desktop_shell. This also resets the version to 1, as there will be no prior versions to weston_desktop_shell. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* input: Pass the appropriate pointer type to bindings instead of a seatDerek Foreman2015-07-161-1/+1
| | | | | | | | | | | | | | | | | Normally we need to check if a seat's [device_type]_count is > 0 before we can use the associated pointer. However, in a binding you're guaranteed that the seat has a device of that type. If we pass in that type instead of the seat, it's obvious we don't have to test it. The bindings can still get the seat pointer via whatever->seat if they need it. This is preparation for a follow up patch that prevents direct access to seat->device_type pointers, and this will save us a few tests at that point. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Allow multiple active fullscreen windows on multi-display setup.Mario Kleiner2015-06-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Desktop shell demoted all fullscreen shell surfaces on all active outputs of a multi-display setup whenever any shell surface was activated anywhere. This made it impossible to have multiple fullscreen windows on separate outputs active at the same time, as creating or activating any shell surface would disable fullscreen status for all existing fullscreen surfaces. Make lower_fullscreen_layer() more selective, so on request it only demotes fullscreen surfaces on a specified weston_output. The activate() method for a specific surface will now only request demotion of fullscreen surfaces on the target output of the activated surface, but leave fullscreen surfaces on unrelated outputs alone. Desktop wide acting functions like the window switcher or exposay will still demote all fullscreen surfaces on all outputs to implement their effect as before. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* text_backend: make destructor call explicitPekka Paalanen2015-06-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to rely on the order in which the weston_compositor::destroy_signal callbacks happened, to not access freed memory. Don't know when, but this broke at least with ivi-shell, which caused crashes in random places on compositor shutdown. Valgrind found the following: Invalid write of size 8 at 0xC2EDC69: unbind_input_panel (input-panel-ivi.c:340) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea360 is 208 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Invalid write of size 8 at 0x4E3E0D7: wl_list_remove (wayland-util.c:57) by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550) by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264) by 0x40DB8B: weston_surface_destroy (compositor.c:1883) by 0x40DB8B: weston_surface_destroy (compositor.c:1873) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea370 is 224 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Invalid write of size 8 at 0x4E3E0E7: wl_list_remove (wayland-util.c:58) by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550) by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264) by 0x40DB8B: weston_surface_destroy (compositor.c:1883) by 0x40DB8B: weston_surface_destroy (compositor.c:1873) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea368 is 216 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Looking at the first of these, unbind_input_panel() gets called when the text-backend destroys its helper client which has bound to input_panel interface. This happens after the shell's destroy_signal callback has been called, so the shell has already been freed. The other two errors come from wl_list_remove(&input_panel_surface->link); which has gone stale when the shell was destroyed (shell->input_panel.surfaces list). Rather than creating even more destroy listeners and hooking them up in spaghetti, modify text-backend to not hook up to the compositor destroy signal. Instead, make it the text_backend_init() callers' responsibility to also call text_backend_destroy() appropriately, before the shell goes away. This fixed all the above Valgrind errors, and avoid a crash with ivi-shell when exiting Weston. Also using desktop-shell exhibited similar Valgrind errors which are fixed by this patch, but those didn't happen to cause any crashes AFAIK. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: remove screensaver supportPekka Paalanen2015-06-221-8/+0
| | | | | | | | | | | | | | | | | | | | | This is a follow-up for the patch that removed weston-screensaver. The aim is to clean up shell.c a little by removing non-essential components. Vanilla Weston desktop is only a demo, external projects are encouraged to create user-friendly desktop environments. The support for launching a screensaver client and the protocol bindings are removed. With them, all related configuration options are removed, and the manuals are updated accordingly. The screensaver protocol definition is left in desktop-shell.xml for posterity. This does not affect Weston's or desktop-shells ability to put screens to sleep after inactivity. The inactivity timer continues to operate as before. Also screen locking is unaffected. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* *-shell: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington2015-06-151-16/+17
|
* shell: quit weston, if weston-desktop-shell dies earlyPekka Paalanen2014-09-011-0/+3
| | | | | | | | | | | | | | | | If weston-desktop-shell dies soon after launch, or maybe cannot be executed at all, let weston exit rather than letting the user stare at a black screen. But, do not exit weston, if weston-desktop-shell dies later, as the user may already have apps open, and those apps would likely still function correctly. This gives the user the opportunity to save his work and close the apps properly. This should make one class of "I see only black screen" failures obvious. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* shell: fix race on desktop-shell exitPekka Paalanen2014-08-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The desktop shell plugin registers both a wl_client destroy signal listener, and a sigchld handler, when launching weston-desktop-shell. However, nothing guarantees in which order do the wl_client destructor and the sigchld handler run. Luckily, the sigchld handler cannot interrupt any code, because we handle the signal via signalfd, which means it is handled like any event in the compositor's main event loop. Still, shell.c has a race, that when lost, can cause a crash, as described in bug #82957. If the sigchld handler happens to run first, it will try to launch a new weston-desktop-shell without removing the destroy listener from the old wl_client first. This leads to list corruption, that may cause a crash when the old wl_client gets destroyed. Simply removing the destroy listener in the sigchld handler is not enough, because respawning sets shell->child.client pointer, and if the wl_client destructor runs after, it will reset it to NULL. OTOH, the wl_client destroy handler cannot reset shell->child.process, because that would cause the sigchld handler in weston core to not find the process tracker anymore, and report that an unknown process exited. Turns out, that to make everything work, we would need to wait for both the wl_client destructor and the sigchld handler to have run, before respawn. This gets tricky. Instead, solve the problem by removing shell->child.process. Use the new weston_client_start() which automatically creates and manages the struct weston_process. The shell does not need to know about the process exit, it only needs to know about the client disconnect. Weston-desktop-shell will never attempt to reconnect, and it would not work even if it did, so disconnect is equivalent to weston-desktop-shell exiting. This should permanently solve the race for weston-desktop-shell. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82957 Cc: Boyan Ding <stu_dby@126.com> Cc: Derek Foreman <derekf@osg.samsung.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: add set_panel_position to help place views onscreenJonny Lamb2014-08-201-0/+4
| | | | | | | | | | | | | | Panels are always assumed to be on the top edge of the output. If this is not the case views will be placed under the panel, wherever it is, and maximize doesn't use the correct space allocated for views. By telling the server on which edge the panel is located, it can correctly calculate where to put new views and how big maximized views should be. [Pekka Paalanen: the user of this protocol so far is Maynard.] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: add close-animation config option for destroying surfacesJonny Lamb2014-08-181-0/+1
| | | | | | | At the moment when surfaces are destroyed they are faded out but let's make it configurable! Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Properly handle seat hotpluggingJason Ekstrand2014-04-291-0/+1
| | | | | | | | | | Previously, desktop-shell would only create its internal shell_seat object for each seat available when the desktop-shell module is loaded. This is a problem any time seats are created dynamically. In particular, the Wayland and RDP backends create seats on an as-needed basis and they weren't getting picked up proprely by desktop-shell. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77649
* desktop-shell: Properly handle lowered fullscreen surfacesEmilio Pozuelo Monfort2014-04-291-4/+1
| | | | | | | | | | | | | | | | | | | lower_fullscreen_surface() was removing fullscreen surfaces from the fullscreen layer and inserting them in the normal workspace layer. However, those fullscreen surfaces were never put back in the fullscreen layer, causing bugs such as unrelated surfaces being drawn between a fullscreen surface and its black view. Change the lower_fullscreen_surface() logic so that it lowers fullscreen surfaces to the workspace layer *and* hides the black views. Make this reversible by re-configuring the lowered fullscreen surface: when it is re-configured, the black view will be shown again and the surface will be restacked in the fullscreen layer. https://bugs.freedesktop.org/show_bug.cgi?id=73575 https://bugs.freedesktop.org/show_bug.cgi?id=74221 https://bugs.freedesktop.org/show_bug.cgi?id=74222
* shell: Fix view repositioning logic for output move and destroyAnder Conselvan de Oliveira2014-04-111-0/+8
| | | | | | | | | | | | | | Previously, the repositioning logic would iterate the compositor's list of layers and move the views on those layers. However, that failed in two different ways: it didn't cover hidden workspaces and crashed when the display was locked. This patch changes the logic to explicit iterate over all the layers owned by the shell. The iteration is done through a helper function, shell_for_each_layer(). https://bugs.freedesktop.org/show_bug.cgi?id=76859 https://bugs.freedesktop.org/show_bug.cgi?id=77290
* compositor: implement xdg_surface_set_minimized()Manuel Bachmann2014-04-021-0/+2
| | | | | | | | We now handle the client-side xdg_surface_set_minimized() call, and eventually hide the target surface by moving it to a dedicated layer. Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
* exposay: arrange views per-outputEmilio Pozuelo Monfort2014-02-181-30/+44
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=73173
* compositor: Remove weston_output::move_signalAnder Conselvan de Oliveira2014-02-051-0/+1
| | | | | | | | | Since that signal is per output, it is necessary to track in which output a view is in so that the signal is handled properly. Instead, add a compositor wide output moved signal, that is handled by the shell. The shell iterates over the layers it owns to move views appropriately.
* shell: Disable exposay by defaultKristian Høgsberg2014-01-161-0/+1
| | | | | | Add a config file option to enable it, but leave it off by default. Exposay still triggers too many lock-ups or stuck grabs and triggers under X even when the Wayland window doesn't have keyboard focus.
* exposay: set an alpha on fullscreen surfacesEmilio Pozuelo Monfort2014-01-071-0/+3
| | | | | This makes the desktop background actually draw when there is a fullscreen surface and we go to exposay.
* shell: Handle the desktop shell client destroy signalAnder Conselvan de Oliveira2013-12-221-0/+1
| | | | | | | | | | Set the internal pointer for the client to NULL. This fixes a segmentation fault at shutdown, where the shell would hang up before and cause libwayland to call wl_client_destroy(). When the shell was destroyed later, another call to wl_client_destroy() would cause the crash. https://bugs.freedesktop.org/show_bug.cgi?id=72550
* desktop-shell: Split out input-panel codeKristian Høgsberg2013-12-041-0/+4
|
* desktop-shell: Split out exposay immplementationKristian Høgsberg2013-12-041-0/+212