platform/upstream/weston.git
10 years agocompositor: keep track of the weston_layer a weston_view is in
Giulio Camuffo [Wed, 9 Jul 2014 19:12:56 +0000 (22:12 +0300)]
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.

10 years agotests: use expect_protocol_error in tests
Marek Chalupa [Wed, 16 Jul 2014 09:40:25 +0000 (11:40 +0200)]
tests: use expect_protocol_error in tests

Turn FAIL_TESTs to TESTs. FAIL_TESTs are bad...

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agotests: add frame_callback_wait_nofail
Marek Chalupa [Wed, 16 Jul 2014 09:32:50 +0000 (11:32 +0200)]
tests: add frame_callback_wait_nofail

With expect_protocol_error, we need a possibility to wait for a frame
without aborting the test when wl_display_dispatch returns -1;
This patch adds function frame_callback_wait_nofail that only
returns 1 or 0 (instead of aborting on error).

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agotests: add expect_protocol_error function
Marek Chalupa [Wed, 16 Jul 2014 09:27:06 +0000 (11:27 +0200)]
tests: add expect_protocol_error function

This function checks if a particular protocol error came in wire.
It's usefull in the cases where we hitherto used FAIL_TEST.
The problem with FAIL_TEST is that *any* assert will pass the test,
but we want only some asserts to pass the test (i. e. we don't
want the test to pass when it, for example, can't connect to display).
FAIL_TESTs are good only for sanity testing.

The expect_protocol_error allows us to turn all FAIL_TESTs to TESTs
as will be introduced in following patches.

v2: fixed white-space error and a mistake in comment

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agoxdg-shell: Fix documentation
Jasper St. Pierre [Thu, 17 Jul 2014 21:34:44 +0000 (17:34 -0400)]
xdg-shell: Fix documentation

request_change_state has been folded into the configure event.

10 years agoshell: Replace set_margin with set_window_geometry
Jasper St. Pierre [Fri, 2 May 2014 14:21:38 +0000 (10:21 -0400)]
shell: Replace set_margin with set_window_geometry

Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.

What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.

In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.

10 years agoInterpret the size in the configure event as window geometry
Jasper St. Pierre [Mon, 14 Jul 2014 20:28:48 +0000 (16:28 -0400)]
Interpret the size in the configure event as window geometry

The size of the configure event has always been specified as in window
geometry coordinates, but it was never implemented this way.

10 years agoCreate a weston_surface_state structure for storing pending surface state and move...
Jason Ekstrand [Tue, 20 May 2014 19:33:03 +0000 (14:33 -0500)]
Create a weston_surface_state structure for storing pending surface state and move the surface commit logic into weston_surface_commit_state

This new structure is used for both weston_surface.pending and
weston_subsurface.cached.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agoMove weston_frame_callback above weston_surface_create
Jason Ekstrand [Thu, 26 Jun 2014 17:04:49 +0000 (10:04 -0700)]
Move weston_frame_callback above weston_surface_create

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agoMove weston_subsurface to after weston_surface
Jason Ekstrand [Tue, 20 May 2014 16:23:53 +0000 (11:23 -0500)]
Move weston_subsurface to after weston_surface

It makes more sense there.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
10 years agocairo-util: Set geometry_dirty in frame_set_title
Boyan Ding [Fri, 4 Jul 2014 07:19:23 +0000 (15:19 +0800)]
cairo-util: Set geometry_dirty in frame_set_title

Title can decide the geometry of a frame because it may affect the
existence of titlebar, so setting geometry_dirty in frame_set_title for
potential change.

Signed-off-by: Boyan Ding <stu_dby@126.com>
10 years agocairo-util: Fix geometry for frames with buttons but without title
Boyan Ding [Fri, 4 Jul 2014 07:19:22 +0000 (15:19 +0800)]
cairo-util: Fix geometry for frames with buttons but without title

There exist frames which have buttons without title such as a simple
X application piped through xwayland which doesn't specify a title.
We draw the title bar with buttons, but hide it under the window
because geometry thinks a window needs titlebar only if it has title.

This patch change the condition, making it titlebar is needed if a
frame has title or has button(s), which makes more sense.

Signed-off-by: Boyan Ding <stu_dby@126.com>
10 years agoUse pixman_region32_clear instead of our own empty_region
Jason Ekstrand [Thu, 26 Jun 2014 17:37:36 +0000 (10:37 -0700)]
Use pixman_region32_clear instead of our own empty_region

This requires pixman 0.25.2

Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
10 years agoshell: fix segfault in fullscreen binding
Boyan Ding [Thu, 26 Jun 2014 02:19:32 +0000 (10:19 +0800)]
shell: fix segfault in fullscreen binding

Commit 9aa8ce69 forgot to set shsurf->fullscreen_output in
fullscreen_binding(), causing segfault when fullscreening using key
bindings. This patch fixes that.

https://bugs.freedesktop.org/show_bug.cgi?id=79828
Signed-off-by: Boyan Ding <stu_dby@126.com>
10 years agoscreen-share: Allow fullscreen shell command to be configured
Andrew Wedgbury [Fri, 2 May 2014 09:01:18 +0000 (10:01 +0100)]
screen-share: Allow fullscreen shell command to be configured

I've updated this based on comments, simplifying the command handling.

Currently the screen-share module uses a hard-coded command to start the
fullscreen shell server. This patch causes the module to read the command from
the weston config file (from the "command" key in the "screen-share" section).
The default value remains the same (i.e. to run weston with the RDP backend and
fullscreen shell), but is now located in the weston config file.

As well as allowing the arguments to the fullscreen shell server to be changed,
this also permits an alternative fullscreen shell server to be used if required,
without needing to recompile. Since the command is run as the user running
weston, this should not pose any additional security risk.

Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
10 years agodata-device: Clean up the logic in start_drag
Jason Ekstrand [Wed, 25 Jun 2014 04:19:24 +0000 (21:19 -0700)]
data-device: Clean up the logic in start_drag

Previoiusly, we had a mess of logic that was repeated with one of the
repeats negated.  Not only was this unnecisaraly confusing, but it
segfaulted and one of the negations was wrong.  This cleans the whole mess
up and should fix bug #79725.

10 years agoBetter error message when exec'ing Xwayland fails
Arnout Engelen [Fri, 20 Jun 2014 19:36:54 +0000 (21:36 +0200)]
Better error message when exec'ing Xwayland fails

10 years agoRequire libinput 0.4.0
Peter Hutterer [Wed, 25 Jun 2014 04:07:36 +0000 (14:07 +1000)]
Require libinput 0.4.0

No functional changes, just adjusting for API changes in libinput:
- libinput_destroy() replaced by libinput_unref()
- log functions now take a libinput context, userdata is gone
- udev seat creation is now libinput_udev_create_context() and
  libinput_udev_assign_seat()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoChange the defacto output transform from flipped-270 to flipped-90
Jason Ekstrand [Tue, 24 Jun 2014 18:10:28 +0000 (11:10 -0700)]
Change the defacto output transform from flipped-270 to flipped-90

It turns out that flipped-270 is the second-simplest transformation besides
normal because it is a direct swapping of the x and y axes.  Having that as
the default encourages people to use flipped-270 as the default test for "I
want to try this with a transform".  Unfortunately, because flipped-270 is
so simple, it is really easy to have something that works for normal,
flipped-270, and nothing else.  This encourages people to test with a
transform thats actually "hard".

10 years agoFix a comment
Jason Ekstrand [Tue, 24 Jun 2014 18:10:02 +0000 (11:10 -0700)]
Fix a comment

10 years agoClients: Fix memleak issues in various clients of weston
vivek [Thu, 15 May 2014 13:28:16 +0000 (18:58 +0530)]
Clients: Fix memleak issues in various clients of weston

In many clients of weston, Display was not being destroyed so added it.
Also destroy windows, widgets which were not being destroyed.

Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
10 years agoxdg-shell: Fix a typo in description
Boyan Ding [Mon, 23 Jun 2014 02:51:49 +0000 (10:51 +0800)]
xdg-shell: Fix a typo in description

Signed-off-by: Boyan Ding <stu_dby@126.com>
10 years agodesktop-shell: Don't assume there is a pointer when resizing
Emilio Pozuelo Monfort [Wed, 18 Jun 2014 15:48:58 +0000 (17:48 +0200)]
desktop-shell: Don't assume there is a pointer when resizing

Fixes a crash on touch devices without a pointer, when touching
the window frame of a client.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
10 years agoweston-build: Fix aclocal error during autogen.sh
Srivardhan Hebbar [Sat, 21 Jun 2014 09:46:25 +0000 (15:16 +0530)]
weston-build: Fix aclocal error during autogen.sh

This is a fix to the following bug:
https://bugs.freedesktop.org/show_bug.cgi?id=80214

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
10 years agocompositor: update the surface size when there is a size change without a buffer...
George Kiagiadakis [Fri, 13 Jun 2014 16:14:20 +0000 (18:14 +0200)]
compositor: update the surface size when there is a size change without a buffer attach

This fixes at least the case where you want to do wl_viewport.set_destination
to resize the surface but without attaching new content in it.

10 years agoweston: Fix memleak issue in compositor.c
Srivardhan Hebbar [Tue, 27 May 2014 09:00:59 +0000 (14:30 +0530)]
weston: Fix memleak issue in compositor.c

Based on a previous patch by Hardening <rdp.effort@gmail.com>.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
10 years agocompositor-wayland: Fix compiler warning
Thierry Reding [Tue, 27 May 2014 07:08:29 +0000 (09:08 +0200)]
compositor-wayland: Fix compiler warning

sizeof returns size_t, for which the correct printf specifier is %zu.
Fixes the following warning when building for ARMv7.

src/compositor-wayland.c: In function 'wayland_output_get_shm_buffer':
src/compositor-wayland.c:260:3: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'unsigned int' [-Wformat=]
   weston_log("could not zalloc %ld memory for sb: %m\n", sizeof *sb);
   ^

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agobuild: Silence libtoolize warnings
Thierry Reding [Tue, 27 May 2014 07:07:54 +0000 (09:07 +0200)]
build: Silence libtoolize warnings

When running the autogen.sh script, libtoolize complains thusly:

libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

Silence the warnings by following libtoolize's advice.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodesktop-shell: make background applications less dark
Jonny Lamb [Thu, 22 May 2014 20:41:34 +0000 (22:41 +0200)]
desktop-shell: make background applications less dark

10 years agoanimation: ensure repaints are always scheduled during animations
Jonny Lamb [Thu, 22 May 2014 20:41:33 +0000 (22:41 +0200)]
animation: ensure repaints are always scheduled during animations

Animations are run off the repaint cycle so if there's nothing to
repaint, an animation will stop running. This is usually not a problem
as each frame function of an animation causes something to change and
therefore a repaint to happen. This patch helps detect when the
animation isn't in said case and triggers a repaint to keep the
animation running.

This problem was found by using weston_move_scale_run() to move a view
onscreen from completely off. The very first time the animation frame
function was called the progress wasn't enough to move it into
view. The compositor saw there was nothing to repaint and stopped
doing anything else. When something else (like a pointer move) forced
a redraw, the view's position was very much onscreen and jumped into
view in an ugly way.

10 years agoexposay: fix crash when navigating with the keyboard
Emilio Pozuelo Monfort [Sat, 24 May 2014 00:43:04 +0000 (02:43 +0200)]
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>
10 years agoanimation: fix move scale animation
Jonny Lamb [Thu, 22 May 2014 20:41:30 +0000 (22:41 +0200)]
animation: fix move scale animation

Both weston_move_scale_run() and weston_slide_run() were broken in
commit 3a869019. Commit a4a6f161 fixed and explained the problem for
weston_slide_run() but weston_move_scale_run() remained broken.

To fix weston_move_scale_run(), weston_view_animation_run() is also
required. It was removed when _run() was split into two functions
_create() and _run() in commit f5cc2b56, but _run() was not added in
this commit.

10 years agocompositor: unmap subsurface views before destroying the subsurfaces
George Kiagiadakis [Fri, 13 Jun 2014 16:10:26 +0000 (18:10 +0200)]
compositor: unmap subsurface views before destroying the subsurfaces

This is to avoid recursing into weston_compositor_build_view_list()
and therefore fix crashing when destroying a stack of visible subsurfaces
due to weston_compositor_build_view_list() being called recursively
and corrupting the lists it works on.

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

10 years agoAdd a simple client for testing compositor damage handling
Jason Ekstrand [Sat, 5 Apr 2014 14:22:15 +0000 (09:22 -0500)]
Add a simple client for testing compositor damage handling

This allows for easily testing a compositor's damage tracking in all
currently available configurations including wl_surface.buffer_transform,
wl_surface.buffer_scale, and wl_viewport.  It also includes a
--rotating-damage that flag instructs the client to change the
wl_surface.buffer_transform on every commit.  This tests the compositor for
proper handling of texture uploads even when the transform has changed but
the buffer size hasn't.

10 years agolibinput: Use floating point instead of fixed point numbers
Jonas Ådahl [Mon, 2 Jun 2014 21:15:48 +0000 (23:15 +0200)]
libinput: Use floating point instead of fixed point numbers

Also update configure.ac to require libinput 0.3 when enabled, as it is
the version where double replaced li_fixed_t.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
10 years agocompositor: raise errors when bad scale or transform values are used
Jonny Lamb [Fri, 30 May 2014 10:07:15 +0000 (12:07 +0200)]
compositor: raise errors when bad scale or transform values are used

10 years agoUse FreeRDP buildin functions to get scancodes
Hardening [Fri, 11 Apr 2014 08:24:22 +0000 (10:24 +0200)]
Use FreeRDP buildin functions to get scancodes

This patch make use of the functions available in FreeRDP to retrieve
the scancode to inject.

10 years agoAdd more keyboards for the RDP compositor
Hardening [Fri, 11 Apr 2014 07:49:57 +0000 (09:49 +0200)]
Add more keyboards for the RDP compositor

This patch complements the table that contains matches between RDP
and xkb keyboard layouts. We now handle variants too.

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