Commit Graph

4228 Commits

Author SHA1 Message Date
Pekka Paalanen f9a2626cb1 tests: rename xwayland test
If the test is named xwayland.weston, then the automake test harness
keys it off xwayland.log. Making xwayland.log runs the test.
The test harness has implicit rules to create a %.log from all of
%$TEST_EXTENSIONS. So we have implicit rules to create %.log from %.la
and %.log from %.weston.

We also build xwayland.so, which produces xwayland.la.

When the test harness goes running the xwayland test, it ends up using
the %.la rule, which is wrong. It passes xwayland.la as the test name to
weston-tests-env, which then loads it as a plugin into Weston and waits
for Weston to exit. Which it never does.

Fix this by making the test have a different name than the Xwayland
plugin.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 15:00:36 -07:00
Pekka Paalanen c2b74fb849 tests: load the right shell plugin
Again, load the shell plugin with full path, rather than possibly find an
old version from a previous installation.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 15:00:32 -07:00
Pekka Paalanen 6ea0d176d6 tests: load the right xwayland plugin
If we do not specify the full path to xwayland.so, Weston can find an
old one installed in a $prefix and use that instead of the freshly built
one.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 15:00:14 -07:00
Pekka Paalanen 412e58a240 tests: use --no-config
Use --no-config to avoid loading arbitrary weston.ini files from unit
tests. It may affect the unit test results.

I actually hit the following case:

[13:34:04.636] Using config file '/home/pq/local/etc/weston.ini'
[13:34:04.636] Loading module '/home/pq/git/weston/.libs/headless-backend.so'
[13:34:04.637] launching '/home/pq/local/libexec/weston-keyboard'
[13:34:04.644] Loading module '/home/pq/local/lib/weston/desktop-shell.so'
[13:34:04.644] Loading module '/home/pq/local/lib/weston/xwayland.so'
[13:34:04.648] unlinking stale lock file /tmp/.X1-lock
[13:34:04.648] xserver listening on display :1
[13:34:04.648] Loading module '/home/pq/git/weston/.libs/./xwayland.so'
[13:34:04.648] xserver listening on display :2
[13:34:04.648] Module '/home/pq/local/lib/weston/xwayland.so' already loaded

Weston tries to load xwayland module three times, or which twice it
succeeds. This might not make the xwayland test end well. Or at all,
actually.

Adding --no-config should remove one of these loads of xwayland.so.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 15:00:06 -07:00
Pekka Paalanen 588bee10de compositor: add --no-config command line option
Useful for unit tests. If Weston finds a weston.ini during unit tests,
it will load it and all the modules it asks for. We need a way to
prevent loading arbitrary modules from the command line.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 15:00:01 -07:00
U. Artie Eoff 24713f679b libinput-seat: literal values for WESTON_LIBINPUT_LOG_PRIORITY
Only accept specific literal values from the environment variable
WESTON_LIBINPUT_LOG_PRIORITY... "debug", "info", or "error".

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-09 14:26:19 -07:00
Ander Conselvan de Oliveira 2d13fde9c7 vaapi-recorder: Don't loop trying to write on out of space condition
The error handling for the function that writes the encoded frame on
the disk was bogus, always assuming the buffer supplied to the encoder
was too small. That would cause a bigger buffer to be allocated and
another attempt to encode the frame was done. In the case of a failure
to write to disk (due to ENOSPC, for instance) that would cause an
endless loop.

Possibly-related-to: https://bugs.freedesktop.org/show_bug.cgi?id=69330
2014-05-09 14:12:38 -07:00
Pekka Paalanen 2d0f8b77eb rpi: build fix for compute_rects debug
See 918f2dd4cf

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-05-09 14:10:29 -07:00
Bill Spitzak 79b7cb3ee3 desktop-shell: Fix black edges on scaled desktop pattern
Filter sampling outside the source image can leak black into the edges
of the
desktop image. This is most easily seen by scaling the default tiled image
with this weston.ini:

	# no background-image and no background-color
	background-type=scale-crop
