Commit Graph

3255 Commits

Author SHA1 Message Date
Rusty Lynch 1084da506e Add touch support for wl_shell_surface_move 2013-08-16 10:56:00 -07:00
Ander Conselvan de Oliveira d224bb9218 nested: Fix skipping frames due to texture update without a context
Calls into cairo-gles may change the current context, so it was only by
chance that sometimes we had the proper one as current and updated the
correct texture in surface_attach().

In order to fix this, calling display_acquire_window_surface() before
binding the texture for setup is necessary. However this call has the
side effect of allocating a cairo surface for the window. At flush time,
the existence of this surface will cause an eglSwapBuffers(), even
if no rendering was done to it, leading to undefined contents on the
screen. This happens when the idle redraw task runs while there is a
pending frame callback.

Workaround this by moving the texture setup from surface_attach() to the
redraw handler, so that the cairo surface is only allocated when
redering is done.
2013-08-16 10:56:00 -07:00
Kristian Høgsberg 0d5fe3a231 nested: The wl_resouce is the buffer, not the wl_resource user data 2013-08-16 10:56:00 -07:00
Daniel Stone 8e7a8bdeea Add more missing config.h includes
config.h includes were missing in a few files, including input.c, the
lack of which caused the X11 backend to segfault instantly due to not
having an xkbcommon context.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2013-08-16 10:56:00 -07:00
Kristian Høgsberg 69594ccf9c window: Use xzalloc() instead of silently failing to add output 2013-08-16 10:55:59 -07:00
Maksim Melnikau 92de144331 add [xwayland] path weston.ini option
It sets the path to the xserver to run.

Signed-off-by: Maksim Melnikau <maxposedon@gmail.com>
2013-08-16 10:55:59 -07:00
Kristian Høgsberg 06b16c2a0b weston-info: Use xmalloc() in weston-info 2013-08-16 10:55:59 -07:00
Kristian Høgsberg adcd54bc3c window: Use xzalloc() instead of failing to add input device 2013-08-16 10:55:59 -07:00
Kristian Høgsberg 1a5f0c34ff window: Fix logic for looking up widget default cursor
We may deref a NULL pointer if there is no grab and no focus widget.
2013-08-16 10:55:59 -07:00
Kristian Høgsberg 08b58c7c12 compositor: Handle OOM in weston_buffer_from_resource()
Handle NULL-return in call-sites as well.
2013-08-15 12:26:42 -07:00
Kristian Høgsberg 980b018825 window: Don't check for subcompositor in window_add_subsurface()
Client should check for subcompositor support up front.  Now
window_add_surface() can never return NULL.
2013-08-15 11:56:41 -07:00
Kristian Høgsberg b20b00923a window: Add API to check for subcompositor, use in subsurface example
This way we can fail with a nice error message.
2013-08-15 11:54:03 -07:00
Kristian Høgsberg c85a9178c7 simple-touch: Handle OOM when allocating struct touch 2013-08-15 11:40:30 -07:00
Kristian Høgsberg 96c619af43 simple-shm: Handle OOM when allocating struct display 2013-08-15 11:39:52 -07:00
Kristian Høgsberg 20ffdffc03 keyboard: Don't use next_utf8_char() to go back where we came from
We go one utf8 char back and then one forward.  Just remember the original
position instead, which also avoids a warning about potentially
dereferencing a NULL return value from next_utf8_char().
2013-08-15 11:37:14 -07:00
Armin K 0a8461b95e autotools: Add configure summary 2013-08-13 20:46:23 -07:00
Kristian Høgsberg 3e125830a5 terminal: Make utf-8 state machine assemble unicode code point value 2013-08-13 17:23:54 -07:00
Giulio Camuffo 13b85bdb65 compositor: ref-count weston_surface instances
This allows a surface to live on after its resource has been
destroyed.  The ref-count can be increased in a resource destroy signal
listener, to keep the surface around for a destroy animation, for example.
2013-08-13 15:19:50 -07:00
Kristian Høgsberg b1c02a80ef evdev: Ignore joystick devices
We don't handle them in any way now and having your steering wheel move
the cursor isn't useful.  Applications can still open evdev devices and
access them directly like they already do.
2013-08-13 14:55:39 -07:00
Giulio Camuffo 9f42e50868 xwm: do not crash when activating a NULL surface 2013-08-13 10:04:27 -07:00
Armin K b502f906db evdev-touchpad: Set some options using weston.ini
This patch adds 3 new options to weston.ini to allow
the user to change default constant_accel_factor,
min_accel_factor and max_accel_factor. If no options
are set, it falls back using defaults as it did before.

