Commit Graph

1157 Commits

Author SHA1 Message Date
Kristian Høgsberg dade64968c Move wl_data_device implementation to wayland-server 2012-01-06 11:28:53 -05:00
Kristian Høgsberg faf1fee64f Move default grab implementation to wayland-server 2012-01-05 11:00:01 -05:00
Kristian Høgsberg 9ddb826077 Use new grab api 2012-01-05 11:00:01 -05:00
Rob Bradford 0b17b8ec01 compositor: Don't try and destroy old pointer surface if it empty
If attach was called on wl_input_device with a nil buffer twice then the
second call would cause a segfault.
2012-01-05 10:59:44 -05:00
Pekka Paalanen b07876d23a evdev: warn about missing input devices
Usually there should be at least one input device, when Weston starts
up, or is reactivated by a VT switch. Add a nice warning, in case there
are no input devices.

This is to give a clue to users who happen to try Weston on DRM, and
do not get any response.

Add also a message to another failure case, that may lead to missing
input devices.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-05 16:50:00 +02:00
Pekka Paalanen c0444e3ad6 compositor: force fade-in on start
Weston initialises to faded-out state, which means all outputs are just
black, even if they render fine.

Previously the fade-in was triggered probably by some random input
event, since Weston was not guaranteed to wake up. Especially with the
drm backend, and the usual problem of not having permissions to input
devices, Weston would not fade in at all and appear broken.

Force Weston to fade in right after initialisation. This show that at
least rendering works, if it does not respond to any input.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-05 16:49:54 +02:00
Pekka Paalanen 61b5c67268 shell: free memory on move/resize error paths
Memory leaks noticed by Valgrind, when wl_input_device_update_grab()
fails.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-05 09:10:49 +02:00
Kristian Høgsberg 8600040236 compositor-x11: Just a few more weston renames 2012-01-03 23:24:14 -05:00
Kristian Høgsberg e7126ef537 x11: Dont claim the X11 selection when we set the proxy Wayland selection 2012-01-03 23:01:47 -05:00
Kristian Høgsberg a33d0c38d2 data-device: Use a listener list to decouple the x11 selection bridge 2012-01-03 23:01:47 -05:00
Kristian Høgsberg f9b0844e59 x11: Initialize wm->incr when converting the TARGETS target 2012-01-03 23:01:47 -05:00
Kristian Høgsberg 300deba3be x11: Handle non-existing properties correctly
Don't try to read out ATOM or WINDOW values if there is no such property.
2012-01-03 23:01:40 -05:00
Kristian Høgsberg db9bf1e818 data-device: Fix a few bugs in the commit to drop ref-counting
Did not test that change.
2012-01-03 22:43:36 -05:00
Kristian Høgsberg 9724b51750 More weston rename fixes 2012-01-03 14:35:49 -05:00
Kristian Høgsberg 82d9ee929b data-device: Handle source going away instead of ref-counting it
We have to deal with the data source going away.  Even if we have a
reference to the server side data source, we can't do anything if the
client that provided the source went away.  So just NULL the offers
source pointer in the destroy callback for the source.
2012-01-03 14:11:18 -05:00
Kristian Høgsberg cb78447a0e Fix a few missing wlsc->weston renames 2012-01-03 11:40:25 -05:00
Kristian Høgsberg 3466bc8042 Merge remote-tracking branch 'pq/compositor-dtors-v1'
This collided with the big weston rename, but git did a good job of fixing
most cases.

Conflicts:
	compositor/compositor.h
	src/compositor-x11.c
	src/compositor.c
	src/screenshooter.c
	src/util.c
2012-01-03 11:36:37 -05:00
Kristian Høgsberg f6a5f7def3 Fix distcheck 2012-01-03 11:04:09 -05:00
Kristian Høgsberg 8334bc1ef9 Rename wayland-compositor to weston
This rename addresses a few problems around the split between core
Wayland and the wayland-demos repository.

1) Initially, we had one big repository with protocol code, sample
compositor and sample clients.  We split that repository to make it
possible to implement the protocol without pulling in the sample/demo
code.  At this point, the compositor is more than just a "demo" and
wayland-demos doesn't send the right message.  The sample compositor
is a useful, self-contained project in it's own right, and we want to
move away from the "demos" label.

2) Another problem is that the wayland-demos compositor is often
called "the wayland compsitor", but it's really just one possible
compositor.  Existing X11 compositors are expected to add Wayland
support and then gradually phase out/modularize the X11 support, for
example.  Conversely, it's hard to talk about the wayland-demos
compositor specifically as opposed to, eg, the wayland protocol or a
wayland compositor in general.

We are also renaming the repo to weston, and the compositor
subdirectory to src/, to emphasize that the main "output" is the
compositor.
2012-01-03 11:04:04 -05:00
Pekka Paalanen 43c61d8373 compositor-x11: improve x11_destroy()
Free many things we were leaking before:
- input device
- EGL resources
- xcb event source
- X Display

Fixes lots of Valgrind leaks.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 16:16:28 +02:00
Pekka Paalanen 2de99e2070 compositor-x11: implement x11_output_destroy()
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 16:16:28 +02:00
Pekka Paalanen 2da6d5f76f compositor: fix use after free in wlsc_zoom_frame
Add the missing return statement, so the destroyed zoom object is not
used.

Found by Valgrind.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 16:16:28 +02:00
Pekka Paalanen 35ce06d4ae compositor: add screenshooter destructor
Nothing was freeing the allocation from screenshooter_create().

Add enough boilerplate, that we can free it. Fixes a Valgrind leak.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 11:48:08 +02:00
Pekka Paalanen c069dd548f compositor: remove unused member from wlsc_input_device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:51:54 +02:00
Pekka Paalanen 402ae6d6c2 compositor: free region members on surface destroy
The two pixman regions of struct wlsc_surface were not being freed
properly.