2014-05-09 14:03:05 -07:00
Ander Conselvan de Oliveira 6d43f045e3 shell: Don't allow maximized surfaces to be moved with touch
Moving a maximized surface with the pointer is already not possible,
so make the behavior with touch consistent.

https://bugs.freedesktop.org/show_bug.cgi?id=78208
2014-05-09 13:33:36 -07:00
Ander Conselvan de Oliveira 6e56ab41d9 shell: Fix crash when restoring focus state during workspace change
The check to avoid calling weston_keyboard_set_focus() for a seat that
didn't have a keyboard in restore_focus_state() was cheking the wrong
seat (the one from the previous loop). That caused a crash when
switching workspaces if there was an extra seat that didn't have a
keyboard.

https://bugs.freedesktop.org/show_bug.cgi?id=78349
2014-05-09 12:51:28 -07:00
Ander Conselvan de Oliveira c3f03f557b simple-touch: Handle multiple seats properly
If simple-touch ran on a compositor with multiple seats, and the first
one happened to have the touch capability while the second one didn't,
the handler for seat capabilities would destroy the wl_touch device it
created on the first call for the first seat when it was called a again
for the second seat that has not touch capabilities.

Fix this problem by creating a separate struct for each seat.

https://bugs.freedesktop.org/show_bug.cgi?id=78365
2014-05-09 12:50:11 -07:00
Ander Conselvan de Oliveira 9c6217e6dc shell: Fix artifacts caused by workspace change animation
Views that extend past the bottom of the output are still visible after
the workspace animation ends but before its layer is hidden. When the
layer was hidden, nothing would cause those regions to be repainted,
leading to artifacts.

https://bugs.freedesktop.org/show_bug.cgi?id=78363
2014-05-09 12:49:54 -07:00
Bryce W. Harrington 762b231e0b clients: Initialize label in keyboard handling code
Quells warning:
  clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’:
  clients/keyboard.c:556:11: warning: ‘label’ may be used uninitialized in
  this function [-Wuninitialized]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-09 12:33:20 -07:00
U. Artie Eoff d8d4701864 compositor-wayland: avoid possible NULL deref in handle_keymap
If data is NULL, then we jumped to error which attempts to
dereference data.  Instead, just close(fd) and return when
data is NULL.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 15:41:02 -07:00
U. Artie Eoff 67072d03d3 compositor-wayland: assign the correct mode
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 15:40:59 -07:00
U. Artie Eoff 8cbd8f3390 compositor-wayland: free output before returning
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 15:40:55 -07:00
Neil Roberts 6c3b01f81e Apply the zoom transformation before the output transformation
The zoom translation is just a scale and a translate. The translation
is calculated based on the coordinates of the pointer which are in
global space. Previously the calculated translation was transformed by
the output transformation so that when the zoom transform is applied
after the output transform then it will be correct. However if we just
apply the zoom transformation first then we get the same result
without the zoom code having to be aware of the output transformation.

This also fixes weston_output_transform_coordinate which was applying
the output and zoom transforms in the wrong order.

https://bugs.freedesktop.org/show_bug.cgi?id=78211
2014-05-06 15:36:55 -07:00
Ander Conselvan de Oliveira 2ef1cd177e compositor-drm: Don't use vaapi recorder with unsupported formats
We only support recording with GBM_FORMAT_XRGB888 format, so don't try
to record if the output has a differnt format.

https://bugs.freedesktop.org/show_bug.cgi?id=78199
2014-05-06 15:34:33 -07:00
vivek 6f0907b6d8 wcap: Check for mmap and malloc return value in wcap decode module
Checking for return value in main.c for wcap_decoder_create function
and mmap, malloc return value in wcap_decoder_create function to avoid
crashes

Signed-off-by: vivek <vivek.ellur@samsung.com>
2014-05-06 15:21:27 -07:00
Kristian Høgsberg 4779241516 xwayland: Fix fullscreen mode
With xdg_shell wl_shell starting to diverge in how they work, there's
less shared code in set_fullscreen().  The problem is that the xwayland
window manager calls into set_fulscreen() which now doesn't complete
the fullscreen transition.  Add shell_interface_set_fullscreen() for
the shell interface set_fullscreen hook to use.

