Commit Graph

4145 Commits

Author SHA1 Message Date
Giulio Camuffo 95ec0f95aa compositor: add a masking mechanism to weston_layer
this adds a mechanism to mask the views belonging to a layer
to an arbitrary rect, in the global space. The parts that don't fit
in that rect will be clipped away.
Supported by the gl and pixman renderer only for now.
2014-07-23 12:34:33 -07:00
Giulio Camuffo 412e6a59eb compositor: keep track of the weston_layer a weston_view is in
This introduces a new struct, weston_layer_entry, which is now used
in place of wl_list to keep the link for the layer list in weston_view
and the head of the list in weston_layer.
weston_layer_entry also has a weston_layer*, which points to the layer
the view is in or, in the case the entry it's the head of the list, to
the layer itself.
2014-07-23 12:34:33 -07:00
Marek Chalupa cfff312204 tests: use expect_protocol_error in tests
Turn FAIL_TESTs to TESTs. FAIL_TESTs are bad...

Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-22 19:16:49 +03:00
Marek Chalupa 1740aa8c85 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>
2014-07-22 19:15:28 +03:00
Marek Chalupa 4d06d46ace 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>
2014-07-22 19:14:54 +03:00
Jasper St. Pierre e7d7468521 xdg-shell: Fix documentation
request_change_state has been folded into the configure event.
2014-07-17 14:50:51 -07:00
Jasper St. Pierre ccf48fb4f9 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.
2014-07-17 13:59:01 -07:00
Jasper St. Pierre bd65e50875 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.
2014-07-17 13:58:45 -07:00
Jason Ekstrand 7b98207667 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>
2014-07-07 09:12:57 -07:00
Jason Ekstrand 108865de88 Move weston_frame_callback above weston_surface_create
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-07 09:12:32 -07:00
Jason Ekstrand e9d40e3ff5 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>
2014-07-07 09:11:54 -07:00
Boyan Ding 9c5aedfff2 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>
2014-07-05 01:05:07 -07:00
Boyan Ding c4902124f9 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>
2014-07-05 01:05:06 -07:00
Jason Ekstrand ef5400843f Use pixman_region32_clear instead of our own empty_region
This requires pixman 0.25.2

Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-07-05 01:03:55 -07:00
Boyan Ding 32abdbbad9 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>
2014-06-25 19:59:26 -07:00
Andrew Wedgbury dfd9d0de96 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>
2014-06-25 09:05:39 -07:00
Jason Ekstrand 8202d72054 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.
2014-06-25 09:05:26 -07:00
Arnout Engelen 7da71eec40 Better error message when exec'ing Xwayland fails 2014-06-25 15:52:35 +03:00
Peter Hutterer 3b843d3a61 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>
2014-06-25 08:46:35 +02:00
Jason Ekstrand 671a1442a7 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".
2014-06-24 11:10:28 -07:00
Jason Ekstrand 76f623605f Fix a comment 2014-06-24 11:10:02 -07:00
vivek 31732f7c68 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>
2014-06-24 10:22:43 -07:00
Boyan Ding 1478ea54ca xdg-shell: Fix a typo in description
Signed-off-by: Boyan Ding <stu_dby@126.com>
2014-06-24 10:19:03 -07:00
Emilio Pozuelo Monfort 5872b6821b 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>
2014-06-23 13:41:30 -07:00
Srivardhan Hebbar 28ee518305 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>
2014-06-21 10:33:21 -07:00
George Kiagiadakis 8f9e87ff47 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.
2014-06-19 10:04:18 -07:00
Srivardhan Hebbar ba2a36d5c5 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>
2014-06-18 17:14:40 -07:00
Thierry Reding 6ac60c1791 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>
2014-06-18 17:14:40 -07:00
Thierry Reding 0e6d9a771a 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>
2014-06-18 17:14:40 -07:00
Jonny Lamb 7e7d485164 desktop-shell: make background applications less dark 2014-06-18 17:14:40 -07:00
Jonny Lamb f8bfd0581b 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.
2014-06-18 17:14:40 -07:00
Emilio Pozuelo Monfort 5905ebcc33 exposay: fix crash when navigating with the keyboard
Commit a7592019 introduced an optimization that caused some
exposay struct members to not be properly initialized, particularly
cur_output, leading to crashes in some circumstances (e.g. pressing
the down arrow key after going to exposay).

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-06-18 17:14:40 -07:00
Jonny Lamb 91f80f24b4 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.
2014-06-18 17:14:39 -07:00
George Kiagiadakis ed04d38f6a 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
2014-06-18 11:22:27 -07:00
Jason Ekstrand 549a53f186 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.
2014-06-18 10:45:50 -07:00
Jonas Ådahl 26714b4718 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>
2014-06-09 22:46:45 +02:00
Jonny Lamb a55f139d3c compositor: raise errors when bad scale or transform values are used 2014-06-03 09:19:20 +03:00
Hardening 6d1d1121a5 Use FreeRDP buildin functions to get scancodes
This patch make use of the functions available in FreeRDP to retrieve
the scancode to inject.
2014-06-02 15:17:08 +02:00
Hardening ea2aa13ceb 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.
2014-06-02 15:16:59 +02:00
Kristian Høgsberg 73dfbd517f Add releasing.txt to describe the release steps and other bits of process 2014-05-23 10:13:59 -07:00
Jasper St. Pierre 81ff075bf4 xdg-shell: Add show_window_menu request 2014-05-23 09:43:17 -07:00
Jasper St. Pierre de8bd50d35 clients: Allow creating a "detached" menu
This will be used by the xdg_surface.show_menu_window implementation.
2014-05-23 09:37:19 -07:00
Kristian Høgsberg ca85dc6b92 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.
2014-05-23 09:35:26 -07:00
U. Artie Eoff a1e887bd46 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>
2014-05-23 09:57:02 +03:00
Kristian Høgsberg caa7019317 configure.ac: Bump version to 1.5.0 2014-05-22 21:46:43 -05:00
Jasper St. Pierre dda9313bd9 clients: Remove the window / user parameters from the menu function
We want the ability to create a detached menu.
2014-05-18 13:54:15 -07:00
Kristian Høgsberg be803ad67c 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.
2014-05-12 23:34:34 -07:00
Jasper St. Pierre f184c382e8 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.
2014-05-12 23:34:31 -07:00
Jasper St. Pierre ccf908b078 window: Set frame flags immediately when we handle the new states in configure 2014-05-12 23:34:05 -07:00
Jasper St. Pierre 851799e791 shell: Make margin double-buffered state that's applied on commit 2014-05-12 23:34:05 -07:00