Commit Graph

3834 Commits

Author SHA1 Message Date
U. Artie Eoff
f05645b30e wcap-decode: remove dead code
Avoids leaking memory we never use.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 21:59:37 -08:00
U. Artie Eoff
1db007202b log: print dummy timestamp if localtime call fails
Handle the case where localtime fails (NULL) and print
something else to indicate localtime is erroneous.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 21:58:57 -08:00
U. Artie Eoff
981fa33809 backlight: fix backlight_path memory leak
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 21:58:53 -08:00
Kristian Høgsberg
87d3b61355 shell: Don't start a fade animation if we don't have an output
When the last window of the X11 compositor is closed during a fade or
while locked, we'll try to start a fade back to the lock screen.  However,
if we closed the last window, there are no outputs left and the animation
will try to run with surface->output == NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=73665
2014-01-19 21:48:10 -08:00
Kristian Høgsberg
8fe412d35b Revert part of 17bccaed42
Commit 17bccaed42 accidentally reverted
the fix for 73490 from 5cbc763404.
2014-01-17 16:40:49 -08:00
Kristian Høgsberg
27d5fa8922 shell: Cancel popups when triggering screensaver
This is part of the fix for bug 72540.  We cancel the popup grab when the
screensaver kicks in so that the screen unlock dialog can get input events.
The bigger problem is in mesa however, where we try to allocate new buffers
as cairo-gles2 does a gratuituous (but valid) eglMakeCurrent() as we
remove the tooltip or popup-menu.

Since we removed the weston_layer with the regular surfaces, EGL blocks
waiting for a frame event that never comes.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72540
2014-01-17 16:22:50 -08:00
Kristian Høgsberg
6f394d59a1 resizor: Don't resize if maximized
https://bugs.freedesktop.org/show_bug.cgi?id=73723
2014-01-17 15:31:33 -08:00
Kristian Høgsberg
8e80a31ba4 shell: Stop moving surfae after touch point 0 goes up
The grab stays alive as long as at least one touch point is down.  If touch
point 0 is lifted while other touch points are down, the surface will jump
around when touch point 0 is put down again.

This change marks the grab as inactive once touch point 0 is lifted
and then ignores touch events until all touch points eventually are
lifted and the grab terminates.

https://bugs.freedesktop.org/show_bug.cgi?id=73750
2014-01-17 15:18:35 -08:00
Kristian Høgsberg
1be87e3c81 compositor-drm: Make composite bypass work on secondary outputs
The opaque region is in surface coordinates, which we compare to the
output region, which is in compositor coordinates.  For non-primary
outputs, that means that the output region is not located at 0,0 but
something like 1920,0 instead.  That means that the output region isn't
contained in the surface opaque region and then we decide we can't scan
out from it.

Instead, compare the surface opaque region to the output region
translated to 0,0.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=7348i5
2014-01-17 14:22:41 -08:00
Kristian Høgsberg
e61d2f4812 shell: Don't assign keyboard focus for seats without keyboard
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73570
2014-01-17 12:19:06 -08:00
Axel Davy
e4450f9123 Fix XWayland crashes when opening popups
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-01-17 11:59:56 -08:00
Bryce W. Harrington
d716754cfb gitignore: Generated files text-client-protocol.h, text-protocol.c
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-01-17 11:32:01 -08:00
Bryce W. Harrington
991f271de5 Cleanup stray newline in a return statement
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-01-17 11:30:48 -08:00
Bryce W. Harrington
3abdafd12d terminal: Only set title if asprintf succeeded
Handles potential out of memory situation by skipping the title update.
This fixes the following warning:

  terminal.c: In function ‘resize_handler’:
  terminal.c:851:11: warning: ignoring return value of ‘asprintf’,
  declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-01-17 11:29:54 -08:00
Wieland Hoffmann
ad0704a226 weston.ini.man: Fix some grammar 2014-01-17 11:11:31 -08:00
Kristian Høgsberg
17bccaed42 input: Handle unplugging the output for a touchscreen device
A paired touch screen will stop sending events if its corresponding
output is unplugged.  An unpaired touchscreen will pick the new primary
output.

https://bugs.freedesktop.org/show_bug.cgi?id=73637
2014-01-16 17:08:26 -08:00
Kristian Høgsberg
d56ab4eb18 shell: Disable exposay by default
Add a config file option to enable it, but leave it off by default.  Exposay
still triggers too many lock-ups or stuck grabs and triggers under X even
when the Wayland window doesn't have keyboard focus.
2014-01-16 16:52:12 -08:00
Kristian Høgsberg
5cbc763404 shell.c: Not all seats have pointers
Don't look up the pointer focus in ping_timeout_handler() if the
seat doesn't have a pointer.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73490
2014-01-15 11:46:38 -08:00
Axel Davy
fa506b6dda Fix XWayland transient window location.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73517

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-01-13 16:02:29 -08:00
Jason Ekstrand
81038fba86 Only update the surface size if a new buffer is attached
This fixes a regression caused by either 918f2dd4 or da75ee1d.  In
particular, if a client called commit without attaching a buffer and if the
compositor had already released its reference to the buffer, then a size of
0x0 would be set on the surface.  In particular, this affects the wayland
backend because it frequently sends only a frame request in order to cause
a refresh.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-01-13 15:59:08 -08:00
Kristian Høgsberg
c180977e7c text: Set context->model to NULL when we deactivate text input
There's a small window between the input method (eg the on-sreen keyboard)
receiving the deactivate and destroying the context, where the keyboard may
send requests, which we forward to the destroyed input method.  Fix this
by setting the contexts model to NULL right away and then avoid sending
events if context->model is NULL.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69490
2014-01-13 15:06:10 -08:00
Kristian Høgsberg
211b517e8c shell: Move maximize and fullscreen bindings to mod + SHIFT
mod + f and mod + m conflict with too many application bindings, in
particular if mod is mapped to ALT.
2014-01-11 13:58:33 -08:00
Kristian Høgsberg
b637a40df9 window: Properly destroy tooltip windows when parent window is destroyed
If we destroy a window with an active tooltip, we leave the tooltip
hanging around.  Call tooltip destructor when destroying a window.
This fixes the stuck tooltip observed when unplugging a monitor with
an active tooltip on the panel.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72931
2014-01-10 00:27:35 -08:00
Kristian Høgsberg
9046d2424a shell: Orphan child windows when a shell surface is destroyed
We now track the child surfaces of a shell surface and the child surfaces
have a pointer back to their parent.  We need to clean all this up and
NULL out the childrens parent pointers when a shell surface is destroyed.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72931
2014-01-10 00:25:30 -08:00
Kristian Høgsberg
d6d3b377f8 keyboard: Make debug output less verbose
The keyboard is too chatty, make it use a dbg() function for logging
which defaults to disabled.

