Commit Graph

3844 Commits

Author SHA1 Message Date
Ander Conselvan de Oliveira
41a50ea71c gl-renderer: Fix support for Y_XUXV buffers
Due to a copy and paste error, the pointer to the vertex shader source
was NULL and the program failed to link.
2013-11-27 22:49:31 -08:00
Tomeu Vizoso
0f0a6ffc2e Remove dependency on <GLES2/gl2.h> by replacing GLfloat with float 2013-11-27 22:49:31 -08:00
Emilio Pozuelo Monfort
eed9344430 exposay: properly go away when the modifier is pressed
We no longer receive an exposay_binding() call while exposay
is in-flight as we have grabbed the keyboard, so we need to
listen on the modifiers callback for the modifier press and
release.
2013-11-27 22:49:31 -08:00
Emilio Pozuelo Monfort
1539ea2f74 input: don't run modifier bindings when the kbd is grabbed
We don't want bindings to be run while the keyboard is grabbed.
Otherwise the binding handler may grab the keyboard too, making
the old grab go away without even being cancelled.
2013-11-27 22:49:31 -08:00
Pekka Paalanen
d5fbfb2e35 rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGL
The symbol is needed only for the EGL buffer path. If --disable-egl is
given to ./configure, there is no need for it, so fix it to actually not
look for that symbol needlessly.

This should fix the runtime error:

	Failed to load module: .../rpi-backend.so: undefined symbol:
	vc_dispmanx_set_wl_buffer_in_use

when you use --disable-egl and do not have a recent enough
libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide
vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of
userland yet provides this.

The calls are organized into two helper functions to avoid a boolean
argument, and put the #ifdefs away from the main parts of the code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>
2013-11-27 22:49:31 -08:00
Emilio Pozuelo Monfort
234c5242ab exposay: provide a cancel func to the ptr grab iface
Fixes a crash when cancel is called while exposay is in progress.
2013-11-27 22:49:31 -08:00
Neil Roberts
e3de16ea30 Automatically generate weston.ini with the right paths
Previously weston.ini had hardcoded paths for the weston-* clients in
/usr/bin and /usr/libexec. This was a bit annoying when testing Weston
because you wouldn't usually install those in the system prefix. This
patch adds a make rule to automatically generate weston.ini from a
template file with some replacement markers for the paths so that they
can have the right prefix.
2013-11-27 22:49:31 -08:00
Xiong Zhang
bf3c1c6913 distinguish touch screen and pointer dnd in client
Data device interface in client just handle with pointer's dnd.
If a touch screen trigger dnd, it will use pointer struct like i
nput->sx, input->sy, input->pointer_focus. So if pointer is moving
when touch screen trigeer a dnd, wrong behaviore will occur.
Before touch screen start dnd, system call touch_grab()
to mark the following drag and drop operation is generated by
touch screen.
Defined some common variables in struct input to track dnd.

Note, touch screen and pointer can't generate drag and drop at the
same time, becuae data device protocol can't identify the drag
and drop event is generated by touch screen or pointer.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 16:32:12 -08:00
Xiong Zhang
853a7799d6 client/dnd.c: add dnd support for touch screen in client
Adding the interface for touch screen event in clients/dnd.c, once
user touch down on this app, it will trigger a touch and drag
operation.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 16:32:08 -08:00
Xiong Zhang
fd51e7bb57 src/data_device.c: add dnd support for touch screen
Adding the drag and drop grab interface for touch screen in
src/data-device.c, so the server can handle touch screen
drag and drop operation.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 16:32:00 -08:00
Kristian Høgsberg
24fc228044 Makefile.am: The wayland rpi doesn't libsession-helper.la 2013-11-25 13:54:30 -08:00
Marco Barisione
12e750bbc4 Makefile.am: The rpi backend needs libsession-helper.la
Signed-off-by: Marco Barisione <marco.barisione@collabora.co.uk>
2013-11-25 11:38:50 -08:00
Xiong Zhang
49c6aeee70 terminal: add touch screen selection support
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 11:26:00 -08:00
Xiong Zhang
e955525f1a src/Makefile.am: correct compile failure for launcher-util.c
The following error message is generated during compile
In file included from launcher-util.c:43:0:
compositor.h:35:28: fatal error: wayland-server.h: No such file or directory
 #include <wayland-server.h>

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-11-25 10:59:01 -08:00
Kristian Høgsberg
1d781ee204 terminal: Update terminal->end whenever we write a character
We used to only update it on newline, which breaks when somebody moves
the cursor below terminal->end and writes stuff.  Instead update it whenever
we write a character to the terminal.

