Commit Graph

217 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
6feb0f9f55 desktop-shell: use work area instead of panel size to constrain moves
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>
2015-07-17 17:46:58 -07:00
Derek Foreman
612341f1a6 desktop-shell: use output position in get_output_panel_size()
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>
2015-07-17 17:46:54 -07:00
Derek Foreman
f814c5dc9d desktop-shell: add output co-ordinates to get_output_work_area()
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>
2015-07-17 17:46:49 -07:00
Derek Foreman
2217f3f738 shell: Switch middle and right mouse bindings
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>
2015-07-16 19:35:19 -07:00
Derek Foreman
f7b2f8b0a6 desktop-shell: Use the grabbed pointer in popup_grab_button
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>
2015-07-16 19:04:19 -07:00
Derek Foreman
8fbebbd985 desktop-shell: Make surface_resize take a pointer instead of a seat
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>
2015-07-16 19:04:17 -07:00
Derek Foreman
74de4693b7 desktop-shell: Make surface_rotate take a pointer instead of a seat
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>
2015-07-16 19:04:07 -07:00
Derek Foreman
794fa0e031 desktop-shell: Make surface_move take a pointer instead of a seat
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>
2015-07-16 19:04:04 -07:00
Derek Foreman
b7674ae4dc desktop-shell: Make surface_touch_move take a touch instead of a seat
It never actually needs the seat, and we always verify the touch pointer
before calling it, so let's just pass a touch pointer instead of having
an assumption that the seat's touch pointer has been verified.

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-16 19:03:56 -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
Derek Foreman
cf7d95a688 desktop-shell: make client_initiated a bool
Make it a bool in both surface_move() and struct weston_move_grab

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-07-10 17:11:33 -07:00
Mario Kleiner
492c12fb8b desktop-shell: Allow fullscreen windows to mode-switch their output.
Fix desktop-shell's activate() method to only restore the output
mode on the single output on which a shell surface gets activated.

This way toplevel fullscreen surfaces can mode-switch their output
via method WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER and that
temporary mode properly persists until the surface loses its
fullscreen status, but effects like window switching and exposay
still work in the expected way.

v2: Split into a separate patch from original patch
    "Allow restore_output_mode() to work properly.",
    as suggested by Derek Foreman.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-02 15:14:30 +03: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
Pekka Paalanen
aa9536a992 text_backend: make destructor call explicit
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>
2015-06-26 09:33:54 +03:00
Pekka Paalanen
b37ac4006a desktop-shell: remove screensaver support
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>
2015-06-22 15:19:39 +03: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
Jon Cruz
d618f688d5 Moved the MIN() macro to the helper include.
Removed multiple definitions of the MIN() macro from existing
locations and unified with a single definition. Updated sources
to use the shared version.

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:52 -07:00
Jon Cruz
4678bab13c Remove redundant #include path component.
Using the parent '../' path component in #include statements makes
the codebase more rigid and is redundant due to proper -I use.

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:09 -07:00
Bryce Harrington
af637c25f2 *-shell: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
Murray Calavera
9a51cd7d10 move text_backend initialization into the shell plugin
Whether a input method is used should be the responsibility
of the shell because some shells may not want to implement
an input method at all

Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-11 12:20:46 +03:00
Pekka Paalanen
23ed5f2526 desktop-shell: do not black out with startup "none"
Do not use a black blanket surface when the startup animation is
specified to be "none". This is the final fix needed to make the
screenshot test deterministic and independent of weston-desktop-shell.

Previously, the black surface would cover all outputs until
weston-desktop-shell signalled ready. Then, depending on the set
animation, either the black surface was immediately removed (none) or a
fade-in started (fade).

Now, when there is no black surface at all for "none", the compositor
will show garbage until weston-desktop-shell gets everything up. This
may be undesireable but works for tests. To have the old "none"
behaviour back, I would propose to add a new startup-animation value
"black" for it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-05-26 15:43:02 +03:00
Derek Foreman
039e9be49d desktop-shell: destroy surfaces in an idle handler after fade out
It's possible for more than one animation to be taking place on a view at
the same time.  If one of those animations is the shell's fade out for
dying surfaces, its completion handler will trigger the surface destroy
signal, causing other animations on the animation list to remove themselves.

Since this removal occurs during the linked list walk, the compositor may
crash.

