Commit graph

18 commits

Author SHA1 Message Date
Derek Foreman d8156e22f6 exposay: Fix use after free when a view is destroyed during animation
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-17 19:02:28 -07:00
Derek Foreman daf846e4ea exposay: Fix logic inversion when ending keyboard grabs
I flipped a ! in cee82d6286
and the exposay keyboard grab became permanent.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-17 18:59:35 -07:00
Derek Foreman 8ae2db5b0c input: Pass the appropriate pointer type to bindings instead of a seat
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-16 19:03:43 -07:00
Derek Foreman cee82d6286 exposay: Test keyboard presence before using keyboard pointer
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-07-16 19:03:32 -07:00
Mario Kleiner 9f4d655494 desktop-shell: Allow multiple active fullscreen windows on multi-display setup.
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-30 12:12:53 -07:00
Jon Cruz 867d50eea7 Unified multiple definitions of container_of() macro.
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 17:11:58 -07:00
Bryce Harrington af637c25f2 *-shell: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
Derek Foreman 3dd570e754 exposay: Don't crash if no pointer is present
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>
2015-05-26 12:48:12 +03:00
Giulio Camuffo 412e6a59eb compositor: keep track of the weston_layer a weston_view is in
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-07-23 12:34:33 -07:00
Emilio Pozuelo Monfort 5905ebcc33 exposay: fix crash when navigating with the keyboard
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-06-18 17:14:40 -07:00
Emilio Pozuelo Monfort 9e7c7598aa desktop-shell: Properly handle lowered fullscreen surfaces
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-04-29 16:33:56 -07:00
Emilio Pozuelo Monfort a75920190e exposay: avoid needlessly activating the active view
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18 14:07:08 -08:00
Emilio Pozuelo Monfort f942b73a1c exposay: don't crash if a view goes away
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-18 14:04:39 -08:00
Emilio Pozuelo Monfort 3b6e68e2c1 exposay: arrange views per-output
https://bugs.freedesktop.org/show_bug.cgi?id=73173
2014-02-18 14:04:24 -08:00
U. Artie Eoff 6d6d190b30 exposay: remove redundant NULL check in highlight_surface
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-19 22:04:27 -08:00
Emilio Pozuelo Monfort 1a26f1baba exposay: set an alpha on fullscreen surfaces
This makes the desktop background actually draw when there is
a fullscreen surface and we go to exposay.
2014-01-07 21:46:36 -08:00
Emilio Pozuelo Monfort e6bbe5a90d exposay: fix infinite loop with fullscreen surfaces
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
2014-01-07 21:41:18 -08:00
Kristian Høgsberg 1ef231377c desktop-shell: Split out exposay immplementation 2013-12-04 10:20:02 -08:00