profile/ivi/weston.git
11 years agocompositor-drm: remove a stale comment
Pekka Paalanen [Wed, 24 Oct 2012 06:43:09 +0000 (09:43 +0300)]
compositor-drm: remove a stale comment

This comment became stale in:

commit 65a11e1039e7ea429ff26bdd0058bdf0efd1df2d
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Fri Aug 3 11:30:18 2012 -0400

    compositor: Accumulate damage per plane

Now it is just misleading. Remove it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agodesktop-shell: background should be opaque
Pekka Paalanen [Wed, 24 Oct 2012 06:43:08 +0000 (09:43 +0300)]
desktop-shell: background should be opaque

Toytoolkit does not support setting opaqueness for anything else than
the immediate child widget of the frame widget. Backgrounds do not have
frames, so we need to poke it in manually.

This should allow Weston to paint the background without blending.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: remove window_set_transparent() declaration
Pekka Paalanen [Wed, 24 Oct 2012 06:43:07 +0000 (09:43 +0300)]
window: remove window_set_transparent() declaration

The function is not implemented.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agogles2: check eglBindWaylandDisplayWL return value
Pekka Paalanen [Wed, 24 Oct 2012 06:43:06 +0000 (09:43 +0300)]
gles2: check eglBindWaylandDisplayWL return value

If the bind fails, do not bother pretending the EGL Wayland extension
is usable, and no need to unbind, either.

Print some important details about the GLESv2 renderer configuration
into the log.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agogles2: log EGL config info
Pekka Paalanen [Wed, 24 Oct 2012 06:43:05 +0000 (09:43 +0300)]
gles2: log EGL config info

Interesting in new environments.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: Clip pointer coordinates on pointer enter as well
Kristian Høgsberg [Tue, 23 Oct 2012 17:04:09 +0000 (13:04 -0400)]
compositor: Clip pointer coordinates on pointer enter as well

When tiling window managers resize a non-resizable window they're violating
ICCCM.  Not some hippie-community standard like EWMH, but ICCCM, which is
about as old and sacred as the constitution.  If they want to force a window
to be a size it wasn't designed for, at least they could have the decency to
reparent the client window into a bigger containing window of whatever size
they think it should be.  But apparently ICCCM compliance is too much to ask.

Anyway, all that just to say that it's really not our fault when we get an
enter event with coordinates outside the valid output region.  But we'll
clip it anyway and work around mis-behaving tiling WMs.

11 years agoconfigure.ac: Bump version to 1.0.0
Kristian Høgsberg [Mon, 22 Oct 2012 22:50:03 +0000 (18:50 -0400)]
configure.ac: Bump version to 1.0.0

11 years agotest-client: Make sure we process pending eevents before we verify state
Kristian Høgsberg [Mon, 22 Oct 2012 02:30:26 +0000 (22:30 -0400)]
test-client: Make sure we process pending eevents before we verify state

Since the send-button-state request comes in on one socket and the
wayland event we're looking for comes in on another socket, the order
that we process the two in is undefined.  Thus, button-test fails
intermittently, depending on which event we process first.

We change wl_display_flush() to wl_display_roundtrip(), to make sure that
we deal with all wayland events before handling test protocol requests.

11 years agocompositor-drm: Disable hw cursor if allocation fails
Kristian Høgsberg [Sun, 21 Oct 2012 17:29:26 +0000 (13:29 -0400)]
compositor-drm: Disable hw cursor if allocation fails

Instead of crashing later, we can just fall back to gl rendered cursors.

11 years agoDefine our own container_of as well
Kristian Høgsberg [Sat, 20 Oct 2012 03:05:37 +0000 (23:05 -0400)]
Define our own container_of as well

Don't rely on libwayland-client/server to define this for us.

11 years agoStop relying on ARRAY_LENGTH being defined in wayland-util.h
Kristian Høgsberg [Fri, 19 Oct 2012 21:12:38 +0000 (17:12 -0400)]
Stop relying on ARRAY_LENGTH being defined in wayland-util.h

Time to break a bad habit.