Fixes some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:51:54 +02:00
Pekka Paalanen 07753fbe9c compositor: add wlsc_input_device_fini()
Add a function for destroying all objects allocated in
wlsc_input_device_init().

This patch depends on "server: add wl_input_device_fini()" commit in the
Wayland core.

Compositor backends could now call wlsc_input_device_fini() to fix some
memory leaks.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:51:54 +02:00
Pekka Paalanen d1591ae3cc compositor: more cleanup on shutdown
Free idle_source, shm, and vertices and indices arrays on compositor
shutdown.

Fixes some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:48:54 +02:00
Pekka Paalanen 51c769f32e compositor: clean up signal event sources on exit
Fixes some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:48:54 +02:00
Pekka Paalanen 0135abee89 compositor: avoid scheduling rendering on shutdown
After the compositor exits the main loop in wl_display_run(), set the
compositor state to SLEEPING. This prevents scheduling repaints, that
will never be executed.

A repaint is scheduled by calling wl_event_loop_add_idle(), which
creates an idle event source. Normally the idle event source object is
destroyed after it has been executed. However, in the shutdown case we
never dispatch events again, and the object is leaked.

This leak is triggered by shell.c destructor, which destroys the
desktop-shell client. Destroying a client ends up calling
wlsc_compositor_schedule_repaint() while destroying the client
resources, especially surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 10:48:54 +02:00
Pekka Paalanen 9cf5cc882d shell: destroy desktop_shell client on exit
If the compositor is shutting down while the desktop_shell still exists,
we leaked some resources by not destroying the client record.

Call wl_client_destroy() on the desktop_shell client, if it exists
during shutdown. Fixes some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-02 16:00:24 +02:00
Pekka Paalanen 4738f3b1ea compositor: destroy all input binding objects on shutdown
wlsc_binding_destroy() was not being called at all. Fix the leaks by
introducing a function that destroys a whole list of bindings, instead
of individually saving an extra pointer to the binding object and
calling wlsc_binding_destroy() separately on each.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-02 15:47:07 +02:00
Pekka Paalanen cc9102edc5 compositor: free regions in wlsc_output_repaint()
Some of the local pixman region objects were not being properly
destroyed before returning from the function. Destroy them, fixes
some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-02 15:42:44 +02:00
Pekka Paalanen 3c64723c9f compositor: add destructors to shell plugins
Add a new wlsc_shell API function for destroying the shell plugin
object. Helps to reduce Valgrind reports.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-02 15:40:56 +02:00
Kristian Høgsberg 4c61747a1f x11: Clear X11 selection when we can't bridge the data type 2011-12-29 14:16:42 -05:00
Kristian Høgsberg f258a310bf Fix WL_EVENT_WRITEABLE typo 2011-12-28 22:51:20 -05:00
Kristian Høgsberg 33f8670ee2 x11: Bridge Wayland selections to X11 CLIPBOARD selection
This is the other direction.  The selection bridge will grab the X11
CLIPBOARD selection on behalf of the Wayland client when it sets the
Wayland selection.  Right now only UTF-8 text is supported, but the
data types offered will be taken from the Wayland data source.
2011-12-28 22:42:09 -05:00
Kristian Høgsberg 727bacdddf terminal: Don't close fd twice 2011-12-28 22:04:27 -05:00
Kristian Høgsberg 0050fd7d8b x11: Handle BadWindow errors 2011-12-27 23:01:23 -05:00
Kristian Høgsberg facb558448 x11: Remove destroy listener when X11 window is destroyed 2011-12-27 22:47:51 -05:00
Kristian Høgsberg a42c128201 x11: Store interesting window properties, dump a few more things 2011-12-27 21:36:41 -05:00
Kristian Høgsberg 94110f7bb8 x11: Improvide debugging output a bit 2011-12-27 20:20:46 -05:00
Kristian Høgsberg 8b316f0255 x11: Remove a couple of done TODOs 2011-12-27 14:05:36 -05:00
Kristian Høgsberg 11d0512ce9 compositor: Pull in hash table from protocol
We use it in the X WM implementation, but we don't want it in the core
libraries.
2011-12-27 14:02:40 -05:00
Kristian Høgsberg e7aaec301a x11: Bridge X11 CLIPBOARD selection to Wayland clients 2011-12-27 13:50:04 -05:00
Kristian Høgsberg 09e2692403 compositor-x11: Use ARRAY_LENGTH macro from wayland-util.h 2011-12-23 13:33:45 -05:00
Kristian Høgsberg 03cb5cf9a7 compositor: Handle disappearing surfaces and input devices for touch 2011-12-22 14:47:44 -05:00
Kristian Høgsberg 558949b67b clients: Add simple-touch client for testing touch events. 2011-12-22 13:45:50 -05:00
Kristian Høgsberg 3937354eef evdev: Store positions for all touch points in the evdev device
We need to store all touchpoint positions so that if we just get an
ABS_MT_POSITION_X or Y event, we can pull the other coordinate from the
cache.  And we need this across invocations of evdev_input_device_data(),
so the accumulator approach doesn't work.

Instead, we go back to the approach of storing all this state in the
evdev device struct and we might as well just move the rel and abs state
there too.
2011-12-22 11:32:39 -05:00
Kristian Høgsberg 3543ff4f82 compositor: Send touch_up before clearing touch focus
Otherwise it never gets sent.
2011-12-22 11:32:39 -05:00
Kristian Høgsberg e04ad57a01 window.c: Add touch event stubs
Prevent window.c clients from crashing on touch events.
2011-12-22 11:32:38 -05:00