platform/upstream/weston.git
10 years agoAdd releasing.txt to describe the release steps and other bits of process
Kristian Høgsberg [Fri, 23 May 2014 17:13:59 +0000 (10:13 -0700)]
Add releasing.txt to describe the release steps and other bits of process

10 years agoxdg-shell: Add show_window_menu request
Jasper St. Pierre [Thu, 13 Mar 2014 15:04:53 +0000 (11:04 -0400)]
xdg-shell: Add show_window_menu request

10 years agoclients: Allow creating a "detached" menu
Jasper St. Pierre [Thu, 13 Mar 2014 15:57:31 +0000 (11:57 -0400)]
clients: Allow creating a "detached" menu

This will be used by the xdg_surface.show_menu_window implementation.

10 years agoconfigure.ac: Bump master version to 1.5.90
Kristian Høgsberg [Fri, 23 May 2014 16:25:11 +0000 (09:25 -0700)]
configure.ac: Bump master version to 1.5.90

Post release bump.  The master branch version is always x.y.90,
where x.y is the most recent stable branch.  This lets other packages
rely on git master as opposed to 1.5.0.

10 years agocomp-wayland: use safe foreach when destroying outputs
U. Artie Eoff [Wed, 21 May 2014 16:20:02 +0000 (09:20 -0700)]
comp-wayland: use safe foreach when destroying outputs

wl_list_for_each dereference's output to increment the
next iteration of the loop.  However, output is free'd
inside the loop resulting in a dereference to free'd
memory.

Use wl_list_for_each_safe instead, which is designed to
handle this kind of pattern.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agoconfigure.ac: Bump version to 1.5.0
Kristian Høgsberg [Mon, 19 May 2014 23:22:28 +0000 (16:22 -0700)]
configure.ac: Bump version to 1.5.0

10 years agoclients: Remove the window / user parameters from the menu function
Jasper St. Pierre [Thu, 13 Mar 2014 16:06:00 +0000 (12:06 -0400)]
clients: Remove the window / user parameters from the menu function

We want the ability to create a detached menu.

10 years agowindow: Send ack_configure immediately from configure handler
Kristian Høgsberg [Tue, 13 May 2014 06:30:28 +0000 (23:30 -0700)]
window: Send ack_configure immediately from configure handler

Once we've updated the window state and scheduled a resize, we know that
the next frame we send to the compositor will match the configured state.
This means we can just ack the configure immediately and not jump
through hoops to try to do it from the redraw stage.

10 years agowindow: Move the resize after interpreting the states
Jasper St. Pierre [Tue, 6 May 2014 12:33:27 +0000 (08:33 -0400)]
window: Move the resize after interpreting the states

As the protocol says, the states determine how the width and height
arguments should be interpreted, so it makes logical sense to do the
interpretation after.

10 years agowindow: Set frame flags immediately when we handle the new states in configure
Jasper St. Pierre [Tue, 6 May 2014 12:20:22 +0000 (08:20 -0400)]
window: Set frame flags immediately when we handle the new states in configure

10 years agoshell: Make margin double-buffered state that's applied on commit
Jasper St. Pierre [Fri, 2 May 2014 14:14:07 +0000 (10:14 -0400)]
shell: Make margin double-buffered state that's applied on commit

10 years agoshell: Don't use the helper methods in xdg_shell implementations
Jasper St. Pierre [Fri, 11 Apr 2014 23:18:54 +0000 (16:18 -0700)]
shell: Don't use the helper methods in xdg_shell implementations

With most of the code in send_configure_for_surface, the helper
methods don't give us that much benefit, so stop using them. We
can't kill them off, as they're part of the shell interface and
used by the WM.

10 years agoshell: Centralize management of sending configure requests
Jasper St. Pierre [Fri, 11 Apr 2014 23:00:31 +0000 (16:00 -0700)]
shell: Centralize management of sending configure requests

Currently, there's a giant bug in how xdg-shell state management
is done. If a client calls set_fullscreen and then set_maximized,
it will get two configure events:

  => set_fullscreen
  <= configure(800, 600, [STATE_FULLSCREEN])

  => set_maximized
  <= configure(800, 560, [STATE_FULLSCREEN, STATE_MAXIMIZED])