11 years agowindow: Always pass focused widget to widget motion handlers
Jonas Ådahl [Fri, 19 Oct 2012 17:56:02 +0000 (19:56 +0200)]
window: Always pass focused widget to widget motion handlers

Grabbed widgets should always receive motion events as if it was the
widget that would receive it if no grab was active. This means that the
focused widget should always be passed as the widget argument to widget
motion handlers.

This reverts commit 8c9c8fcf6e294f0446446d8e9bdfeb37294743c3.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agowindow: Don't set pointer image when requesting to move a surface
Jonas Ådahl [Fri, 19 Oct 2012 06:23:57 +0000 (08:23 +0200)]
window: Don't set pointer image when requesting to move a surface

Since it's the server who moves the surface it's the server who sets the
pointer image.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agosimple-shm: Don't use ret variable in main() uninitialized
Ander Conselvan de Oliveira [Wed, 17 Oct 2012 10:49:08 +0000 (13:49 +0300)]
simple-shm: Don't use ret variable in main() uninitialized

11 years agoclients: Don't ask for EGL_PIXMAP_BIT when choosing configs
Kristian Høgsberg [Tue, 16 Oct 2012 19:31:31 +0000 (15:31 -0400)]
clients: Don't ask for EGL_PIXMAP_BIT when choosing configs

11 years agoclients: Check return value of wl_display_dispatch()
Kristian Høgsberg [Tue, 16 Oct 2012 17:16:10 +0000 (13:16 -0400)]
clients: Check return value of wl_display_dispatch()

The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value.  Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.

11 years agoutil: Check result of weston_surface_animation_run.
John Kåre Alsaker [Fri, 12 Oct 2012 10:32:03 +0000 (12:32 +0200)]
util: Check result of weston_surface_animation_run.

11 years agocompositor-x11: Fix a memory leak.
John Kåre Alsaker [Fri, 12 Oct 2012 10:25:11 +0000 (12:25 +0200)]
compositor-x11: Fix a memory leak.

11 years agocompositor: Check if surface creation failed in weston_compositor_fade.
John Kåre Alsaker [Fri, 12 Oct 2012 10:25:09 +0000 (12:25 +0200)]
compositor: Check if surface creation failed in weston_compositor_fade.

11 years agocompositor-x11: Clean up event handling.
John Kåre Alsaker [Fri, 12 Oct 2012 10:25:07 +0000 (12:25 +0200)]
compositor-x11: Clean up event handling.

11 years agoRemove some dead code.
John Kåre Alsaker [Fri, 12 Oct 2012 10:25:06 +0000 (12:25 +0200)]
Remove some dead code.

11 years agoweston-launch: Check result of pam_start.
John Kåre Alsaker [Fri, 12 Oct 2012 10:25:05 +0000 (12:25 +0200)]
weston-launch: Check result of pam_start.

11 years agoconfigure: build tablet-shell client conditionally
Pekka Paalanen [Tue, 16 Oct 2012 14:27:22 +0000 (17:27 +0300)]
configure: build tablet-shell client conditionally

Do not build the tablet-shell client if --disable-tablet-shell is given.

Change --enable-tablet-shell to --disable-tablet-shell in ./configure
--help output, since it is enabled by default. Add a description.

Use proper quoting in the conditional.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agosimple-touch: do not include GL headers
Pekka Paalanen [Tue, 16 Oct 2012 14:27:21 +0000 (17:27 +0300)]
simple-touch: do not include GL headers

since it doesn't use any of them. Fixes a build failure on systems,
where (E)GL headers are in non-standard path.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoconfigure: separate simple EGL clients from others
Pekka Paalanen [Tue, 16 Oct 2012 14:27:20 +0000 (17:27 +0300)]
configure: separate simple EGL clients from others

Separate simple EGL clients from other simple clients. This allows to
build either simple-shm or simple-egl, whichever you want. We avoid
linking libEGL and GLESv2 into simple-shm, and we can build simple-shm
even if nothing provides EGL, GLESv2, or wayland-egl APIs.

