summaryrefslogtreecommitdiff
path: root/desktop-shell
Commit message (Collapse)AuthorAgeFilesLines
* desktop-shell: Don’t reconfigure an already fullscreen surfaceEmmanuel Gil Peyrot2016-05-191-0/+7
| | | | | | | | | | | | | | When we receive an wl_shell_surface::set_fullscreen request for a surface that was already fullscreen, don’t do anything if the parameters are the same as the initial request. This prevents bogus or malicious clients from being able to always stay on front by flooding the compositor with set_fullscreen requests after the user has put them in the background with a mod+tab. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor.h: Add shell_interface.get_output_work_areaQuentin Glidic2016-05-031-1/+3
| | | | | | | | This will allow plugins to be aware of e.g. panels, to avoid covering them with other surfaces. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Use 'surface-local' to correct grammarYong Bakos2016-04-291-1/+1
| | | | | | | | | Correct the pluralization by simplifying with 'surface-local'. See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* desktop-shell: Get rid of some unused fieldsJonas Ådahl2016-04-221-6/+0
| | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
* desktop-shell: Unset the shell surface owner when it goes awayJonas Ådahl2016-04-221-1/+10
| | | | | | | | | | | | | | | | | | On client destruction, the shell object may be destroyed before the shell surface objects. If this happens to two surfaces of the same client, and one surface being destroyed results in the focus being switched to the other, this would trigger a ping event. The ping event sending function relies on having a valid owner, and if the shell would be destoryed prior to the shell surface, we'd crash in this function. Solve this by unsetting the owner pointer when the shell client goes away and early out in the ping event sending function if the owner is gone. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
* input: use doubles in the interfaces to notify of input eventsGiulio Camuffo2016-03-231-3/+3
| | | | | | | | | | | | This patch is a further step in the wl_fixed_t internal sanitization. It changes the notify_* functions to take doubles instead of wl_fixed_t but does not change how these are stored in the various input structs yet, except for weston_pointer_axis_event. However this already allows to remove all wl_fixed_t usage in places like the libinput or the x11 backend. Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* shell: Don't send extra configure events on clickDerek Foreman2016-02-161-0/+8
| | | | | | | | | | | | | | | | | The click_to_activate handler fires on every mouse click for a surface so let's be a little quicker to early return if you're clicking on the surface that already has activation. This prevents (among other side effects) the sending of two xdg_configure events for every mouse click. This should also make having two seats with keyboards behave in the same way as a single seat. Previously the second seat could have a keyboard focus on the surface and prevent some of the extra processing (including the extra configure events) from taking place. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* shell: Check more thoroughly for undefined surface resourceBryce Harrington2016-02-031-7/+24
| | | | | | | | | | | | | | | The surface can have an undefined resource in certain situations (such as with xwayland). So, since NULL is a valid state for this parameter, and since the wl_resource_*, etc. calls require their parameters to be non-NULL, make a practice of always checking the surface resource before making wayland calls. update v2: * Fix some c/p errors for pointer names * Drop null ptr check in add_popup_grab; probably redundant now Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* Support axis source, axis discrete, frame and axis stop eventsPeter Hutterer2016-01-192-0/+45
| | | | | | | | [jonas: only send focus wl_pointer.frame if resource supports it] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Add a weston_pointer_axis_eventPeter Hutterer2016-01-192-8/+11
| | | | | | | | Use an event struct to pass axis events around. This helps dealing with the upcoming axis discrete changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* desktop-shell: Allow binding-modifier weston.ini option to be noneBob Ham2016-01-121-12/+14
| | | | | | | | | Allow the binding-modifier option in weston.ini to take a value of "none", meaning that none of the usual Super+Tab, Super+K, Super+Fn, etc. key bindings will be enabled. Signed-off-by: Bob Ham <bob.ham@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Make zapping configurableBob Ham2016-01-122-3/+12
| | | | | | | | 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-182-10/+31
| | | | | | | | | | | | | 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>
* input: Keep per client pointer resources in their own structsJonas Ådahl2015-11-201-4/+10
| | | | | | | | | | | | | Keep all per client wl_pointer resources in a new struct called 'weston_pointer_client'. When focus changes, instead of moving a list of resources between different lists, just change the focused pointer client. The intention with this is to make it easier to add wl_pointer extensions that share the same focus as the corresponding wl_pointer. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* input: Make pointer grab motion callbacks take an event structJonas Ådahl2015-11-202-12/+14
| | | | | | | | | | | | | Instead of only passing absolute pointer coordinates, effectively loosing motion event data, pass a struct that can potentially contain different types of motion events, currently being absolute and relative. A helper function to get resulting absolute coordinates was added for when previous callbacks simply used the (x, y) coordinates. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* Remove workspaces protocolJonas Ådahl2015-11-191-113/+0
| | | | | | | | | | | | It doesn't fill a useful function and is not intended to be continued. If there is need for workspace manipulation from clients a protocol based on those future needs need to be properly designed. workspaces.xml is probably not very relevant since it did the bare minimum. 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>
* desktop-shell: Rename protocol weston_desktop_shellJonas Ådahl2015-11-193-41/+40
| | | | | | | | | | | | | 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>
* Use xdg_shell protocol from wayland-protocolsJonas Ådahl2015-11-191-1/+1
| | | | | | | 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> Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
* Use input method protocol from wayland-protocolsJonas Ådahl2015-11-191-6/+8
| | | | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: use weston_pointer_send_axisPeter Hutterer2015-11-161-7/+1
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* input: Pass axis events through pointer grab interfacesJonas Ådahl2015-11-022-0/+31
| | | | | | | | Don't only send motions and buttons but also axis events through the pointer grab interface. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Add surface_keyboard_focus_lost helperJonas Ådahl2015-11-021-25/+22
| | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Make activate_binding take a view instead of surfaceJonas Ådahl2015-10-231-5/+5
| | | | | | | | | In preparation for further refactoring. This patch also removes a redundant NULL check. Since we pass views, and views will always have an associated surface, there is no point of checking if it has. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* shell: fix maximizing windows on a secondary outputMarek Chalupa2015-10-091-4/+2
| | | | | | | | | | | commit f814c5dc9 changed get_output_work_area behaviour which broke the code for positioning maximized window. The x position was set to 2*output->x instead of to output->x fix https://bugs.freedesktop.org/show_bug.cgi?id=92357 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* input-panel: Fix show_input_panel_surface crash when no surface has focusNicolas Guyomard2015-10-071-0/+2
| | | | | | Signed-off-by: Nicolas Guyomard <nicolas.guyomard@open.eurogiciel.org> Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* cosmetic: Remove a few double semicolonsDerek Foreman2015-10-071-1/+1
| | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: NULL check whether a popup parent is a shell surfaceJonas Ådahl2015-10-071-2/+3
| | | | | | | | | | | | get_shell_surface(parent) may return NULL if the client passed a unassigned wl_surface or a wl_surface with a non-shell surface role (such as cursor role). https://bugs.freedesktop.org/show_bug.cgi?id=92316 Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* clients: Moving and rotating transient surfacesBen Hummon2015-10-061-8/+5
| | | | | | Transient surfaces use child/parent surfaces for stacking order. This change resloves an issue in which attempting to move or rotate a toplevel transient surface can move or rotate its ancestor.
* clients: If available, prefer top level surfaces for move or rotateDerek Foreman2015-09-151-0/+23
| | | | | | | | | | This stops us from rotating or moving pop-up menus by instead rotating their parents. This is easiest to see using a multi-seat configuration. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* shell: Make sure we actually have a resource in end_busy_cursorDerek Foreman2015-09-141-0/+1
| | | | | | | | | | It's actually possible to get here after the surface has been destroyed, especially when running client apps under valgrind. That probably shouldn't be able to segfault the compositor. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* input: add a weston_pointer_clear_focus() helper functionDerek Foreman2015-08-062-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Valgrind has shown that in at least one place (default_grab_pointer_focus) we're testing uninitialized values coming out of weston_compositor_pick_view. This is happening when default_grab_pointer_focus is called when there is nothing on the view list, and during the first repaint when only the black surface with no input region exists. This patch adds a function to clear pointer focus and also set the sx,sy co-ordinates to a sentinel value we shouldn't compute with. Assertions are added to make sure any time pointer focus is set to NULL these values are used. weston_compositor_pick_view() now returns these values too. Now the values are always initialized, even when no view exists, and they're initialized in such a way that actually doing computation with them should fail in an obvious way, but we can compare them safely for equality. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* input: pass the global touch coordinates to the touch grabGiulio Camuffo2015-08-061-4/+10
| | | | | | | | This makes it consistent with the pointer grab, which also gets global coordinates and not surface relative ones, and allows to easily filter out gestures based on compositor global hotspots. Reviewed-by: Daniel Stone <daniels@collabora.com>
* desktop-shell: Make resize and move functions take a pointer instead of a seatDerek Foreman2015-08-061-4/+4
| | | | | | | | | An earlier patch made surface_resize() and surface_move() take pointers instead of seats, this updates the weston_shell_interface resize and move to match. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* desktop-shell: drop shell_client from the head of the surface list on destroyDerek Foreman2015-08-061-0/+7
| | | | | | | | This prevents a use after free when the surfaces are automatically cleaned up later, as shell_client's freed node was still in the surface list. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* input: Don't test keyboard/pointer/touch pointersDerek Foreman2015-07-313-90/+142
| | | | | | | | | | | | | | Keyboards and pointers aren't freed when devices are removed, so we should really be testing keyboard_device_count and pointer_device_count in most cases, not the actual pointers. Otherwise we end up with different behaviour after removing a device than we had before it was inserted. This commit renames the touch/keyboard/pointer pointers and adds helper functions to get them that hide this complexity and return NULL when *_device_count is 0. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* desktop-shell: Check for device presence properlyDerek Foreman2015-07-311-4/+4
| | | | | | | | | We should be testing device counts, not pointers. The pointers are persistent state that never gets freed, and are an inaccurate indicator of device presence after a release. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* desktop-shell: Don't call wl_list_init() in the middle of a listDerek Foreman2015-07-311-0/+2
| | | | | | | | | | | | seat->keyboard_focus_listener.link isn't a head, it's just sometimes a member of the focus signal list. Calling wl_list_init() on it puts a loop in the list. Instead, we remove the item then init it. That way we can call remove on it again later even if it hasn't been re-added to a list. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* zoom: Store the seat that initiated a zoomDerek Foreman2015-07-291-1/+1
| | | | | | | | | | | | | | Track the seat that initiated a seat instead of picking the first one. Previously, if there are multiple seats then any seat can adjust the zoom level but the zoom tracks the first seat's pointer. Now the zoom will follow the pointer of the seat that initiated the zoom. Additionally, if there's no pointer in the first seat, starting a zoom with the second seat will no longer crash weston. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* zoom: Call weston_output_activate_zoom() appropriatelyDerek Foreman2015-07-291-1/+4
| | | | | | | | | | No longer call weston_output_update_zoom() when trying to zoom out on an unzoomed output. Add an assert() to make sure update_zoom is never called without an active zoom. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Put monitor to sleep when idle timer expiresDerek Foreman2015-07-231-0/+2
| | | | | | | | | Removing the screensaver had the accidental side effect of disabling DPMS display shut down. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* exposay: Fix use after free when a view is destroyed during animationDerek Foreman2015-07-171-3/+9
| | | | | | | Moving the destroy listener setup allows the animation completion handler to be called before we free any structures it needs. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* exposay: Fix logic inversion when ending keyboard grabsDerek Foreman2015-07-171-1/+1
| | | | | | | I flipped a ! in cee82d62865ab5b239935f102c2e1f7868e0fa65 and the exposay keyboard grab became permanent. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: use work area instead of panel size to constrain movesDerek Foreman2015-07-171-9/+12
| | | | | | | | | | | This fixes the case where an output isn't at y = 0, where the panel height isn't correct for constraints. It also kills a bug - moving a window with a mod-drag off the top of the screen clamped earlier than it should. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* desktop-shell: use output position in get_output_panel_size()Derek Foreman2015-07-171-5/+4
| | | | | | | | The panel size calculation needs to take the output position into account or it's only correct when the output is at 0, 0. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* desktop-shell: add output co-ordinates to get_output_work_area()Derek Foreman2015-07-171-13/+9
| | | | | | | | | | | get_output_work_area() now returns the absolute work area including the output's offset. This will make math a little simpler later when we use it to constrain window moves. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* shell: Switch middle and right mouse bindingsDerek Foreman2015-07-161-2/+2
| | | | | | | | | | Currently rotate is on the right mouse button and resize is on the middle. As fantastic as rotating windows is, it's probably nicer to have resize on the right button, especially for anyone with only 2 buttons. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* desktop-shell: Use the grabbed pointer in popup_grab_buttonDerek Foreman2015-07-161-1/+1
| | | | | | | | | | | This should be identical to the pointer in shset->seat. A later patch prevents direct access to seat->pointer, using the known valid pointer in the grab will be nicer than using the getter functions that patch introduces. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Make surface_resize take a pointer instead of a seatDerek Foreman2015-07-161-5/+13
| | | | | | | | | It doesn't actually need the seat and we have to validate that the seat has a pointer before making the call, so it's safer just to pass the validated pointer. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Make surface_rotate take a pointer instead of a seatDerek Foreman2015-07-161-7/+7
| | | | | | | | | It doesn't actually need the seat and we have to validate that the seat has a pointer before making the call, so it's safer just to pass the validated pointer. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: Make surface_move take a pointer instead of a seatDerek Foreman2015-07-161-9/+10
| | | | | | | | | It doesn't actually need the seat and we have to validate that the seat has a pointer before making the call, so it's safer just to pass the validated pointer. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>