Since fullscreen takes precedence over maximized, the client will
render full-screen at 800x600 first, and then 800x560 next. As
a result, the surface gets the wrong size.

This is because the code that sends out configure requests is
"immediate" -- when an app calls set_maximized, we immediately
send out the configure event that would have happened if we
transitioned immediately into maximized mode.

In wl_shell, this is correct behavior. However, in xdg-shell,
this is wrong. State needs to be more carefully managed in
xdg-shell, as states aren't exclusive.

Pull all the code that sends out configure events out and send
them centrally, based on Weston's on surface state management.
This should work with both wl_shell and xdg_shell's strategies.

10 years agoxdg-shell: Turn "activated" into a state
Jasper St. Pierre [Tue, 6 May 2014 12:44:29 +0000 (08:44 -0400)]
xdg-shell: Turn "activated" into a state

This drops two events, and makes new window decorations race-free with
an attach in-flight.

10 years agoterminal: Only add the new size to the title when we're resizing
Jasper St. Pierre [Fri, 11 Apr 2014 00:23:49 +0000 (17:23 -0700)]
terminal: Only add the new size to the title when we're resizing

Add a new state_changed_handler callback to the window to know when the
window has changed state; the terminal will use this to know when the
window started and ended its resize operation, and modify the terminal's
titlebar accordingly.

10 years agoxdg-shell: Turn the resizing heuristics into an explicit state
Jasper St. Pierre [Tue, 6 May 2014 12:50:47 +0000 (08:50 -0400)]
xdg-shell: Turn the resizing heuristics into an explicit state

Currently, there's a race condition. When resizing from the left, and
a client attaches a buffer after the resize ends, you suddenly see the
buffer jump to the right, because the resize ended while multiple
attaches were in-flight. Making resize a state can fix this, as the
server can now know exactly when the resize ended, and whether a commit
was before or after that place.

We don't implement the correct tracking in this commit; that's left as
an exercise to the reader.

Additionally, clients like terminals might want to display resize popups
to display the number of cells when in a resize. They can use the hint
here to figure out whether they are resizing.

10 years agoxdg-shell: Rework the state system
Jasper St. Pierre [Thu, 10 Apr 2014 17:41:46 +0000 (10:41 -0700)]
xdg-shell: Rework the state system

The states system, so far, has been a complicated mix of weird APIs
that solved a real race condition, but have been particularly ugly
for both compositors and clients to implement.

10 years agoxdg-shell: Rename set_transient_for to set_parent
Jasper St. Pierre [Fri, 11 Apr 2014 01:37:54 +0000 (18:37 -0700)]
xdg-shell: Rename set_transient_for to set_parent

It's a confusing name that comes from the ICCCM. The ICCCM is best
forgotten about.

With the addition of the potential new "transient" role meaning a
parent-relative toplevel like a long-lived popup, used for e.g.
tooltips, the set_transient_for name will become even more confusing.

10 years agofullscreen: Remove dirty sizing trick
Jasper St. Pierre [Mon, 12 May 2014 15:24:50 +0000 (11:24 -0400)]
fullscreen: Remove dirty sizing trick

xdg-shell mandates that the FULLSCREEN state means that we must match
the size that we were configured to, at least by default. Other states
or protocol extensions might relax this requirement, but at least for
now implement the behavior specified in the protocol documentation.

10 years agofullscreen: Remove our own focused state tracking
Jasper St. Pierre [Mon, 12 May 2014 15:23:44 +0000 (11:23 -0400)]
fullscreen: Remove our own focused state tracking

This is decided by xdg-shell now.

10 years agoconfigure.ac: Bump version 1.4.93 1.4.93
Kristian Høgsberg [Mon, 12 May 2014 19:51:52 +0000 (12:51 -0700)]
configure.ac: Bump version 1.4.93

This is the last RC before 1.5.

10 years agowindow: Ignore input events from subsurfaces
Ander Conselvan de Oliveira [Tue, 6 May 2014 12:25:40 +0000 (15:25 +0300)]
window: Ignore input events from subsurfaces

Toytoolkit was not designed to handle input from subsurfaces and
instead it expects subsurfaces to have an empty input region. That way
input events for subsurfaces are generated on the main surface and
there is no need to convert coordinates before reporting the event to
the user.

