Commit Graph

3709 Commits

Author SHA1 Message Date
Philip Withnall
f85fe84ec3 shell: Tidy up unset_fullscreen()
No functional changes, merely some presentational cleanup.
2013-12-02 11:44:50 -08:00
Philip Withnall
659163d25c shell: Refactor workspace code to operate on shsurfs rather than views
This is needed for the work to refactor window stacking and ordering, as
window order operates on shsurfs, not views.
2013-12-02 11:44:50 -08:00
Philip Withnall
352e7ed527 shell: Factor out common code to set a shsurf’s output 2013-12-02 11:44:50 -08:00
Philip Withnall
17c2fb4f29 clients: Add a new weston-stacking demo
This allows creation of a variety of window types, for the purposes of
testing window ordering and stacking in Weston.
2013-12-02 11:44:50 -08:00
Philip Withnall
c971d2a8b3 clients: Add window_is_transient() helper to the toy toolkit window 2013-12-02 11:44:50 -08:00
Philip Withnall
4a86a0a57b shell: Add missing cases to switch statements for animations and fading
This fixes two GCC warnings when compiling with -Wswitch-enum
-Wswitch-default, and makes it clearer that those cases have been
thought about explicitly when writing the code, rather than just being
forgotten.
2013-12-02 11:44:49 -08:00
Philip Withnall
0f640e219c shell: Add missing cases to switch statements for surface types
This fixes a load of GCC warnings when compiling with -Wswitch-enum
-Wswitch-default, and makes it clearer that those cases have been
thought about explicitly when writing the code, rather than just being
forgotten.
2013-12-02 11:44:49 -08:00
Philip Withnall
becb77e211 shell: Reorganise set/unset methods for fullscreen/maximize/popup/transient
Move them to be next to each other, and standardise the naming scheme so
they’re more greppable. This should make maintenance easier.
2013-12-02 11:44:49 -08:00
Xiong Zhang
becf5a342f src/shell.c: set black_surface->width and height
full screen black_surface doesn't have associated wl_buffer, so
black_surface->width and height can't get value through
weston_surface_commit(). then weston_surface_damage(black_surface)
will be wrong in shell_stack_fullscreen(), the result is that we
can't see a full screen view whe APP window's size isn't equal to
output's size like running weston-gears

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-12-02 11:44:49 -08:00
Tomeu Vizoso
e4f7b92204 rpi: Support opaque regions
This is needed for XWayland surfaces with alpha channel, as X will be
sending crap in there that should be discarded.

This is currently done with a copy in the compositor, while we wait for
support in the VideoCore side.
2013-12-02 11:36:29 -08:00
Pekka Paalanen
da75ee1de0 compositor: merge surface size from buffer size funcs
Replace the two functions getting the intended surface dimensions from
the surface's buffer and buffer transformation parameters by a single
function that just set the surface size according to all the buffer
state.

The old functions were always called in pairs, and always assigned to
the surface dimension variables.

This function also deals with a NULL buffer by setting the dimensions to
zero, just like the callers used to do.

The new function has no users outside this source file, so do not export
it. This basically unexports the old functions.
2013-11-28 14:14:10 -08:00
Pekka Paalanen
ba34165ce2 compositor: do not recompute size on pointer_set_cursor
This removes the calls to weston_surface_buffer_width/height() from
input.c, which are the last external calls to them.

Instead, use the cached values from weston_surface::width,height. These
have already been set by weston_surface_commit(), because that is the
only way a weston_surface can get a buffer.
2013-11-28 14:14:08 -08:00
Pekka Paalanen
1fd9c0f81a compositor: gather buffer_transform and _scale into a struct
Gather the variables affecting the coordinate transformations between
buffer and local coordinates into a new struct weston_buffer_viewport.

This will be more useful later, when the crop & scale extension is
implemented.
2013-11-28 14:14:05 -08:00
Axel Davy
40ee921fff Do not set output->current_mode in compositor.c
The field is already set - correctly - in the backend switch_mode.
setting output->current_mode to mode in compositor.c leads to bugs,
since mode can be freed by the shell.
For example, the shell allocates it on the stack for
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2013-11-27 22:56:43 -08:00
MoD
1b55a5918c compositor-x11: Allow r5g6b5 visuals for X11 backend SHM
The support is already present in the pixman renderer, so we can just
check and use it.
2013-11-27 22:49:31 -08:00
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