We move the actual surface destruction into an idle handler to avoid this.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-05-26 13:07:58 +03: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
Michael Vetter
2a18a52844 remove trailing whitespaces
Remove trailing whitespaces because they are not needed and jumping to
the end of al ine should do just that and not jump to the whitespace.
2015-05-15 13:12:32 -07:00
Ryo Munakata
79954ec9fe desktop-shell: set the current size in the first 'resizing' configure event
Weston has sent the first 'resizing' configure event with width=height=0.
But resizing to that size doesn't make sense.
Instead, we now send the current width and height of the surface at the beginning
of resizing.

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
2015-05-08 14:17:00 -07:00
Jonas Ådahl
ee45a55dea xdg-shell: Move xdg_shell.get_xdg_popup errors to xdg_shell
They are errors that may be as a result of calling get_xdg_popup on an
xdg_shell, not a result of calling a request on xdg_popup.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-05-05 14:17:11 +08:00
Jonas Ådahl
49d77d20ae xdg-shell: Require proper object tree destruction
Require all child objects to be destroyed before the parent. In other
words, all popups and surfaces created by one xdg_shell instance needs
to be destroyed before the xdg_shell object, otherwise a protocol error
is raised.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-05-05 14:17:01 +08:00
Derek Foreman
4c93c08679 touch: Make weston_touch_set_focus() take a touch instead of a seat
The other set_focus() functions take the relevant type instead of a seat
already, so this is consistent.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-05-01 12:42:52 +01:00
Dima Ryazanov
497f25de57 desktop-shell: Require a popup parent to be a shell surface
Currently, the shell crashes if the parent is not a shell surface. Instead,
send an error to the client.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-04-13 15:23:13 +03:00
Giulio Camuffo
a8e9b41578 xwm: tell the shell the pid of the X clients
All the surfaces from all the X clients share the same wl_client so
wl_client_get_credentials can't be used to get the pid of the X
clients.
The shell may need to know the pid to be able to associate a surface
with e.g. a DBus service.

[Pekka: fixed trivial merge conflicts.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-30 16:04:57 +03:00
Manuel Bachmann
dc1c3e49bb desktop-shell: remove dead unminimization code
The "set_minimized(surface, 0)" function call was never
used anywhere, and not really respecting naming
conventions.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-27 15:41:25 +02:00
Derek Foreman
70ac0edcab desktop-shell: don't allow negative values in drag resize
Now clamping width and height to a minimum of 1, 1 when drag resizing.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-18 10:34:18 -07:00
Ryo Munakata
76fb7ec272 shell,compositor-x11: Fix trivial memory leaks
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-09 09:26:46 +02:00
Pekka Paalanen
2829f7c42e compositor,shell: move debug key code to core
The code for the key binding that triggers debug key bindings, that is,
the code that makes mod+SHIFT+SPACE work, used to live in shell.c. I
want to make the debug key bindings available in ivi-shell too, so this
code should be shared. Move it to core.

The code was originally introduced in
commit c509d2b152
so update the copyright in binding.c to reflect that.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-03-02 16:56:01 +02:00
Jasper St. Pierre
5ba1e1d137 xdg-shell: Bump unstable version
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:59:43 +02:00
Jasper St. Pierre
084aa0b6f6 xdg-shell: Add a simple destructor request
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:59:23 +02:00
Jonas Ådahl
24185e2561 xdg-shell: Add invalid_parent error to xdg_popup
Send an invalid_parent error when the client tries to create a popup
with a paren that is neither a xdg_surface nor a xdg_popup.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:59:18 +02:00
Jasper St. Pierre
da6ecd0cc5 xdg-shell: Send an error when the client uses the not-topmost popup
Either in destroy or get_xdg_popup.

[jadahl: Verify that the new popup is the top most when mapping instead
of creating. Some renaming.]

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:59:11 +02:00
Jasper St. Pierre
14f330c619 xdg-shell: Remove the flags from get_xdg_popup
There haven't been any ideas for flags, so we don't need a useless,
unused parameter hanging around. Any future ideas should be done with a
new request entirely.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:59:05 +02:00
Jasper St. Pierre
ecf2a0f1ca xdg-shell: Remove the serial from popup_done
It doesn't serve any purpose, as it's a serial that the client gave to
the server when starting the popup, which the client already has.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:58:57 +02:00
Jasper St. Pierre
66bc949b72 xdg-shell: Take a xdg_surface as the parent surface
There is no other valid surface that we should be using here.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-27 14:58:35 +02:00
Jonas Ådahl
01193aeb12 desktop-shell: Fix coding style of add_popup_grab
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-23 15:41:57 +02:00
Jonas Ådahl
c2b101114f desktop-shell: Simplify popup_end_grab popup_done sending loop
Can just use wl_list_for_each_safe instead of dealing with pointers
ourself.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-02-23 15:37:22 +02:00
Jonas Ådahl
bf48e21fa1 desktop-shell: Fail if get_xdg_surface is called on an xdg_surface
If a client calls xdg_shell.get_xdg_surface on a surface that is already
an xdg_surface would, prior to this patch, succeed, but cause weston to
crash later when trying to configure. This patch instead sends a role
error to the client complaining that it already is an xdg_surface.

Note that .._set_role() only fails when changing roles, not when setting
the same role twice.

The same is done for xdg_popup.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-06 17:46:05 -08:00
Giulio Camuffo
6b4b24155f xwm: support maximizing xwayland windows
This patch adds the maximize button to the window frame for the windows
which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell
via a new method in weston_shell_interface.
Additionally, it also listens for the wm hints coming from the client,
but it doesn't support maximizing a window only vertically or horizontally.
The window will be maximized only when both directions are maximized.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-02 16:00:10 -08:00
Derek Foreman
8aeeac827f desktop-shell: Remove unnecessary type casts
Remove a few instances of casting weston_seat to weston_seat.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-02-02 15:00:18 -08:00
Derek Foreman
7ef3bed03c desktop-shell: Don't crash on zoom without a pointer in the seat
The zoom effect zooms at the seat's current pointer location.  When no
pointer is present the zoom key bindings cause a crash.

Instead, check for the absence of a pointer and log a warning.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-30 14:11:29 -08:00