However it is possible that a subsurface has a non-empty input region,
but in that case those events aren't properly processed. The function
window_find_widget() assumes the coordinates are in the main surface
coordinate space, and ends up chosing the wrong widget.

This patch changes the input code to completely ignore input events from
subsurfaces. This option was chosen instead of ensuring that the input
region on those surfaces is always empty since there's no enforcement
that a subsurface should completely overlap with the main surface. If
an event happens in the area of the surface that doesn't overlap, the
event could cause a completely unrelated surface to be picked.

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

10 years agobuild: let 'make clean' remove logs/ again
Pekka Paalanen [Mon, 12 May 2014 07:08:57 +0000 (10:08 +0300)]
build: let 'make clean' remove logs/ again

Before in the recursive automake setting, we had tests/logs/ for
explicitly created test log files. There is a Makefile rule to
remove the logs directory on 'make clean'. The rule broke on moving to
non-recursive make, since now we have logs/, not tests/logs/.

Fix the rule to remove the intended directory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agogitignore log files, now in root directory
Bryce W. Harrington [Mon, 12 May 2014 07:08:56 +0000 (10:08 +0300)]
gitignore log files, now in root directory

[paalanen: added also *.trs to ignore]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agodesktop-shell: Fix order of desktop_shell messages
Jonas Ådahl [Sat, 10 May 2014 08:43:34 +0000 (10:43 +0200)]
desktop-shell: Fix order of desktop_shell messages

There was a bug in wayland-scanner that failed to detect when an
message with implicitly set version (i.e. version 1) came after a
message with a newer version. This patch fixes the weston desktop shell
protocol to pass again.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
10 years agodesktop-shell: Damage the black view when we remove it
Kristian Høgsberg [Fri, 9 May 2014 23:24:07 +0000 (16:24 -0700)]
desktop-shell: Damage the black view when we remove it

We should be using weston_view_unmap() here, or maybe just destroying the
black view, but let's do a minimal, safe fix for the 1.5 release.

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

10 years agoconfigure.ac: Fix indent for screen-share option
Kristian Høgsberg [Fri, 9 May 2014 22:32:02 +0000 (15:32 -0700)]
configure.ac: Fix indent for screen-share option

10 years agoeditor: Fix cursor positioning with pointer and touch
Ander Conselvan de Oliveira [Thu, 8 May 2014 11:55:50 +0000 (14:55 +0300)]
editor: Fix cursor positioning with pointer and touch

The calculation off the vertical offset between the widget coordinates
and where the text was rendered was wrong. It was using the constant for
horizontal offset for that too.

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

10 years agotests: rename xwayland test
Pekka Paalanen [Wed, 7 May 2014 13:26:29 +0000 (16:26 +0300)]
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>
10 years agotests: load the right shell plugin
Pekka Paalanen [Wed, 7 May 2014 13:26:28 +0000 (16:26 +0300)]
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>
10 years agotests: load the right xwayland plugin
Pekka Paalanen [Wed, 7 May 2014 13:26:27 +0000 (16:26 +0300)]
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>
10 years agotests: use --no-config
Pekka Paalanen [Wed, 7 May 2014 13:26:26 +0000 (16:26 +0300)]
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>
10 years agocompositor: add --no-config command line option
Pekka Paalanen [Wed, 7 May 2014 13:26:25 +0000 (16:26 +0300)]
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>
10 years agolibinput-seat: literal values for WESTON_LIBINPUT_LOG_PRIORITY
U. Artie Eoff [Fri, 9 May 2014 18:24:40 +0000 (11:24 -0700)]
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>
10 years agovaapi-recorder: Don't loop trying to write on out of space condition
Ander Conselvan de Oliveira [Fri, 9 May 2014 12:57:38 +0000 (15:57 +0300)]
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

10 years agorpi: build fix for compute_rects debug
Pekka Paalanen [Fri, 9 May 2014 12:08:06 +0000 (15:08 +0300)]
rpi: build fix for compute_rects debug

See 918f2dd4cfb8b177f67b45653efbbe4325cbe9dc

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
10 years agodesktop-shell: Fix black edges on scaled desktop pattern
Bill Spitzak [Fri, 9 May 2014 03:00:35 +0000 (20:00 -0700)]
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