https://bugs.freedesktop.org/show_bug.cgi?id=78230
2014-05-04 13:47:06 -07:00
Kristian Høgsberg d7d71e8d96 configure.ac: Bump version to 1.4.92 2014-05-01 13:49:10 -07:00
Neil Roberts f37f82ccf9 drm: Don't use the cursor overlay if the scale doesn't match
If the scale for the cursor surface doesn't match that of the output
then we shouldn't use the cursor overlay because otherwise it will be
drawn at the wrong size. This problem is particularly noticable with
multiple pointers because it randomly alternates between drawing one
cursor or the other at a larger size depending on which one gets put
in the cursor overlay.
2014-05-01 13:47:12 -07:00
Neil Roberts eb5a200807 Take into account the zoom when applying the output transform
When converting output-relative coordinates (such as from an input
event) to global coordinates it now takes into account the zoom
transform. Previously this would only work for the primary pointer
because the transform doesn't affect the primary pointer position due
to that way zoom follows the mouse. Touch events and multiple pointers
were not working correctly.

https://bugs.freedesktop.org/show_bug.cgi?id=68620
2014-05-01 09:07:51 -07:00
Jasper St. Pierre bf39e5e1ba window: Add a simple getenv to force SHM rendering 2014-04-30 21:04:34 -07:00
Jasper St. Pierre bd600774be window: Clean up buffer type choosing
Extracting it to a function makes this cleaner and more
understandable.
2014-04-30 21:04:22 -07:00
Jasper St. Pierre f11ad43ed0 cairo-util: Don't show a resize cursor on edges when we're maximized
This is substantially confusing to users, namely me.

krh: Edited to just set grip size to zero.
2014-04-30 21:02:37 -07:00
Jasper St. Pierre a4d9723341 cairo-util: Kill a duplicate test
If !(x < margin), then clearly margin <= x. No need to test for it again.
2014-04-30 20:54:01 -07:00
Jasper St. Pierre ac985be8ce compositor: Remove the edges parameter from send_configure
send_configure was originally modelled after
wl_shell_surface::send_configure, which takes these arguments. However,
the X WM and xdg_surface::configure variants don't use these arguments.

We already store the resize edges for a surface while it's being
resized, so just use the saved state in the wl_shell_surface variant.
2014-04-30 20:53:15 -07:00
Jasper St. Pierre d67b52a501 compositor: Fix the documentation for surface->configure
It's called on commit, not on attach. Additionally, correct the
interface name to be wl_surface, not surface.
2014-04-30 20:48:55 -07:00
Kristian Høgsberg 6d50b0f2a1 desktop-shell: Remove output_move listener on shutdown
https://bugs.freedesktop.org/show_bug.cgi?id=78138
2014-04-30 20:46:25 -07:00
Andrew Wedgbury bc51ad6afd screen-share: Don't unset server environment variables
There is no need to unset WAYLAND_DISPLAY and WAYLAND_SOCKET when screen-share
launches the fullscreen shell server. This was done originally in case the
launched server decided to use the wayland backend based on the presence of
these. However, we pass a command line argument telling it to use the RDP
backend, which overrides the automatic backend selection based on the
environment.

Keeping these environment variables allows the launched fullscreen shell server
to know the original server's display name, which it may need in order to show
a configuration UI.

Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-30 16:54:31 -07:00
Kristian Høgsberg 8c3c738718 xwayland: Handle race between multi-pointer motion and clicks
Make sure we're looking at the right location.  The frame could have
received a motion event from a pointer from a different wl_seat, but
under X it looks like our core pointer moved.  Move the frame pointer
to the button press location before deciding what to do.
2014-04-30 16:52:30 -07:00
Kristian Høgsberg e5c1ae9368 xwayland: Set decoration margin for xwayland windows 2014-04-30 16:28:41 -07:00
Kristian Høgsberg 052ef4e7bc xwayland: Be smarter about picking seats for move/resize
If we're going to move or resize an xwayland surface, we used to just
pick the first seat in the list for doing the move/resize.  Ideally we
can map from the XInput device doing the click to the corresponding
weston_seat, but that requires using xcb xinput, which isn't well supported.