Change the options in configure --help from --enable to --disable, since
these are enabled by default, and you would normally only ever give the
--disable flavor. Add descriptions.

Remove the #define BUILD_SIMPLE_CLIENTS since it is not used.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotoytoolkit: make all EGL code dependant on cairo-egl
Pekka Paalanen [Tue, 16 Oct 2012 14:27:19 +0000 (17:27 +0300)]
toytoolkit: make all EGL code dependant on cairo-egl

configure.ac: The toytoolkit clients used to get libEGL linked to them
even if there was no cairo-egl. This is useless, and actually harmful on
platforms, where libEGL absolutely requires one of the GL ES libraries
to be linked in, too.

Look for EGL-related packages only for cairo-egl with toytoolkit.

window.c: protect all GL header includes with HAVE_CAIRO_EGL, since that
is the only case we can support EGL, GL, or GLESv2 at all. In the case
we do not have cairo-egl, add enough definitions to let us build the
stubs for EGL-related functions.

Remove some #ifdefs that were inside of the same #ifdef already.

These changes allow to build sorfware rendering toytoolkit clients
without any bits of EGL libs or headers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoconfigure: fix --without-cairo-glesv2
Pekka Paalanen [Tue, 16 Oct 2012 14:27:18 +0000 (17:27 +0300)]
configure: fix --without-cairo-glesv2

Make it do what you would think it does, instead of enabling GLESv2.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoconfigure: tell why cairo-egl could not be used
Pekka Paalanen [Tue, 16 Oct 2012 14:27:17 +0000 (17:27 +0300)]
configure: tell why cairo-egl could not be used

Otherwise the user has no indication which package is missing for
CAIRO_EGL, and has to dig into config.log for it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: remove dead EGL code
Pekka Paalanen [Tue, 16 Oct 2012 14:27:16 +0000 (17:27 +0300)]
window: remove dead EGL code

- remove unimplemented function from header
- remove the egl function pointers that were not used

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoevdev: Update axis notifications to follow protocol
Jonas Ådahl [Wed, 3 Oct 2012 20:56:58 +0000 (22:56 +0200)]
evdev: Update axis notifications to follow protocol

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoconfigure.ac: Bump version to 0.99.0
Kristian Høgsberg [Tue, 16 Oct 2012 01:49:23 +0000 (21:49 -0400)]
configure.ac: Bump version to 0.99.0

11 years agoMake distcheck pass
Kristian Høgsberg [Tue, 16 Oct 2012 01:10:10 +0000 (21:10 -0400)]
Make distcheck pass

11 years agocompositor: Call into grab handler for touch events
Matt Roper [Wed, 10 Oct 2012 23:56:53 +0000 (16:56 -0700)]
compositor: Call into grab handler for touch events

Rather than delivering touch events directly to clients, we'll now
call through the touch grab handler.  The default handler (in
wayland-server) will deliver these events the same way they worked
before.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
11 years agowindow: Set input region also when we go fullscreen
Kristian Høgsberg [Mon, 15 Oct 2012 19:01:24 +0000 (15:01 -0400)]
window: Set input region also when we go fullscreen

We used to rely on the compositor resetting this as a side effect of
changing size, but it doesn't work like that any more.

11 years agoclients: image: Add support for panning and zooming
Jonas Ådahl [Thu, 27 Sep 2012 16:40:46 +0000 (18:40 +0200)]
clients: image: Add support for panning and zooming

Support for zooming by using ctrl + the vertical axis (scrolling upwards
zooms in) and panning by both the horizontal and vertical axis as well
as click and drag was added to demonstrate how axis should work.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agowindow: Update modifier state directly after receiving a modifier event
Jonas Ådahl [Thu, 27 Sep 2012 16:40:45 +0000 (18:40 +0200)]
window: Update modifier state directly after receiving a modifier event