10 years agoshell: Don't allow maximized surfaces to be moved with touch
Ander Conselvan de Oliveira [Wed, 7 May 2014 11:22:23 +0000 (14:22 +0300)]
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

10 years agoshell: Fix crash when restoring focus state during workspace change
Ander Conselvan de Oliveira [Wed, 7 May 2014 08:57:28 +0000 (11:57 +0300)]
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

10 years agosimple-touch: Handle multiple seats properly
Ander Conselvan de Oliveira [Wed, 7 May 2014 08:57:27 +0000 (11:57 +0300)]
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

10 years agoshell: Fix artifacts caused by workspace change animation
Ander Conselvan de Oliveira [Wed, 7 May 2014 08:57:26 +0000 (11:57 +0300)]
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

10 years agoclients: Initialize label in keyboard handling code
Bryce W. Harrington [Wed, 7 May 2014 01:11:07 +0000 (01:11 +0000)]
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>
10 years agocompositor-wayland: avoid possible NULL deref in handle_keymap
U. Artie Eoff [Tue, 6 May 2014 21:50:03 +0000 (14:50 -0700)]
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>
10 years agocompositor-wayland: assign the correct mode
U. Artie Eoff [Tue, 6 May 2014 21:50:02 +0000 (14:50 -0700)]
compositor-wayland: assign the correct mode

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
10 years agocompositor-wayland: free output before returning
U. Artie Eoff [Tue, 6 May 2014 21:50:01 +0000 (14:50 -0700)]
compositor-wayland: free output before returning

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
10 years agoApply the zoom transformation before the output transformation
Neil Roberts [Tue, 6 May 2014 18:04:15 +0000 (19:04 +0100)]
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

10 years agocompositor-drm: Don't use vaapi recorder with unsupported formats
Ander Conselvan de Oliveira [Tue, 6 May 2014 13:49:06 +0000 (16:49 +0300)]
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

10 years agowcap: Check for mmap and malloc return value in wcap decode module
vivek [Tue, 6 May 2014 10:24:49 +0000 (15:54 +0530)]
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>
10 years agoxwayland: Fix fullscreen mode
Kristian Høgsberg [Sun, 4 May 2014 20:47:06 +0000 (13:47 -0700)]
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

10 years agoconfigure.ac: Bump version to 1.4.92 1.4.92
Kristian Høgsberg [Thu, 1 May 2014 20:49:10 +0000 (13:49 -0700)]
configure.ac: Bump version to 1.4.92

10 years agodrm: Don't use the cursor overlay if the scale doesn't match
Neil Roberts [Thu, 1 May 2014 17:00:41 +0000 (18:00 +0100)]
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.

10 years agoTake into account the zoom when applying the output transform
Neil Roberts [Thu, 1 May 2014 15:13:55 +0000 (16:13 +0100)]
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

10 years agowindow: Add a simple getenv to force SHM rendering
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:32 +0000 (11:19 -0400)]
window: Add a simple getenv to force SHM rendering

10 years agowindow: Clean up buffer type choosing
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:31 +0000 (11:19 -0400)]
window: Clean up buffer type choosing

Extracting it to a function makes this cleaner and more
understandable.

10 years agocairo-util: Don't show a resize cursor on edges when we're maximized
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:30 +0000 (11:19 -0400)]
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.

10 years agocairo-util: Kill a duplicate test
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:29 +0000 (11:19 -0400)]
cairo-util: Kill a duplicate test

If !(x < margin), then clearly margin <= x. No need to test for it again.

10 years agocompositor: Remove the edges parameter from send_configure
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:28 +0000 (11:19 -0400)]
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.

10 years agocompositor: Fix the documentation for surface->configure
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:27 +0000 (11:19 -0400)]
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.

10 years agodesktop-shell: Remove output_move listener on shutdown
Kristian Høgsberg [Thu, 1 May 2014 03:46:25 +0000 (20:46 -0700)]
desktop-shell: Remove output_move listener on shutdown

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

10 years agoscreen-share: Don't unset server environment variables
Andrew Wedgbury [Wed, 30 Apr 2014 08:51:19 +0000 (09:51 +0100)]
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>
10 years agoxwayland: Handle race between multi-pointer motion and clicks
Kristian Høgsberg [Wed, 30 Apr 2014 23:52:30 +0000 (16:52 -0700)]
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.

