profile/ivi/weston-ivi-shell.git
11 years agowindow: Only advertise fullscreen menu item if client supports it
Kristian Høgsberg [Tue, 30 Oct 2012 22:07:02 +0000 (18:07 -0400)]
window: Only advertise fullscreen menu item if client supports it

If the client doesn't set a fullscreen handler, we can't go fullscreen
and shouldn't advertise that in the window menu.  The menu implementation is
a little simplistic, so we just move the "Fullscreen" entry to the end of
the list and don't count it if we don't want it in the menu.

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

11 years agoimage: Set dragging pointer on button press, not first motion
Kristian Høgsberg [Tue, 30 Oct 2012 19:50:37 +0000 (15:50 -0400)]
image: Set dragging pointer on button press, not first motion

We want feedback that we're starting to drag when we press the button
not when we later start dragging the image.

11 years agoimage: Combine clamp_view() and center_view ()
Kristian Høgsberg [Tue, 30 Oct 2012 19:46:25 +0000 (15:46 -0400)]
image: Combine clamp_view() and center_view ()

We need to clamp or center on a per axis basis.  If the window is wider
but the image is taller, we need to center horizontally but
clamp vertically.  We can only do that if by combining the two
functions.

11 years agoimage: Add keyhandler to handle keyboard zoom
Kristian Høgsberg [Tue, 30 Oct 2012 19:42:20 +0000 (15:42 -0400)]
image: Add keyhandler to handle keyboard zoom

11 years agoimage: Set resize handler and center view on resize/fullscreen
Kristian Høgsberg [Tue, 30 Oct 2012 19:09:49 +0000 (15:09 -0400)]
image: Set resize handler and center view on resize/fullscreen

11 years agotoytoolkit: Don't destroy window cairo surface on shm attach.
Scott Moreau [Tue, 30 Oct 2012 18:12:12 +0000 (12:12 -0600)]
toytoolkit: Don't destroy window cairo surface on shm attach.

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

11 years agoshell: End popups if we trigger a shell grab
Kristian Høgsberg [Tue, 30 Oct 2012 18:07:27 +0000 (14:07 -0400)]
shell: End popups if we trigger a shell grab

Clicking outside popups closes them except in case of a shell grab
(move, resize or rotate), in which case we move the parent window away
from under the popup.  Instead, just end the popup in those cases.

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

11 years agocompositor: Fix partial repaints
Ander Conselvan de Oliveira [Tue, 30 Oct 2012 15:44:01 +0000 (17:44 +0200)]
compositor: Fix partial repaints

Partial repaints have been broken since the introduction of the atomic
surface updates. The problem was that surface_commit would set the
geometry dirty flag unconditionally, causing transform updates on every
frame which would in turn cause weston_surface_damage_below() to damage
the whole surface area.

This patch changes this so that flag is only set if the pending buffer
has a different size, the location of the surface changed or the opaque
region changed.

Note that changing the opaque region will cause a full repaint of the
affected surface, because of the transform update.

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

11 years agowindow: Make press-drag-release menu selection mode work
Kristian Høgsberg [Tue, 30 Oct 2012 17:45:22 +0000 (13:45 -0400)]
window: Make press-drag-release menu selection mode work

The intended behavior is that a quick click (press and then release
within 500ms) just pops up the menu and doesn't select anything.  Then
we can mouse around and and click to select an item.  Alternatively, a
click and hold (ie press and release after 500ms) lets you press right
button, mouse down on the menu item you want and release to select it.
This is how menus work in most toolkits.

The handling in weston is fine, it's there to handle the case where
the button release happens outside any client window, since the client
doesn't get those events.  If such a release happens late or we get a
second release outside the popup window we shut down the popup.

The problem is in toytoolkit, where we need to select the item if we
get a release within 500ms or if we get a second release.  A second
release is the case where the first release came after 500ms and
didn't pop down the menu, and the second release event is from a click
on a menu item.

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