v2: create weston_config_section_get_double and use it
instead of manualy converting string to double.

v3: add default values in weston_config_get_double
instead of using conditionals.

v4: don't pass diagonal as pointer.
2013-08-12 22:42:17 -07:00
Rob Bradford 7ac9f73c7d weston-launch: Only pass non-NULL value into setenv()
getenv() can return NULL is the key is not set, passing NULL into
setenv() is an error
2013-08-12 22:24:44 -07:00
Rolf Morel 14c9892069 evdev: write EV_SYN input_event along with led events to device
Other clients of an evdev device need to have the events they receive
be separated, in moment in time, from other events by an EV_SYN/
SYN_REPORT. This is the responsibility of the client who writes events
into the stream.
2013-08-12 22:23:13 -07:00
Kristian Høgsberg e9cabc1bc3 nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display 2013-08-12 22:21:22 -07:00
Rob Bradford 4c1a9bc684 build: Allow more control over cairo use in the clients
Previously the configure script would silently disable the use of
accelerated cairo in the clients if cairo-gl could not be found (or
cairo-glesv2 if that was requested.) Conversely the use of cairo-gl
would be automatically enabled if it was found with no way to disable
that feature

This change adds --with-cairo which takes one of "image", "gl" or
"glesv2" (defaulting to "image"). If "gl" or "glesv2" is specified
cairo-egl is checked for as well as the specified renderer. If the check
fails then the configure process errors out.
2013-08-12 22:18:34 -07:00
Kristian Høgsberg 473f248d7e screenshooter: Add missing newline and use program_invocation_short_name 2013-08-12 22:15:38 -07:00
Kristian Høgsberg bdd8377312 screenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
This application doesn't use toytoolkit, so don't link to it.  We have to
add a copy of xmalloc, to link without toytoolkit.
2013-08-12 22:12:32 -07:00
Giulio Camuffo 4e5f1153ca Install shared/zalloc.h
Plugins need to have it available, as it is included in compositor.h.