https://bugs.freedesktop.org/show_bug.cgi?id=71935
2013-11-24 17:01:26 -08:00
Kristian Høgsberg
989e9d582c Makefile.am: Move launcher helpers in to libsession-helper.la library 2013-11-24 15:16:23 -08:00
Kristian Høgsberg
02b36f3528 configure.ac: The drm backend no longer requires EGL
We can run with just the pixman renderer and 'dumb' kms buffers.
2013-11-24 15:16:23 -08:00
Kristian Høgsberg
d2c9d8af50 configure.ac: Make libdrm optional in weston-launch
If libdrm is available, weston-launch and launcer-util.c will support
getting the drm device and setting and dropping drm master, otherwise
we'll only support getting input devices.
2013-11-24 15:16:23 -08:00
Kristian Høgsberg
89eebb7ceb tests: Remove an unecessary Makefile.am variable 2013-11-23 12:59:27 -08:00
Kristian Høgsberg
9ab771d6d5 tests: Use a helper library for weston-test clients 2013-11-23 12:53:16 -08:00
Kristian Høgsberg
8e293a5adb tests: Use TEST_CLIENT for test client modules
We abused SIMPLE_CLIENT_LIBS before, but if you disable simple clients,
the test suite fails to link.  Use test client specific variables instead.

https://bugs.freedesktop.org/show_bug.cgi?id=71530
2013-11-23 12:40:34 -08:00
Kristian Høgsberg
dcfff55ef3 terminal: Init tab ruler after setting terminal->width
terminal_init_tabs() needs an accurate terminal->width to be able
to correctly initialize the tab ruler.
2013-11-22 22:43:20 -08:00
Kristian Høgsberg
ebd5fd4753 input: Cancel pointer grabs when compositor loses kb focus
This makes sure we pop down popups when the X backend loses keyboard
focus or when the kms backend vt-switches away.
2013-11-22 21:12:19 -08:00
Emilio Pozuelo Monfort
3d0fc76dd5 shell: don't crash if a pointer's focus is null
It's possible for a pointer's focus to be null, e.g. because
the focus surface has been bestroyed. Prevent a crash when
that happens and a client takes too long to respond to a ping.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-22 13:31:55 -08:00
Kristian Høgsberg
617e9a37f2 dnd: Simplify drag icon creation
We used to have to composite the pointer on top of the drag icon, but
the final protocol allows us to specify both a drag icon and a cursor.
Remove the complexity that dealt with that.
2013-11-22 11:59:40 -08:00
Giulio Camuffo
0d379744d3 compositor: set weston_surface:resource to NULL when destroyed
with the previous patch the resource isn't used inside weston_surface_destroy()
anymore (aside sending events unuseful for a closing client), so we can safely
reset it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-11-21 22:00:17 -08:00
Pekka Paalanen
b9eae3369b tests: .gitignore log files 2013-11-21 21:47:29 -08:00
Pekka Paalanen
f72e4797f4 tests: allow weston test plugin to keep on running
If the environment variable WESTON_TEST_CLIENT_PATH is not set, do not
quit Weston in the test plugin.

This allows one to start Weston with the test plugin manually, and then
run any tests also manually, while observing Weston's behaviour over
time. This is useful for:
- Running a test multiple times and checking if Weston leaks (e.g. with
  Valgrind)
- Running tests manually on a backend that is not x11 or wayland,
  especially the backends that require weston-launch, and therefore
  cannot be used with the 'make check' machinery.

This change should not affect 'make check' behaviour, because there
WESTON_TEST_CLIENT_PATH is always set.

Cc: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-21 21:47:28 -08:00
Pekka Paalanen
f812477fc0 tests: add a test causing SIGBUS to the compositor
This tests the wl_shm buffer access wrappers, that are supposed to catch
the invalid accesses to a memory-mapped file beyond EOF.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-21 21:47:19 -08:00
Emilio Pozuelo Monfort
bb835b419e man: document new focus-animation config entry 2013-11-21 21:35:28 -08:00
Emilio Pozuelo Monfort
46ce798d28 shell: add a client config entry 2013-11-21 21:35:17 -08:00
David Herrmann
fcb6bf43a4 logind: change to -1+errno
Set errno and return -1 in public API calls like all other weston code
does. Most systemd+dbus calls return negative error-codes instead of -1
and setting errno. Thus, we need to explicitly set errno before returning.