11 years agocompositor-x11: Grab pointer on button press, ungrab on release
Kristian Høgsberg [Tue, 30 Oct 2012 15:04:52 +0000 (11:04 -0400)]
compositor-x11: Grab pointer on button press, ungrab on release

This lets us confine the X pointer to the Weston X window, which corresponds
better with the rendered Wayland cursor actually moves.

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

11 years agosimple-egl: Add a default cursor
Kristian Høgsberg [Mon, 29 Oct 2012 21:41:46 +0000 (17:41 -0400)]
simple-egl: Add a default cursor

If clients don't set a cursor, they get whatever the last cursor was
before the pointer entered their window.  That's a little confusing, so
set a pointer on enter to avoid that.  The down-side is that simple EGL
isn't very simple anymore.

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

11 years agoclients: Remove $(toolkit_libs) from weston_screensaver_CFLAGS
Kristian Høgsberg [Mon, 29 Oct 2012 21:15:54 +0000 (17:15 -0400)]
clients: Remove $(toolkit_libs) from weston_screensaver_CFLAGS

The typo that broke the build.

11 years agowindow: Ignore input_set_pointer_image() if we don't have a pointer
Kristian Høgsberg [Mon, 29 Oct 2012 20:42:26 +0000 (16:42 -0400)]
window: Ignore input_set_pointer_image() if we don't have a pointer

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

11 years agocompositor-drm: prefer PCI boot_vga GPU over other GPUs
David Herrmann [Mon, 29 Oct 2012 18:21:16 +0000 (19:21 +0100)]
compositor-drm: prefer PCI boot_vga GPU over other GPUs

If we can find a boot_vga PCI GPU, we should prefer it over any other GPU
that is connected to the system. The boot_vga flag tells us that this GPU
is the primary system GPU.

This fixes problems on two-GPU-systems were the wrong GPU is used. It also
fixes systems were DisplayLink GPUs are available with lower IDs than PCI
GPUs (although, this seems unlikely).

Note that udev_enumerate guarantees that the entry-list is sorted. So for
systems that have platform-GPUs, these should almost always be reported
prior to hotpluggable (PCI, USB, ...) GPUs, as the kernel probes them
first.

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agodnd: Use %zd in the format string for size_t types
Damien Lespiau [Fri, 26 Oct 2012 00:15:44 +0000 (01:15 +0100)]
dnd: Use %zd in the format string for size_t types

len i size_t, so is the result of the sizeof operator.

11 years agocompositor-x11: Inherit initial modifier state from XKB
Kristian Høgsberg [Mon, 29 Oct 2012 18:15:40 +0000 (14:15 -0400)]
compositor-x11: Inherit initial modifier state from XKB

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

11 years agoman: Update XCURSOR_* information a bit
Tiago Vignatti [Fri, 28 Sep 2012 13:29:47 +0000 (16:29 +0300)]
man: Update XCURSOR_* information a bit

This and the previous patch should fix:

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

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoxwm: Fail safely if cursor is not found
Tiago Vignatti [Fri, 28 Sep 2012 13:29:46 +0000 (16:29 +0300)]
xwm: Fail safely if cursor is not found

It will use the stock 'x' cursor instead when the system cursors are not
provided.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoconfigure.ac: Check for libGLU for screensaver
Kristian Høgsberg [Mon, 29 Oct 2012 17:06:02 +0000 (13:06 -0400)]
configure.ac: Check for libGLU for screensaver

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

11 years agoAdd informal notes file
Pekka Paalanen [Wed, 24 Oct 2012 06:43:10 +0000 (09:43 +0300)]
Add informal notes file

By request on the wayland-devel mailing list, we could start collecting
useful writings here.

However, this is not meant to be a substitute to proper documentation,
though I understand it may very well become one. Better than nothing, I
guess, and hopefully helps in writing real documentation.

Feel free to add stuff.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
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>