If the keyboard modifier event was received after the key event the
modifier state would end up incorrect.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoevdev-touchpad: Implement two finger scroll
Jonas Ådahl [Thu, 27 Sep 2012 16:40:43 +0000 (18:40 +0200)]
evdev-touchpad: Implement two finger scroll

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoshell: Update bindings to conform to pointer axis protocol
Jonas Ådahl [Thu, 27 Sep 2012 16:40:42 +0000 (18:40 +0200)]
shell: Update bindings to conform to pointer axis protocol

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agocompositor-x11: Update axis notifications to follow protocol
Jonas Ådahl [Thu, 27 Sep 2012 16:40:41 +0000 (18:40 +0200)]
compositor-x11: Update axis notifications to follow protocol

Axis events are in the same coordinate space as motion events, thus
measured in pixels. To emulate axis events for discrete events move the
axis by a number of pixels every step.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoevdev-touchpad: Add a finite-state machine
Jonas Ådahl [Thu, 27 Sep 2012 16:40:40 +0000 (18:40 +0200)]
evdev-touchpad: Add a finite-state machine

The finite-state machine is so far used to implement support for tapping
and dragging.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoevdev-touchpad: Cleanup and refactoring
Jonas Ådahl [Thu, 27 Sep 2012 16:40:39 +0000 (18:40 +0200)]
evdev-touchpad: Cleanup and refactoring

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agowindow: don't call output configure uninitialised
Pekka Paalanen [Mon, 15 Oct 2012 09:06:53 +0000 (12:06 +0300)]
window: don't call output configure uninitialised

Callbacks registered via display_set_output_configure_handler() are
promised to be called when we know the current mode for the output. If
the following order of events happens:
1. toytoolkit binds to a wl_output global
2. application registers an output configure handler
3. the wl_output.mode events are received

Then in step 2 we would call the callback with uninitialised output
informations, giving it a 0x0 size.

To avoid such race, do not call the callback from
display_set_output_configure_handler() if the output has 0x0 size.

The wl_output.mode event will be received later, and that will trigger
the right call to the callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoclients: Use wl_display_dispatch_pending()
Kristian Høgsberg [Mon, 15 Oct 2012 16:56:11 +0000 (12:56 -0400)]
clients: Use wl_display_dispatch_pending()

11 years agotests: Update tests to new APIs
Kristian Høgsberg [Thu, 11 Oct 2012 14:07:31 +0000 (10:07 -0400)]
tests: Update tests to new APIs

11 years agocompositor: Unmap drag icon surface when its released
Ander Conselvan de Oliveira [Thu, 11 Oct 2012 11:06:19 +0000 (14:06 +0300)]
compositor: Unmap drag icon surface when its released

libwayland-server was changed to emit the new drag icon signal instead
of faking an attach event with a NULL buffer so this has to be done on
this side.

11 years agocompositor: fix event-test
Pekka Paalanen [Wed, 10 Oct 2012 09:49:32 +0000 (12:49 +0300)]
compositor: fix event-test

event-test assumes, that even without the very first wl_surface.attach
(and commit), the surface will have infinite (previously undef) input
region. event-test simply has test-client to create a wl_surface, and
then it forcefully sets its position and size, and assumes the input
region is now the full surface, so that notify_motion() will hit it.

Change Weston to initialize the input region to infinite, instead of
empty.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor, clients: apply wl_surface.frame on commit
Pekka Paalanen [Wed, 10 Oct 2012 09:49:31 +0000 (12:49 +0300)]
compositor, clients: apply wl_surface.frame on commit

Apply wl_surface.frame request only on the next wl_surface.commit
according to the new protocol.

This makes it explicit, which repaint actually triggered the frame
callback, since commit schedules a repaint. Otherwise, something causing
a repaint before a commit could trigger the frame callback too early.

Ensure all demo clients send commit after wl_surface.frame. Note, that
GL apps rely on eglSwapBuffers() sending commit. In toytoolkit, it is
assumed that window_flush() always does a commit.

compositor-wayland assumes renderer->repaint_output does a commit.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: fix surface pointer cast
Pekka Paalanen [Wed, 10 Oct 2012 09:49:30 +0000 (12:49 +0300)]
compositor: fix surface pointer cast

In weston, the wl_resource:data field for a wl_surface object always
contains struct weston_surface *, never struct wl_surface *.