https://bugs.freedesktop.org/show_bug.cgi?id=67948
2013-08-12 21:29:53 -07:00
Adrian Negreanu f5e3ad295c fix compile error when EGL_BUFFER_AGE_EXT is missing
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Adrian Negreanu 6d14b14147 remove dependency on EGL_KHR_surfaceless_context
cairo_egl_device_create(), which is called next,
already checks if EGL_KHR_surfaceless_context is
available. If not, it fallbacks to pbuffer.

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Rob Bradford 880ebc7ed9 input: For serial generation get the display from the compositor
This removes the use of wl_client_get_display() where the client is
derived from the focussed resource. This starts the removal of the
assumption of a single resource on a client that would be notified about
events on the focussed surface.
2013-08-12 16:54:10 -07:00
Rusty Lynch 4384a24a9e desktop-shell: Add touch support to panel launcher icons 2013-08-12 16:54:10 -07:00
Rusty Lynch 3ba1263438 calibrator: Add touch support to calibrator 2013-08-12 16:54:10 -07:00
Rusty Lynch 3bb2b8cfe9 smoke: Add touch support to smoke example 2013-08-12 16:54:10 -07:00
Rusty Lynch 041815aa05 window.c: Add touch handlers
This adds basic infrastructure for handling touch events in the toytoolkit.
2013-08-12 16:50:26 -07:00
Rusty Lynch f1407ff81d input: Store touch position and time when we start an implicit touch grab 2013-08-08 22:01:42 -07:00
Rusty Lynch 92e83929f0 evdev: Use touch ID 0 when generating touch up event
device->mt.slot is uninitialized when we're not receiving the
evdev slot events.  Always use ID 0 as we do when we generate the
touch down and motion events.
2013-08-08 22:01:42 -07:00
Adrian Negreanu c838423b5e compositor: Setup weston-launch sock in fbdev
weston_launcher_open() was failing with:
    recvmsg: Socket operation on non-socket

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-08 22:01:42 -07:00
Peter Hutterer 499d8a4046 configure.ac: check for wayland scanner macro 2013-08-08 21:54:53 -07:00
Brian Lovin 1bf14815ef terminal.c: Check if fdopen() fails
If fdopen() fails we just close the fd and return, failing
the copy-and-paste.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-08 16:25:13 -07:00
Peter Hutterer 34be0608c7 weston-launch: always drop privileges before execve
The current code works if pw->pw_shell is bash because:
 "If the shell is started with the effective user (group) id not equal to
 the real user (group) id, and the -p option is not supplied, these actions
 are taken and the effective user id is set to the real user id."

Thus, for bash, weston's EUID == UID.

For zsh, the -p option "is enabled automatically on startup if the effective
user (group) ID is  not equal to the real user (group) ID."
Thus, weston's EUID = 0, and if pw_shell is zsh, /run/user/$UID/wayland-0 is
created with euid root and not writeable by the user, causing all clients to
fail.

Fix this by always dropping privileges to the user.

Regression introduced in 636156d.
2013-08-08 14:11:09 -07:00
Peter Hutterer 4477fee1c3 evdev: log when a device is used as touchpad 2013-08-08 14:04:58 -07:00
Peter Hutterer 6bb15cd4a8 evdev: call evdev_device_destroy on failure
Avoid keeping keeping what needs to be freed in sync in multiple places,
make evdev_device_destroy do the right thing instead.
2013-08-08 14:04:47 -07:00
Peter Hutterer 76d35286cf evdev: plug a potential memleak
For touchpads, device->dispatch is set up when exiting
evdev_handle_device() and a potential source for a memleak.
This can't actually happen at the moment, as evdev_handle_device() won't
fail for touchpads after setting up the dispatch but prevent this from
happening in the future.
2013-08-08 14:04:25 -07:00
Peter Hutterer df66c5bf79 evdev: get the current slot value from the absinfo struct or mtdev
If touches are already present on the device, absinfo has the currently
active touch slot. There's a race condition where the slot may change before
we enable the fd and we thus miss out on the ABS_MT_SLOT event. It's still
slightly more correct than assuming whatever comes next is slot 0.
2013-08-08 14:03:23 -07:00
Peter Hutterer 0d061e3802 evdev: only use mtdev for Protocol A devices
For Protocol B devices, mtdev merely routes the events and is not needed.
For Protocol A devices, mtdev is needed, so fail for those devices now if we
mtdev fails.
2013-08-08 14:00:30 -07:00
Peter Hutterer 89af60e6f5 evdev: add comment why we're ignoring key value 2 2013-08-08 13:58:36 -07:00
Peter Hutterer 11f5bfbc09 evdev: prevent unterminated device name
The kernel copies up to sizeof(devname) bytes but doesn't null-terminate the
string if the device name exceeds the size of the supplied buffer.
2013-08-08 13:58:27 -07:00
Peter Hutterer 3ca59d3968 clients: fix an error message
_GNU_SOURCE is always true as of c228e23b05, so
program_invocation_short_name is available.
2013-08-08 13:46:14 -07:00
Peter Hutterer 96f0824892 tty: fix typo in error message 2013-08-08 13:46:14 -07:00