Also drop a noisy fprintf() in input_panel_configure().
2014-01-09 23:58:14 -08:00
Kristian Høgsberg
700d6ad071 keyboard: Don't strcat() into a strdup()ed string
We need to reallocate the memory to hold the entire concatenated string,
but strcat() doesn't do that.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
2014-01-09 23:45:18 -08:00
Kristian Høgsberg
a548b4b85c keyboard: Fix insert_text() string utility
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
2014-01-09 23:39:20 -08:00
Kristian Høgsberg
b0fb25dedc compositor: Init output listeners in weston_view if it's not on any output
If we don't add the listener back to a new output, we have to init the
list links so we can remove them unconditionally.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73415
2014-01-09 22:42:28 -08:00
Kristian Høgsberg
8ca9544e06 input: Re-pair touch screen when monitor is plugged in
https://bugs.freedesktop.org/show_bug.cgi?id=73442
2014-01-09 16:46:33 -08:00
Kristian Høgsberg
70f2901989 shell: Make sure we still have touch or pointer focus when moving/resizing
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
2014-01-09 15:43:17 -08:00
Neil Roberts
97b747cdda westoy: Add an option to explicitly disable cairo on a widget
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
2014-01-09 15:03:15 -08:00
Kristian Høgsberg
a30e29af2e input: Ignore touch up events if num_tp is 0
This can happen if we start out with one or more fingers on the touch
screen, in which case we didn't get the corresponding down event.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73367
2014-01-08 22:29:25 -08:00
Rafal Mielniczuk
b2917a2fed shell: run surface bindings only when focus surface is not NULL
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
2014-01-08 22:17:40 -08:00
Fabien DESSENNE
4b2558708b compositor-drm: consider the best mode of the mode_list as an option
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>
2014-01-08 22:06:05 -08:00
Rui Matos
73d9395e68 input: Don't leak the initial keymap
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.
2014-01-08 21:40:32 -08:00
Pekka Paalanen
b0420aeb3d protocol: rename wl_surface_scaler to wl_viewport
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>
2014-01-08 21:33:19 -08:00
Pekka Paalanen
73e9f86e2c tests: fix build on rpi with EGL
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>
2014-01-08 21:30:20 -08:00
Pekka Paalanen
2d91ee171b screenshooter: silence a warning
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>
2014-01-08 21:27:53 -08:00
Pekka Paalanen
ca6bd745b8 tests: Only run buffer-count test on Mesa >= 10.1
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>
2014-01-08 21:27:53 -08:00
Kristian Høgsberg
2fce4808dd input: Remap touch point IDs from multiple touch screens to not overlap
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
2014-01-08 16:21:24 -08:00
Emilio Pozuelo Monfort
1a26f1baba exposay: set an alpha on fullscreen surfaces
This makes the desktop background actually draw when there is
a fullscreen surface and we go to exposay.
2014-01-07 21:46:36 -08:00
Emilio Pozuelo Monfort
e6bbe5a90d exposay: fix infinite loop with fullscreen surfaces
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
2014-01-07 21:41:18 -08:00
Kristian Høgsberg
ef9c8eb2db keyboard: Handle touch up event
This fixes arrow keys which trigger on button up.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73169
2014-01-07 12:57:59 -08:00
Kristian Høgsberg
966e3ed247 editor: Add missing touch-to-activate for the entries
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72996
2014-01-07 10:42:41 -08:00
Armin K
917711bd59 clients: Fix libexec clients install 2014-01-03 17:33:36 -08:00
Kristian Høgsberg
0ed6750541 shell: Only assign focus on touch if there is a touch focus surface
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
2014-01-02 23:00:11 -08:00
Kristian Høgsberg
9f7e331a20 xwm: Handle WM_TRANSIENT_FOR
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
2014-01-02 22:55:04 -08:00
Ricardo Vieira
14613bacda build: fix commit that changed option for installing client
Without this patch the option --enable-demo-clients-install does not
install the client demos.
2014-01-02 15:46:33 -08:00
Chris Michael
8b37687d3a Properly free drm plane during creation of sprites
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>
2014-01-02 15:22:59 -08:00
Kristian Høgsberg
0e45e8712a shell: Start the input panel slide slightly on the output
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.
2014-01-02 01:33:42 -08:00