strncat() into a newly allocated buffer isn't well-defined. I don't know
how this didn't crash all the time, getting blocks from malloc() with
a NUL in the first byte must be fairly common.
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
It's possible to touch a surface to move it and let go before we get
to common_surface_move(), in which case we don't have a touch focus
when we get there. For pointers, we could click a surface, but have the
surface go away before we get to common_surface_move(), in which
case the button count is non-zero, but we don't have a surface.
In either case we crash, so let's add a check to make sure we still
have a focus surface before we try to move it.
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73448
The subsurfaces example creates a subsurface widget and uses EGL to
render to it directly rather than using the cairo context from the
widget. In theory this shouldn't cause any problems because the westoy
window code lazily creates the cairo surface when an application
creates a cairo context. However commit fdca95c7 changed the behaviour
to force the lazy creation at the beginning of each surface redraw.
This ends up making the triangle surface get two attaches – one from
Cairo and one from the direct EGL.
It looks like it would be difficult to reinstate the lazy surface
creation behaviour whilst still maintaining the error handling for
surface creation because none of the redraw handlers in the example
clients are designed to cope with that. Instead, this patch adds an
explicit option on a widget to disable creating the Cairo surface and
the subsurface example now uses that.
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72854
This fixes the crash when move, rotate or resize binding is activated
while exposay effect is active.
Steps to reproduce:
- activate exposay
- try to rotate the surface with mod + right mouse button
- crash
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72885
This patch fixes an issue where Weston using the DRM backend, cannot start
the display. This happens in the following context:
- no video mode is set before weston starts (eg no "/dev/fb" set up)
- weston is not configured with any default video mode (nothing from
weston.ini nor command line)
- the DRM driver provides with a list of supported modes, but none of them
is marked as PREFERRED (which is not a usual case, but it happens)
In that case, according to the current implementation, the DRM compositor
fails to set a video mode.
This fix lets the DRM compositor selects a video mode (the best one of the
list, which is the first) from the ones provided by the driver.
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
weston_xkb_info_create() takes ownership of the xkb_keymap instance so
we should drop our reference or we would leak it later if the keymap
was changed.
This seems like a better name, and will not conflict if someone later
extends wl_surface with a request scaler_set (yeah, unlikely).
This code was written by Jonny Lamb, I just diffed his branches and made
a patch for Weston.
Cc: Jonny Lamb <jonny.lamb@collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch fixes the compiler errors:
CC weston_test_la-weston-test.lo
weston-test.c:34:21: fatal error: EGL/egl.h: No such file or directory
CC buffer-count-test.o
buffer-count-test.c:30:21: fatal error: EGL/egl.h: No such file or directory
On rpi, the EGL headers are not in the standard path.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
screenshooter.c: In function ‘recorder_binding’:
screenshooter.c:509:5: warning: ‘listener’ may be used uninitialized in
this function [-Wuninitialized]
This was not really a problem so far, because the variable was
uninitialized only in the case where Weston had no outputs.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Comment #2 in the bug report says Mesa 10.0 branch does not have the
fix, and indeed buffer-count test fails on Mesa 10.0.1. Fix the test to
require Mesa 10.1 or later.
Now I correctly get:
mesa version too old (OpenGL ES 3.0 Mesa 10.0.1 (git-12484d2))
https://bugs.freedesktop.org/show_bug.cgi?id=72835
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
With multiple touch screens on one seat, the touch points IDs from the
different evdev devices may overlap. We have to remap the IDs we forward
to core weston so that the touch points all have unique IDs within the seat.
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73003
We were calling exposay_highlight_surface() inside a wl_list_for_each
loop for a layer, but exposay_highlight_surface() calls activate()
which calls shell_surface_update_layer(), which removes the surface
from its layer and reinserts it, causing an infinite loop.
Call exposay_highlight_surface() outside the for_each to avoid this.
https://bugs.freedesktop.org/show_bug.cgi?id=72404
Similar to 7c4f6cc145, if we don't have
a background image from the desktop-shell client or the touch point
for some other reason doesn't hit a surface we trigger a
segfault as we try to deref the seat->touch->focus NULL pointer.
For touch, another problem could be fudgey calibration that ends up
giving touch coordinates outside the output space.
https://bugs.freedesktop.org/show_bug.cgi?id=72839
Set up X windows that are transient for another window as transient
surfaces in shell.c. This keeps the transient windows on top of their
parent as windows are raised, lowered for fullscreened.
https://bugs.freedesktop.org/show_bug.cgi?id=69443
If we fail to allocate space for a new drm_sprite, then we should
properly call drmModeFreePlane (not free) to release the drm plane.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
If a surface is not on any output, scheduling a repaint for it is a no-op.
weston_view_schedule_repaint() schedules repaints for all outputs that
overlap with the surface extents, but if the surface is completely
outside all outputs nothing will be scheduled. Fix this for now by starting
the slide slightly into the output.
The input-panel codes tries to see determine if a buffer has not yet
been attached (or a NULL buffer has been attached), and doesn't map
the input panel surface yet in that case. However, it test for
buffer_ref being NULL, which can happen for other reasons. The right
test is to see if surface->width is 0, which means that either a
buffer hasn't yet been attached or a NULL buffer has been attached.
https://bugs.freedesktop.org/show_bug.cgi?id=72519
If we're not currently showing the input panels, we still need to set the
panel position so that it's set when we later need to show them. This fixes
the initial flicker of the input panel in the wrong position when we first
show it.
If we don't have a background image from the desktop-shell client or the
pointer for some other reason doesn't have a focus we trigger a
segfault as we try to deref the seat->pointer->focus NULL pointer.
https://bugs.freedesktop.org/show_bug.cgi?id=73066
This is still fairly unstable, causes lockups with fullscreen and exposay,
leaves small preview surfaces on-screen if used on the same modifier as
mod-tab. We also only need on mod-tab implementation so lets see if we
can consolidate the current and this alt-tab implementation in 1.5.
https://bugs.freedesktop.org/show_bug.cgi?id=72610
All the libexec programs are only built when BUILD_CLIENTS is true,
so we can just assign libexec_PROGRAMS under the condition. This lets us
drop most of the variable assignments and simplify it a bit.
https://bugs.freedesktop.org/show_bug.cgi?id=72812
Previously the option was --enable-demo-clients and the conditional was
ENABLE_DEMO_CLIENTS. They control whether or not we install the demo clients
(ie all other clients than weston-terminal and weston-info). Rename the
option and the conditional to better reflect this.
Popup windows are relative to a plain wl_surface, so that custom surfaces
can have popups. This used for the desktop-shell panel for example. Also,
popups should be immediately on top of their parent surface, as they
typically represent an extension of an UI element in the parent surface
such as a combo box or menu.
This reverts commit da704d97fa.
Conflicts:
desktop-shell/shell.c
https://bugs.freedesktop.org/show_bug.cgi?id=72547
If we don't mark the state as changed, we don't copy over next_state to
state and we fail to treat the surface as a transient. In particular,
we give it a random intial position instead of mapping it at the given
parent relative position.
https://bugs.freedesktop.org/show_bug.cgi?id=72532
Set the internal pointer for the client to NULL. This fixes a
segmentation fault at shutdown, where the shell would hang up before
and cause libwayland to call wl_client_destroy(). When the shell was
destroyed later, another call to wl_client_destroy() would cause the
crash.
https://bugs.freedesktop.org/show_bug.cgi?id=72550
Currently we destroy the renderer before the outputs are destroyed, but
that sometimes leads to an error since a reference to the renderer is
necessary in order to destroy a gl_renderer_output.
Since destroying the renderer is common among all backends, just move
that call into weston_compositor_shutdown() immediately after the
outputs being destroyed.
While the pixman image might be attached, the underlying buffer might be
already gone under certain circumstances. This is easily reproduced by
attempting to resize gnome-terminal on a fbdev backend.
$ WAYLAND_DEBUG=1 strace -emunmap weston --backend=fbdev-backend.so
...
[1524826.942] wl_shm@7.create_pool(new id wl_shm_pool@23, fd 40, 1563540)
[1524827.315] wl_shm_pool@23.create_buffer(new id wl_buffer@24, 0, 759, 515, 3036, 0)
...
[1524829.488] wl_surface@14.attach(wl_buffer@24, 0, 0)
[1524829.766] wl_surface@14.set_buffer_scale(1)
[1524829.904] wl_surface@14.damage(0, 0, 759, 515)
[1524830.248] wl_surface@14.frame(new id wl_callback@25)
[1524830.450] wl_surface@14.commit()
...
[1524846.706] wl_shm@7.create_pool(new id wl_shm_pool@26, fd 40, 1545000)
[1524847.215] wl_shm_pool@26.create_buffer(new id wl_buffer@27, 0, 750, 515, 3000, 0)
[1524847.735] wl_buffer@24.destroy()
[1524847.953] -> wl_display@1.delete_id(24)
[1524848.144] wl_shm_pool@23.destroy()
munmap(0xb5b2e000, 1563540) = 0
[1524849.021] -> wl_display@1.delete_id(23)
[1524849.425] wl_surface@14.attach(wl_buffer@27, 0, 0)
[1524849.730] wl_surface@14.set_buffer_scale(1)
[1524849.821] wl_surface@14.damage(0, 0, 750, 515)
<No commit yet, so drawing is attempted from older buffer that used to be
attached to the surface, which happens to come from a destroyed pool,
resulting it an invalid read from address 0xb5b2e000>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Remove those listeners when the output is destroyed, otherwise they'll
point to invalid data that may lead to corruption when assigning a new
output for the view.
--
This is possibly related to bug 72845. I didn't have enough equipment
to try and reproduce it.
https://bugs.freedesktop.org/show_bug.cgi?id=72845
Record from the output of the surface that has keyboard focus for the
seat used to activate the recorder key binding. If there is no focused
surface, record from the first one.
Also, use the weston_transformed_region() to transform the damage
region of the output into the coordinates expected by read_pixels().
https://bugs.freedesktop.org/show_bug.cgi?id=71401
If the compositor hasn't been rendering for a while when the recording
stops, the time difference between the last rendered frame and that
moment won't be in the encoded video. Fix that by forcing one extra
frame to be recorded when the user presses the recorder key binding.
https://bugs.freedesktop.org/show_bug.cgi?id=71142