10 years agoxwayland: Set decoration margin for xwayland windows
Kristian Høgsberg [Wed, 30 Apr 2014 23:28:41 +0000 (16:28 -0700)]
xwayland: Set decoration margin for xwayland windows

10 years agoxwayland: Be smarter about picking seats for move/resize
Kristian Høgsberg [Wed, 30 Apr 2014 23:10:14 +0000 (16:10 -0700)]
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

10 years agodesktop-shell: Further consolidate move/resize grab checks
Kristian Høgsberg [Wed, 30 Apr 2014 23:05:49 +0000 (16:05 -0700)]
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.

10 years agoxwayland: Make resizing work again
Kristian Høgsberg [Wed, 30 Apr 2014 20:45:49 +0000 (13:45 -0700)]
xwayland: Make resizing work again

9c376b54ea6f60ae10d93653132e22ef66a536d7 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.

10 years agoshell.c: Set dirty for visible views on destroyed output
Xiong Zhang [Fri, 7 Mar 2014 08:27:19 +0000 (16:27 +0800)]
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>
10 years agolauncher-util: Initialize kb_mode also when weston-launch sets up tty
Kristian Høgsberg [Wed, 30 Apr 2014 17:40:39 +0000 (10:40 -0700)]
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

10 years agoshell: Don't map surfaces of type SHELL_SURFACE_NONE
Ander Conselvan de Oliveira [Wed, 30 Apr 2014 11:15:14 +0000 (14:15 +0300)]
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

10 years agodesktop-shell: Properly handle seat hotplugging
Jason Ekstrand [Tue, 22 Apr 2014 00:42:58 +0000 (19:42 -0500)]
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

10 years agodesktop-shell: Remove unused variables
Kristian Høgsberg [Tue, 29 Apr 2014 23:38:23 +0000 (16:38 -0700)]
desktop-shell: Remove unused variables

10 years agodesktop-shell: Properly handle lowered fullscreen surfaces
Emilio Pozuelo Monfort [Thu, 30 Jan 2014 13:01:10 +0000 (14:01 +0100)]
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

10 years agodesktop-shell: Keep windows on screen when moving
Kristian Høgsberg [Tue, 29 Apr 2014 23:03:54 +0000 (16:03 -0700)]
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

10 years agodesktop-shell: Raise new windows over fullscreen apps
Kristian Høgsberg [Tue, 29 Apr 2014 22:15:45 +0000 (15:15 -0700)]
desktop-shell: Raise new windows over fullscreen apps

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

10 years agodesktop-shell: End popup when starting a touch shell grab
Kristian Høgsberg [Tue, 29 Apr 2014 22:01:16 +0000 (15:01 -0700)]
desktop-shell: End popup when starting a touch shell grab

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

10 years agodesktop-shell: Reject resize if we're already grabbed
Kristian Høgsberg [Tue, 29 Apr 2014 21:50:25 +0000 (14:50 -0700)]
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.

10 years agodesktop-shell: Reject window move in common_surface_move()
Kristian Høgsberg [Tue, 29 Apr 2014 21:47:46 +0000 (14:47 -0700)]
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()

10 years agowindow.c: Dismiss menu on touch up events
Kristian Høgsberg [Tue, 29 Apr 2014 21:47:19 +0000 (14:47 -0700)]
window.c: Dismiss menu on touch up events

10 years agowindow.c: Also grab touch events when grabbing input
Kristian Høgsberg [Tue, 29 Apr 2014 21:30:44 +0000 (14:30 -0700)]
window.c: Also grab touch events when grabbing input

10 years agowindow.c: Prevent key event delivery while a grab is active
Kristian Høgsberg [Tue, 29 Apr 2014 21:19:20 +0000 (14:19 -0700)]
window.c: Prevent key event delivery while a grab is active

Ideally, we'll update the key event handling to deliver events to widgets,
but in the meantime, just blocking key event delivery while a grab is
active goes a long way.

10 years agowindow.c: Update pointer focus when taking a grab
Kristian Høgsberg [Tue, 29 Apr 2014 21:11:26 +0000 (14:11 -0700)]
window.c: Update pointer focus when taking a grab

