summaryrefslogtreecommitdiff
path: root/desktop-shell/exposay.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-19Support axis source, axis discrete, frame and axis stop eventsPeter Hutterer1-0/+12
[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>
2016-01-19Add a weston_pointer_axis_eventPeter Hutterer1-1/+1
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>
2015-11-20input: Make pointer grab motion callbacks take an event structJonas Ådahl1-2/+2
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>
2015-11-02input: Pass axis events through pointer grab interfacesJonas Ådahl1-0/+7
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>
2015-08-06input: add a weston_pointer_clear_focus() helper functionDerek Foreman1-3/+1
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>
2015-07-31input: Don't test keyboard/pointer/touch pointersDerek Foreman1-15/+19
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>
2015-07-17exposay: Fix use after free when a view is destroyed during animationDerek Foreman1-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>
2015-07-17exposay: Fix logic inversion when ending keyboard grabsDerek Foreman1-1/+1
I flipped a ! in cee82d62865ab5b239935f102c2e1f7868e0fa65 and the exposay keyboard grab became permanent. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-16input: Pass the appropriate pointer type to bindings instead of a seatDerek Foreman1-2/+2
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>
2015-07-16exposay: Test keyboard presence before using keyboard pointerDerek Foreman1-3/+6
We shouldn't actually use the keyboard pointer unless we check that a keyboard is present. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-06-30desktop-shell: Allow multiple active fullscreen windows on multi-display setup.Mario Kleiner1-1/+1
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>
2015-06-15Unified multiple definitions of container_of() macro.Jon Cruz1-0/+1
Removed duplicate definitions of the container_of() macro and refactored sources to use the single implementation. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15*-shell: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington1-16/+17
2015-05-26exposay: Don't crash if no pointer is presentDerek Foreman1-6/+9
If the compositor has never seen a mouse, exposay will crash because the seat->pointer pointer is NULL. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2014-07-23compositor: keep track of the weston_layer a weston_view is inGiulio Camuffo1-2/+2
This introduces a new struct, weston_layer_entry, which is now used in place of wl_list to keep the link for the layer list in weston_view and the head of the list in weston_layer. weston_layer_entry also has a weston_layer*, which points to the layer the view is in or, in the case the entry it's the head of the list, to the layer itself.
2014-06-18exposay: fix crash when navigating with the keyboardEmilio Pozuelo Monfort1-1/+3
Commit a7592019 introduced an optimization that caused some exposay struct members to not be properly initialized, particularly cur_output, leading to crashes in some circumstances (e.g. pressing the down arrow key after going to exposay). Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-04-29desktop-shell: Properly handle lowered fullscreen surfacesEmilio Pozuelo Monfort1-5/+3
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
2014-02-18exposay: avoid needlessly activating the active viewEmilio Pozuelo Monfort1-0/+3
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18exposay: don't crash if a view goes awayEmilio Pozuelo Monfort1-2/+29
When a view was destroyed while we were on exposay, we didn't remove it from the list of views, and so when leaving exposay we were trying to animate (and sometimes activate) a non-existent view, causing a crash. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18exposay: arrange views per-outputEmilio Pozuelo Monfort1-45/+63
https://bugs.freedesktop.org/show_bug.cgi?id=73173
2014-01-19exposay: remove redundant NULL check in highlight_surfaceU. Artie Eoff1-6/+3
exposay_highlight_surface() is called from exposay_pick(), exposay_layout(), and exposay_maybe_move() where the esurface parameter is already validated prior to the call. This makes the 'esurface' NULL check redundant. This assumes any future calls to exposay_highlight_surface() will also validate the 'esurface' parameter prior to the call. This fixes the logic in exposay_highlight_surface so static analyzers don't complain about the possibility that 'view' might be NULL deref'd when a 'esurface' == NULL condition is true. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-07exposay: set an alpha on fullscreen surfacesEmilio Pozuelo Monfort1-0/+2
This makes the desktop background actually draw when there is a fullscreen surface and we go to exposay.
2014-01-07exposay: fix infinite loop with fullscreen surfacesEmilio Pozuelo Monfort1-2/+5
We were calling exposay_highlight_surface() inside a wl_list_for_each loop for a layer, but exposay_highlight_surface() calls activate() which calls shell_surface_update_layer(), which removes the surface from its layer and reinserts it, causing an infinite loop. Call exposay_highlight_surface() outside the for_each to avoid this. https://bugs.freedesktop.org/show_bug.cgi?id=72404
2013-12-04desktop-shell: Split out exposay immplementationKristian Høgsberg1-0/+604