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>
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>
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>
Jonny Lamb [Thu, 22 May 2014 20:41:34 +0000 (22:41 +0200)]
desktop-shell: make background applications less dark
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.
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>
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.
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
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.
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>
Jonny Lamb [Fri, 30 May 2014 10:07:15 +0000 (12:07 +0200)]
compositor: raise errors when bad scale or transform values are used
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.
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.
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
Jasper St. Pierre [Thu, 13 Mar 2014 15:04:53 +0000 (11:04 -0400)]
xdg-shell: Add show_window_menu request
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.
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.
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>
Kristian Høgsberg [Mon, 19 May 2014 23:22:28 +0000 (16:22 -0700)]
configure.ac: Bump version to 1.5.0
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.
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.
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.
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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>
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>
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>
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
Kristian Høgsberg [Fri, 9 May 2014 22:32:02 +0000 (15:32 -0700)]
configure.ac: Fix indent for screen-share option
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
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>
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>
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>
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>
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>
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>
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
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>
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
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
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
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
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
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>
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>
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>
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>
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
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
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>
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
Kristian Høgsberg [Thu, 1 May 2014 20:49:10 +0000 (13:49 -0700)]
configure.ac: Bump version to 1.4.92
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.
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
Jasper St. Pierre [Mon, 28 Apr 2014 15:19:32 +0000 (11:19 -0400)]
window: Add a simple getenv to force SHM rendering
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.
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.
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.
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.
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.
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
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>
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.
Kristian Høgsberg [Wed, 30 Apr 2014 23:28:41 +0000 (16:28 -0700)]
xwayland: Set decoration margin for xwayland windows
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
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.
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.
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>
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
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
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
Kristian Høgsberg [Tue, 29 Apr 2014 23:38:23 +0000 (16:38 -0700)]
desktop-shell: Remove unused variables
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
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
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
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
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.
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()
Kristian Høgsberg [Tue, 29 Apr 2014 21:47:19 +0000 (14:47 -0700)]
window.c: Dismiss menu on touch up events
Kristian Høgsberg [Tue, 29 Apr 2014 21:30:44 +0000 (14:30 -0700)]
window.c: Also grab touch events when grabbing input
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.
Kristian Høgsberg [Tue, 29 Apr 2014 21:11:26 +0000 (14:11 -0700)]
window.c: Update pointer focus when taking a 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
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.
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>
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.
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.
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.
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