Even though this is just a cosmetic fix, it should reduce confusion.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoshell: do not double-init input region
Pekka Paalanen [Wed, 10 Oct 2012 09:49:29 +0000 (12:49 +0300)]
shell: do not double-init input region

weston_surface_create() already inits the input region.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor, clients: double-buffer input region
Pekka Paalanen [Wed, 10 Oct 2012 09:49:28 +0000 (12:49 +0300)]
compositor, clients: double-buffer input region

Make input region double-buffered as specified in the new protocol.

While doing it, get rid of the undef region code, and instead use a
maximum sized real pixman region. This avoids special-casing regions
that might sometimes be undef.

As the input region is now usable by default instead of undef,
weston_surface_update_transform() does not need to reset the input
region anymore.

weston_surface_attach() no longer resets the input region on surface
size change. Therefore, also weston_seat_update_drag_surface() does not
need to reset it.

Update toytoolkit to set input region before calling wl_surface_commit()
or swapBuffers (which does commit).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor, clients: double-buffer opaque region
Pekka Paalanen [Wed, 10 Oct 2012 09:49:27 +0000 (12:49 +0300)]
compositor, clients: double-buffer opaque region

Make wl_surface.set_opaque_region double-buffered as required by the new
protocol. Also, do not reset the opaque region on surface size changes
anymore. Only explicit requests from the client will change the region
now.

In clients, make sure commit happens after setting the opaque region.

Mesa does not need a fix, as it never touches the opaque region.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoshell: do not double-init a region
Pekka Paalanen [Wed, 10 Oct 2012 09:49:26 +0000 (12:49 +0300)]
shell: do not double-init a region

weston_surface_create() already inits the opaque region, so the second
init in create_black_surface() is logically wrong. Whether this was a
memory leak or not, depends on Pixman internals.

Fini before initing again.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor, clients: make damage double-buffered
Pekka Paalanen [Wed, 10 Oct 2012 09:49:25 +0000 (12:49 +0300)]
compositor, clients: make damage double-buffered

This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Implement double-buffering of damage in the compositor as required by
the new protocol.

Ensure all Weston demo clients call wl_surface_commit() after
wl_surface_damage().

Mesa does not need a fix for this, as the patch adding
wl_surface_commit() call to Mesa already takes care of damage, too;
Mesa commit: "wayland: use wl_surface_commit()"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoclients: use wl_surface_commit
Pekka Paalanen [Wed, 10 Oct 2012 09:49:24 +0000 (12:49 +0300)]
clients: use wl_surface_commit

Use wl_surface_commit() to commit the buffer attach, as Weston now
requires.

NOTE: GL-applications are broken until you upgrade to a version of Mesa
which does wl_surface_commit() on eglSwapBuffers(). If you have
Cairo-gl, this means all toytoolkit apps, too.

simple-shm and simple-touch OTOH will work now.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: make wl_surface.attach double-buffered
Pekka Paalanen [Wed, 10 Oct 2012 09:49:23 +0000 (12:49 +0300)]
compositor: make wl_surface.attach double-buffered

This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Clients are now required to issue wl_surface.commit for the
wl_surface.attach to take effect.

While changing this, change the surface argument to
weston_surface_attach() from wl_surface into weston_surface, for
consistency.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoUpdate to new fd and wl_registry APIs
Kristian Høgsberg [Thu, 11 Oct 2012 01:34:26 +0000 (21:34 -0400)]
Update to new fd and wl_registry APIs

This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.

11 years agotoytoolkit: Take into account transform when sending output allocation.
Scott Moreau [Sat, 29 Sep 2012 08:03:11 +0000 (02:03 -0600)]
toytoolkit: Take into account transform when sending output allocation.

11 years agoterminal: Don't snap resize if we're maximized
Kristian Høgsberg [Wed, 10 Oct 2012 15:41:21 +0000 (11:41 -0400)]
terminal: Don't snap resize if we're maximized

We allow fullscreen to fill the requested size, do the same for maximize.