Also note that we must set errno _after_ the cleanup path. Calling
functions like close() in the cleanup path might overwrite errno (which is
not what we want). So protect errno until the final return -1;
2013-11-21 16:28:08 -08:00
Kristian Høgsberg
f86c39058a logind: Use dbus_bool_t for bool types in dbus calls
The gcc built-in 'bool' type is not the same size as dbus_bool_t, which is
an uint32_t.  Passing a pointer to bool where dbus expects a uint32_t *
doesn't work.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-21 10:45:41 -08:00
Giulio Camuffo
576fe2af4b input: set the focus to NULL when the focus's resource is destroyed
with the surface ref-count feature a surface may live on after its
resource was destroyed. so listen for the resource destroy signal
and set the focus to NULL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-20 16:59:00 -08:00
Kristian Høgsberg
8b66ebd3fa weston-info: Handle shm formats better
Use a switch for this and don't fall back to XRGB8888 if we don't
recognize the format.
2013-11-20 13:54:00 -08:00
Jason Ekstrand
399841dae7 Update the weston man page to include the new Wayland backend options
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-19 13:39:58 -08:00
Jason Ekstrand
3ec57f5d69 compositor-drm: Release the correct buffer in drm_output_release_fb 2013-11-19 13:25:10 -08:00
Jason Ekstrand
42133d47d3 input: Fix a segfault in focus checking
Without this, weston will segfault whenever the focus is a non-client
surface such as the black surface in fullscreen.
2013-11-19 13:23:40 -08:00
Ander Conselvan de Oliveira
895b1fdcb2 gl-renderer: Attach buffer during surface state creation if possible
When a renderer switch happens, it is possible that when the surface
state is created, a buffer for the given surface is already available.
In that case, run the attach routine so that the pixel contents are
properly set. Otherwise, it would only be set when a new attach request
is made for that surface.

Also, change the drm backend so that it keeps the buffer reference in
the weston_surface when running with the pixman renderer. The pixman
renderer keeps a reference to it anyway, so it is never released
early.

This makes the renderer transition seamless, without leaving a black
screen as before.
2013-11-19 13:11:25 -08:00
Ander Conselvan de Oliveira
65796816b9 compositor-drm: Add key binding to switch from pixman to GL renderer
When running with the pixman renderer, the debug binding 'W'
(mod-shift-space W) will cause the compositor to load gl-renderer.so
and start using it instead of the pixman renderer.
2013-11-19 13:11:20 -08:00
Pekka Paalanen
b188e912c3 compositor: fix sub-surface view stacking order
If you opened a window with sub-surfaces, and then raised another window
on top of that, the underlaying window's main surface was stacked
properly, but the sub-surfaces remained on top of the raised window.
IOW, the raised window was in between the other window and its
sub-surfaces.

This got broken in a7af70436b, "Split the
geometry information from weston_surface out into weston_view".

Fix the issues:

In view_list_add_subsurface_view(), the views need to be added to the
end of the list, not to the head. This alone fixes the above problem,
but causes the sub-surface views to be stacked irrespective of their
surface stacking order. The stacking order in this test case is fixed by
the changes to view_list_add(), but for sub-sub-surfaces a similar
change is needed in view_list_add_subsurface_view() too.

In view_list_add(), build the view list in the sub-surface stacking
order, instead of pulling the parent surface always on top. Also handle
the case, when the subsurface_list is completely empty: the parent
surface's view must still be added.

Reported-by: Julien Isorce <julien.isorce@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Jason Ekstrand <jason@jlekstrand.net>
2013-11-19 12:57:24 -08:00
Emilio Pozuelo Monfort
17467d602d exposay: move the pointer in our motion handler
This is necessary since commit 1959ab.
2013-11-19 11:52:12 -08:00
Emilio Pozuelo Monfort
da64426685 shell: Set output on the focus_surfaces' view
Otherwise we crash when animating the view.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:51 -08:00
Emilio Pozuelo Monfort
5c22ce652d exposay: Activate a surface when hovering it
This causes the surface to get the keyboard focus, which in turn
causes focus-animation to nicely work with exposay, making the
not focused surfaces to be dimmed.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:44 -08:00
Emilio Pozuelo Monfort
8224309f14 exposay: add cancel impl to the kbd grab iface
Otherwise we'll crash when cancel is called.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:26 -08:00
Emilio Pozuelo Monfort
03251b6a7a shell: Implement alt-tab switcher
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:51:18 -08:00
Emilio Pozuelo Monfort
aa7a4761f6 input: Don't send leave events to destroyed views
If a view which has focus is destroyed, we would send a leave
event while changing focus, causing a segfault. Prevent this
by listening to the view's destroy signal and removing it from
the pointer focus.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2013-11-19 11:49:40 -08:00
Daniel Stone
df8133b725 Add Exposay
Exposay provides window overview functions which, when a key which
produces the binding modifier is pressed on its own, scales all
currently-open windows down to be shown overlaid on the desktop,
providing keyboard and mouse navigation to be able to switch window
focus.

[pochu: rebased, ported to weston_view]
2013-11-19 11:49:33 -08:00
Daniel Stone
a67e6b9818 Add move/scale animation
Add an animation which moves a surface to a new location, at the same
time as also rescaling it to a different size from the origin, rather
than the existing scale animation which resizes from the centre.

[pochu: rebased, ported to weston_view]
2013-11-19 11:49:28 -08:00
Daniel Stone
96d47c0ef7 Add modifier-only binding
Add the ability to bind to modifiers; the binding is armed when a key
which sets the requested modifier is pressed, and triggered if the key
is released with no other keys having been pressed in the meantime, as
well as mouse buttons or scroll axes.

This only works for direct modifiers (e.g. Shift and Alt), not modifiers
which latch or lock.

[pochu: rebased]
2013-11-19 11:49:25 -08:00