Instead, lets use a simple heuristic that just picks the pointer that
most recently delivered a button event to the window in question.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73807
2014-04-30 16:10:16 -07:00
Kristian Høgsberg a4b620e7e7 desktop-shell: Further consolidate move/resize grab checks
This moves the check for shsurf->grabbed into surface_move() and
surface_resize(), which are shared with the xwayland code.  This prevents
trying to resize or move an xwayland window with multiple pointers.
2014-04-30 16:05:49 -07:00
Kristian Høgsberg e0b9d5be84 xwayland: Make resizing work again
9c376b54ea fixed the crash when a client goes
away during a resize grab.  The shsurf->resource is set to NULL in that
case and we were trying to send out events to a NULL resource.  However,
xwayland shell surfaces are created by the xwayland module and don't have a
resource.  We use a different function pointer for sending the configure
events that handle the events inside xwayland instead of sending protocol
events.

To fix all this, we just move the check for a NULL resource into the
functions that we use for sending configure events for wl_shell and
xdg_shell.
2014-04-30 13:45:53 -07:00
Xiong Zhang 62899f5124 shell.c: Set dirty for visible views on destroyed output
The geometry for visible views will keep unchanged,
weston_view_set_position() doesn't mark these views
as dirty. So there is no chance for them to reassign output, then
these views will disappear.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72946

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2014-04-30 10:59:30 -07:00
Kristian Høgsberg 9a14b8f4fa launcher-util: Initialize kb_mode also when weston-launch sets up tty
We need a valid kb_mode to restore to in case weston-launch dies and
weston has to clean up the tty.  We don't get a chance to read out the
kb mode before weston-launch changes it, but it's safe to assume that it's
always K_UNICODE.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77455
2014-04-30 10:40:39 -07:00
Ander Conselvan de Oliveira ef6a7e46eb shell: Don't map surfaces of type SHELL_SURFACE_NONE
When commit 07926d90 factored out the code that chooses in which layer
a surface is added to, it changed the behavior for surfaces with no
type. Instead of not adding it to any layer, the surface is added to
the current workspace.

This patch restores the old behavior.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77527
2014-04-30 09:09:32 -07:00
Jason Ekstrand 024177cecb desktop-shell: Properly handle seat hotplugging
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
2014-04-29 16:49:59 -07:00
Kristian Høgsberg 3434b33b19 desktop-shell: Remove unused variables 2014-04-29 16:38:23 -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
Kristian Høgsberg ae356aef58 desktop-shell: Keep windows on screen when moving
We add a primitive constraining function to at least prevent users from
moving the window up under the panel.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73421
2014-04-29 16:03:58 -07:00
Kristian Høgsberg 6110d07777 desktop-shell: Raise new windows over fullscreen apps
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74219
2014-04-29 15:15:45 -07:00
Kristian Høgsberg 74071e056a desktop-shell: End popup when starting a touch shell grab
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77345
2014-04-29 15:01:16 -07:00
Kristian Høgsberg 7b83ae433f desktop-shell: Reject resize if we're already grabbed
This rejects resizing a window that's currently being moved.  This can
be done using a touch screen and a pointer or just two seats.
2014-04-29 14:50:25 -07:00
Kristian Høgsberg d0b40ed451 desktop-shell: Reject window move in common_surface_move()
We move the check for shsurf->grabbed from surface_move() and
surface_touch_move() up top common_surface_move()
2014-04-29 14:47:46 -07:00
Kristian Høgsberg 9c60933a13 window.c: Dismiss menu on touch up events 2014-04-29 14:47:19 -07:00
Kristian Høgsberg 1f67117f6f window.c: Also grab touch events when grabbing input 2014-04-29 14:30:44 -07:00