11 years agoterminal: Use window_get_fullscreen() instead of tracking that state manually
Kristian Høgsberg [Wed, 10 Oct 2012 15:37:46 +0000 (11:37 -0400)]
terminal: Use window_get_fullscreen() instead of tracking that state manually

11 years agowindow: Add getters for fullscreen and maximized state
Kristian Høgsberg [Wed, 10 Oct 2012 15:36:24 +0000 (11:36 -0400)]
window: Add getters for fullscreen and maximized state

This lets us eliminate a bit of redundancy in the clienst where they track
fullscreen state themselves.

11 years agotoytoolkit: Don't draw shadows for maximized windows.
Scott Moreau [Fri, 28 Sep 2012 08:45:06 +0000 (02:45 -0600)]
toytoolkit: Don't draw shadows for maximized windows.

Add THEME_FRAME_MAXIMIZED flag so the theming system can know not to draw
shadows for maximized windows. This allows maximized surfaces' content to be
sized and placed in a more expectable fashion.

11 years agocompositor-wayland: Use some nicer border sizes.
John Kåre Alsaker [Thu, 4 Oct 2012 18:42:17 +0000 (20:42 +0200)]
compositor-wayland: Use some nicer border sizes.

11 years agocompositor-wayland: Make sure border fields are set before wayland_compositor_create_...
John Kåre Alsaker [Thu, 4 Oct 2012 18:42:16 +0000 (20:42 +0200)]
compositor-wayland: Make sure border fields are set before wayland_compositor_create_output and document some function dependencies.

11 years agoclients: Set title for all shell surface demos.
Scott Moreau [Sun, 7 Oct 2012 14:56:30 +0000 (08:56 -0600)]
clients: Set title for all shell surface demos.

11 years agoshell: restore correct layer in shell_unset_fullscreen
Rafal Mielniczuk [Sun, 7 Oct 2012 18:25:36 +0000 (20:25 +0200)]
shell: restore correct layer in shell_unset_fullscreen

This fixes the bug where surface is above panel_layer
just after it is restored from fullscreen mode.

How to reproduce:
* move surface under panel
* set surface fullscreen
* restore surface to normal mode

11 years agobacklight: Jump to cleanup code if synthesizing backlight string fails
Rob Bradford [Tue, 9 Oct 2012 17:44:36 +0000 (18:44 +0100)]
backlight: Jump to cleanup code if synthesizing backlight string fails

This applies the same pattern as used in other error cases in this block - and
cleans up the file desciptors and allocated memory too.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agocompositor-drm: Avoid leak during output configuration error path
Rob Bradford [Tue, 9 Oct 2012 17:44:35 +0000 (18:44 +0100)]
compositor-drm: Avoid leak during output configuration error path

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agokeyboard: Avoid access beyond end off buffer
Rob Bradford [Tue, 9 Oct 2012 17:44:34 +0000 (18:44 +0100)]
keyboard: Avoid access beyond end off buffer

If the for loop does not match on a button it will fall through and try and
dereference into the array using the terminating value of the loop. This
terminating value of the loop is the dimension of the array and thus beyond
its bounds.

Cc: Jan Arne Petersen <jpetersen@openismus.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agobacklight: Avoid buffer overflow in the use of readlink
Rob Bradford [Tue, 9 Oct 2012 17:44:33 +0000 (18:44 +0100)]
backlight: Avoid buffer overflow in the use of readlink

readlink() returns the number of bytes that it has written excluding any NUL
byte (since it does not write that itself.) This could lead to attempting to
access beyond the end of buffer if the destination of the link is exactly 100
bytes long. The standard solution to this is to subtract one from the buffer
when passing it into readlink().

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agoevdev-touchpad: Iterate over the touchpad spec table correctly
Rob Bradford [Tue, 9 Oct 2012 17:44:32 +0000 (18:44 +0100)]
evdev-touchpad: Iterate over the touchpad spec table correctly

The original code would overrun since the calculation of the range did not
take into consideration the size of the entries in the table.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agoevdev: Avoid unintended case drop through
Rob Bradford [Tue, 9 Oct 2012 17:44:31 +0000 (18:44 +0100)]
evdev: Avoid unintended case drop through