10 years agoshell: Fix crash when a client is destroyed during the resize grab
Ander Conselvan de Oliveira [Tue, 29 Apr 2014 14:54:03 +0000 (17:54 +0300)]
shell: Fix crash when a client is destroyed during the resize grab

If a client exists during a resize grab, the resource for the shell
surface being resized is destroyed. The shell surface is not destroyed
immediately, however, because of the window close animation. In that
case, the compositor would crash trying to send configure events to
the surface being resized, since it would pass a NULL pointer to
wl_resource_post_event().

The code for the resize grab was already able to handle the surface
going away, so expand it to also handle the resource going away and
fix the crash.

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

10 years agoshell: Fix memory leaks caused by the window close animation
Ander Conselvan de Oliveira [Tue, 29 Apr 2014 14:54:02 +0000 (17:54 +0300)]
shell: Fix memory leaks caused by the window close animation

In order to do the window close animation, a reference for a destroyed
surface is kept. However, the reference count was also increased for
unmapped surfaces, in which case the animation wouldn't run. Since the
reference count was decremented in the animation done function, it would
never be decreased for unmapped surfaces, causing them to not be
released.

The close animation also changed how shell surfaces are released. The
destroy function for its resource was changed to not deallocate the
surface, and instead keep it around until the animation finishes and
the weston surface is destroyed. The destruction should happen in the
destroy listener for the weston surface, but it wouldn't destroy the
shell surface in the case the resource was still valid, assuming that
it would be freed in the resource destroy function.

10 years agoterminal: Convert all *alloc's to x*alloc's.
Bryce W. Harrington [Mon, 28 Apr 2014 18:44:08 +0000 (18:44 +0000)]
terminal: Convert all *alloc's to x*alloc's.

This ensures the allocation results are checked for NULL (out of
memory), and terminates the program in such a case.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agoSimply the matrix calculation for zooming
Neil Roberts [Fri, 25 Apr 2014 12:19:37 +0000 (13:19 +0100)]
Simply the matrix calculation for zooming

In order to apply the zoom transformation to the output matrix, Weston was
doing the following:

• Create a temporary matrix to hold the translation
• Invert the translation matrix using weston_matrix_invert into
  another temporary matrix
• Scale that matrix by the scale factor
• Multiply the current matrix with the temporary matrix

Using weston_matrix_invert to invert a translation matrix is over the top.
Instead we can just negate the values we pass to weston_matrix_translate.
Matrix multiplication is associative so creating a temporary matrix to hold the
scale and translation transform should be equivalent to just applying them
directly to the output matrix.

10 years agoclients/window: Don't remove the touch listener on a frame event
Neil Roberts [Wed, 23 Apr 2014 17:02:47 +0000 (18:02 +0100)]
clients/window: Don't remove the touch listener on a frame event

It looks like the handler for frame events from the wl_touch interface for
widgets may have been erroneously copied from the cancel handler so that it
removes all handlers as they are processed. I don't think this makes much sense
for the frame event. This was stopping the panel icons from being pushable with
touch events when using libinput since commit 1679f232e541489e. All that commit
does it make it start sending the frame events.

10 years agoinput: Fix errors due to initializing input before creating outputs
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:17 +0000 (15:11 +0300)]
input: Fix errors due to initializing input before creating outputs

Make sure that we don't map a device to an invalid output pointer and
intead remap devices when an output is created.

v2: fix the error with libinput too.

10 years agoevdev: Fix assertion error for unplugged output with paired touchscreen
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:16 +0000 (15:11 +0300)]
evdev: Fix assertion error for unplugged output with paired touchscreen

If the output a touchscreen is paired to is unplugged, events coming
from it should be ignored. Commit 17bccaed introduced logic for that
in evdev_flush_pending_damage(). However, the break statements it
introduced would cause the assertion after the switch statement to
fail.

That function has the odd behavior that goto's are used to skip the
assertion after the switch statement and jump to the hunk of code that
marks the event as processed. Only in the case where the event type has
an invalid value the assertion should trigger. So this patch fixes the
problem by moving the assertion into the default case of the switch
and replacing the goto statements with break ones.

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

10 years agoevdev: Discard events from a touchscreen paired with an unplugged output
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:15 +0000 (15:11 +0300)]
evdev: Discard events from a touchscreen paired with an unplugged output