e->code is in the same range for ABS_ and for REL_. As the code currently
stands and for the current values in Linux's input.h there is no risk of a
problem. However just in case it would be wise to break after evaluating the
relative events.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agotty: Log error if we cannot setup a valid tty keyboard mode
Rob Bradford [Tue, 9 Oct 2012 17:44:30 +0000 (18:44 +0100)]
tty: Log error if we cannot setup a valid tty keyboard mode

The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agoevdev-touchpad: Twiddle finger_state correctly
Rob Bradford [Tue, 9 Oct 2012 17:44:29 +0000 (18:44 +0100)]
evdev-touchpad: Twiddle finger_state correctly

The original code always set the finger_state to the appropriate bitmask
irrespective of whether the event was a press or a release. It would also blat
all members of the bitmask rather than ORing in the new bit for the event.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agowindow: Initialize workspace state before first roundtrip
Jonas Ådahl [Mon, 8 Oct 2012 20:49:04 +0000 (22:49 +0200)]
window: Initialize workspace state before first roundtrip

The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agotests: Remove GLfloat usage.
John Kåre Alsaker [Wed, 3 Oct 2012 15:30:05 +0000 (17:30 +0200)]
tests: Remove GLfloat usage.

11 years agoweston: Use float instead of GLfloat.
John Kåre Alsaker [Sun, 30 Sep 2012 00:57:21 +0000 (02:57 +0200)]
weston: Use float instead of GLfloat.

11 years agocompositor-wayland: Create border after creating the OpenGL context.
John Kåre Alsaker [Wed, 3 Oct 2012 16:02:22 +0000 (18:02 +0200)]
compositor-wayland: Create border after creating the OpenGL context.

11 years agotests: add keyboard test
U. Artie Eoff [Mon, 1 Oct 2012 22:21:16 +0000 (15:21 -0700)]
tests: add keyboard test

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: add button test
U. Artie Eoff [Fri, 28 Sep 2012 13:39:32 +0000 (06:39 -0700)]
tests: add button test

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: test surface to/from global functions
U. Artie Eoff [Fri, 28 Sep 2012 13:39:31 +0000 (06:39 -0700)]
tests: test surface to/from global functions

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agoevent-test: more aggressive event testing
U. Artie Eoff [Fri, 28 Sep 2012 13:39:30 +0000 (06:39 -0700)]
event-test: more aggressive event testing

Test surface pointer enter/leave/motion and surface leave/enter
events more aggressively.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agodesktop-shell: destroy data before exiting.
U. Artie Eoff [Wed, 3 Oct 2012 04:12:35 +0000 (21:12 -0700)]
desktop-shell: destroy data before exiting.

desktop-shell never returned from display_run() since it
was essentially killed when weston exited.  To fix this,
it is necessary to watch for EPOLLHUP in window.c so that
toytoolkit clients will return from display_run() when
weston quits.  This allows for clients to clean up
as needed.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agosimple-shm: Draw the test motif surrounded by a white border
Rob Bradford [Tue, 2 Oct 2012 17:03:15 +0000 (18:03 +0100)]
simple-shm: Draw the test motif surrounded by a white border

We can then use a wl_surface_damage to just trigger the compositor to update
just a selected region of the buffer and thus test damaging a sub region.

11 years agosimple-shm: Don't attach the buffer to the surface for every redraw
Rob Bradford [Tue, 2 Oct 2012 17:03:14 +0000 (18:03 +0100)]
simple-shm: Don't attach the buffer to the surface for every redraw

This will allow us to change just a sub region of the buffer.

11 years agoeditor: more intuitive cursor positioning
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:54 +0000 (11:06 +0200)]
editor: more intuitive cursor positioning

Compute the nearest glyph edge instead of taking the one to the
left of the cursor.

Also fixes a segfault when trying to compute the position for an empty
buffer.

11 years agoeditor: take text offset into account when computing cursor position
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:53 +0000 (11:06 +0200)]
editor: take text offset into account when computing cursor position