Commit 17bccaed intended to make the events coming from a touchscreen
paired with an unplugged output to be discarded, while an unpaired one
would just choose a different output. However, the logic was inverted
causing the opposite to happen.

Later in commit 161c6c56, the default behavior was changed to map an
output to a default output if the one specified via udev is not
present. This change is reverted by this patch.

v2: undo the change from commit 161c6c56.

v3: deal with libinput too.

10 years agolibinput: Don't process touch events for devices without a valid output
Ander Conselvan de Oliveira [Thu, 24 Apr 2014 12:11:14 +0000 (15:11 +0300)]
libinput: Don't process touch events for devices without a valid output

That would be the case of a touch screen mapped to an output that was
unplugged.

10 years agopixman-renderer: Use width/height_from_buffer for buffer transforms
Jason Ekstrand [Tue, 22 Apr 2014 02:04:42 +0000 (21:04 -0500)]
pixman-renderer: Use width/height_from_buffer for buffer transforms

This fixes an issue in the pixman renderer where it would not render
surfaces correctly if both wl_viewport and wl_surface.set_buffer_transform
were used.

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoUse the correct width/height when transforming surfaces with viewports.
Jason Ekstrand [Tue, 22 Apr 2014 01:56:46 +0000 (20:56 -0500)]
Use the correct width/height when transforming surfaces with viewports.

Previously, because of the wrong width/height,
weston_surface_to_buffer_* would return the wrong values when
wl_viewport was used in combination with wl_surface.set_buffer_transform.

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agoxwayland: Check zalloc return for out of memory situation
Bryce W. Harrington [Mon, 21 Apr 2014 23:51:03 +0000 (23:51 +0000)]
xwayland: Check zalloc return for out of memory situation

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agoCheck zalloc return for out of memory situation
Bryce W. Harrington [Mon, 21 Apr 2014 23:51:02 +0000 (23:51 +0000)]
Check zalloc return for out of memory situation

Most zalloc calls in weston are checked, this fixes a handful that were
being ignored.  As found by `grep -EIsr "[^x]zalloc\(" . -A1`

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agodesktop-shell: Only use default background if no background color is set
Kristian Høgsberg [Tue, 22 Apr 2014 05:54:37 +0000 (22:54 -0700)]
desktop-shell: Only use default background if no background color is set

Previously we would only use the set background color if the
background-image value was explicitly set to empty or a non-existing
image.  With this change, we only load the default background image
if there's no configure background image or background color.  In case
of both an image and a color, the image takes precedence as before.

10 years agolibinput: Forward frame events to clients
Jonas Ådahl [Sat, 12 Apr 2014 07:39:51 +0000 (09:39 +0200)]
libinput: Forward frame events to clients

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

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
10 years agoCheck malloc result
Hardening [Fri, 11 Apr 2014 07:06:58 +0000 (09:06 +0200)]
Check malloc result

This patch checks malloc was successfull and release resources if it
wasn't.

10 years agogl-renderer: Remove gl_renderer_interface from gl-renderer.h
John Kåre Alsaker [Thu, 10 Apr 2014 18:05:17 +0000 (20:05 +0200)]
gl-renderer: Remove gl_renderer_interface from gl-renderer.h

The rationale here is, that this line would create an instance of
gl_renderer_interface in every compilation unit that included
gl-renderer.h. This is not necessary, and it can actually be harmful by
masking the real exported gl_renderer_interface symbol, if you added
another compilation unit to gl-renderer.so, causing a runtime failure in
loading it.

gl-renderer.c already creates the exported symbol.

10 years agoweston-info: fix log message typo
U. Artie Eoff [Fri, 18 Apr 2014 16:30:07 +0000 (09:30 -0700)]
weston-info: fix log message typo

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
10 years agoeditor: Remove unused variables
Kristian Høgsberg [Mon, 21 Apr 2014 22:33:51 +0000 (15:33 -0700)]
editor: Remove unused variables

10 years agoeditor: react on Enter, Tab, and Up-Down arrow keys
Manuel Bachmann [Fri, 18 Apr 2014 10:50:14 +0000 (12:50 +0200)]
editor: react on Enter, Tab, and Up-Down arrow keys

The editor will now insert new lines and tabulations when
pressing the corresponding keys on the virtual keyboard.

The Up and Down arrows can be used to navigate through
lines.

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

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>