11 years agoeditor: make selection a lighter shade of blue, much easier to read
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:52 +0000 (11:06 +0200)]
editor: make selection a lighter shade of blue, much easier to read

11 years agoeditor: fix assert to take preedit string into account
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:51 +0000 (11:06 +0200)]
editor: fix assert to take preedit string into account

11 years agoFix spelling errors
Martin Olsson [Sat, 29 Sep 2012 13:13:56 +0000 (15:13 +0200)]
Fix spelling errors

11 years agoxwm: Plug kill signal for killing X apps
Tiago Vignatti [Thu, 27 Sep 2012 14:48:37 +0000 (17:48 +0300)]
xwm: Plug kill signal for killing X apps

Xeyes is the counter-example that fails on that heuristic and won't be caught
on kill binding. This and the last two patches should fix:

    https://bugs.freedesktop.org/show_bug.cgi?id=53679

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agocompositor: Add kill signal
Tiago Vignatti [Thu, 27 Sep 2012 14:48:36 +0000 (17:48 +0300)]
compositor: Add kill signal

For now it's being emitted only on the desktop shell kill binding.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoshell: Skip clients that we forked ourselves in kill binding
Tiago Vignatti [Thu, 27 Sep 2012 14:48:35 +0000 (17:48 +0300)]
shell: Skip clients that we forked ourselves in kill binding

When we fork a client and give one end of a socketpair, the credentials
on the socket fd comes back as ourselves.  When that happens, do not kill
the process.

Also remove superfluous variables.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoshell: Start the desktop-shell client in the idle handler
Tiago Vignatti [Tue, 25 Sep 2012 14:57:01 +0000 (17:57 +0300)]
shell: Start the desktop-shell client in the idle handler

https://bugs.freedesktop.org/show_bug.cgi?id=55259

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agotoytoolkit: Process deferred tasks on fifo order instead
Tiago Vignatti [Thu, 27 Sep 2012 11:46:23 +0000 (14:46 +0300)]
toytoolkit: Process deferred tasks on fifo order instead

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoshell: Fix crash when an input panel is hiding
Jan Arne Petersen [Wed, 26 Sep 2012 12:39:45 +0000 (14:39 +0200)]
shell: Fix crash when an input panel is hiding

Set the geometry.dirty on the input panel surface before calling
weston_surface_update_transform, so that the surface gets an output
assigned.

11 years agoRequire mouse release on top of frame button to trigger action
Pekka Vuorela [Wed, 26 Sep 2012 12:05:45 +0000 (15:05 +0300)]
Require mouse release on top of frame button to trigger action

As common UI convention, allows action to be avoided by dragging
outside the button after mouse press.

11 years agocompositor-drm: Check that that we have a valid bo for scanout
Rob Bradford [Fri, 14 Sep 2012 22:25:41 +0000 (23:25 +0100)]
compositor-drm: Check that that we have a valid bo for scanout

If gbm_bo_import does not return a valid buffer for usage of
GBM_BO_USE_SCANOUT don't try and scan out the surface directly.

We've caught the SHM case explicitly earlier - this is to prevent other cases
where the bo cannot be scanned out.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agoProtect window callbacks from deleted windows
Pekka Vuorela [Mon, 17 Sep 2012 19:15:57 +0000 (22:15 +0300)]
Protect window callbacks from deleted windows

Calling window_destroy() was able to cause segfault for
callbacks triggering afterwards.

11 years agocompositor: Make weston_surface_assign_output() static
Kristian Høgsberg [Tue, 25 Sep 2012 18:48:04 +0000 (14:48 -0400)]
compositor: Make weston_surface_assign_output() static

This is now done as part of weston_surface_update_transform().

11 years agotest-client: initialize input instance.
U. Artie Eoff [Tue, 4 Sep 2012 21:37:45 +0000 (14:37 -0700)]
test-client: initialize input instance.

In seat_handle_capabilities, if input->pointer is not properly
initialized, then it will contain an arbitrary value and results
in the wl_pointer listener not getting registered if that value
is not 0/null.  Thus, use calloc to initialize the "input" instance.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=49937

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>