profile/ivi/weston-ivi-shell.git
11 years agoshell: set the popup grab button as pressed only if it actually is
Giulio Camuffo [Wed, 27 Mar 2013 17:05:26 +0000 (18:05 +0100)]
shell: set the popup grab button as pressed only if it actually is

This ensures the popup_grab.initial_up field isn't reset to 0
if the popup was not opened because of a mouse press but because
of moving the mouse with a popup already open. Not doing so will
make the first click outside the client area go ignored.

11 years agoshell: handle multiple popups
Giulio Camuffo [Mon, 25 Mar 2013 20:42:45 +0000 (21:42 +0100)]
shell: handle multiple popups

This patch implements a popup stack. When the first popup is opened
the grab is started, and it is added to a list. Further popups will
be added to this list but the grab won't change. When a popup is
closed it is removed from the list and, if it is now empty, the grab
is ended.
A click outside the client area will send the popup_done event to
all the popups in the list, and the grab will end.

11 years agoweston-egl: Allow compilation against older EGL stack
Rob Bradford [Fri, 22 Mar 2013 14:15:49 +0000 (14:15 +0000)]
weston-egl: Allow compilation against older EGL stack

Provide a definition of EGL_BUFFER_AGE_EXT so that you can compile against an
EGL stack that may not yet support that extension.

11 years agoRevert "weston.ini: Use 'modeline' key for modeline example"
Scott Moreau [Sun, 10 Mar 2013 15:30:16 +0000 (09:30 -0600)]
Revert "weston.ini: Use 'modeline' key for modeline example"

This reverts commit 97a56145636316fdb431b91ec64adff217287cd9.

The current code detects the mode key, not modeline. Reference:
http://cgit.freedesktop.org/wayland/weston/tree/src/compositor-drm.c#n2464

11 years agoweston.man: Document the way to disable idle timeout
Scott Moreau [Sat, 9 Mar 2013 18:55:40 +0000 (11:55 -0700)]
weston.man: Document the way to disable idle timeout

11 years agoconfig.ini: add examples for cursor-theme and cursor-size
Emilio Pozuelo Monfort [Thu, 14 Mar 2013 16:23:39 +0000 (17:23 +0100)]
config.ini: add examples for cursor-theme and cursor-size

11 years agoweston.ini.man: document cursor-theme and cursor-key
Emilio Pozuelo Monfort [Thu, 14 Mar 2013 16:23:38 +0000 (17:23 +0100)]
weston.ini.man: document cursor-theme and cursor-key

11 years agotoytoolkit: implement cursor-size config key
Emilio Pozuelo Monfort [Thu, 14 Mar 2013 16:23:37 +0000 (17:23 +0100)]
toytoolkit: implement cursor-size config key

11 years agoweston-launch: cleanup - return failures in main with EXIT_FAILURE
Siddharth Heroor [Mon, 11 Mar 2013 21:06:52 +0000 (02:36 +0530)]
weston-launch: cleanup - return failures in main with EXIT_FAILURE

Signed-off-by: Siddharth Heroor <heroor@gmail.com>
11 years agocompositor-rpi: Use correct enum, removes a warning
Philipp Brüschweiler [Sun, 10 Mar 2013 15:08:31 +0000 (16:08 +0100)]
compositor-rpi: Use correct enum, removes a warning

11 years agocompositor: remove unused field option_idle_time
Philipp Brüschweiler [Sun, 10 Mar 2013 13:37:04 +0000 (14:37 +0100)]
compositor: remove unused field option_idle_time

11 years agoweston-launch: return better value if weston dies because of a signal
Philipp Brüschweiler [Sun, 10 Mar 2013 14:14:01 +0000 (15:14 +0100)]
weston-launch: return better value if weston dies because of a signal

Before this commit, weston-launch returned 0 if weston was killed by a
signal. This makes it hard to automatically test weston by using
weston-launch, as there is no way to know why weston was terminated.

This commit makes weston-launch return 10+N instead, where N is the code
of the signal that terminated weston. 10 was chosen because it allows a
script to distinguish it from the case that weston-launch itself was
killed by a signal (128+N), and does not overlap the standard exit codes
defined in sysexits.h.

Partial fix for https://bugs.freedesktop.org/show_bug.cgi?id=60935. I
can't reproduce the SIGHUP using the fbdev backend.

v3: better commit message.

11 years agoweston-launch: move function calls out of assert()
Philipp Brüschweiler [Sat, 9 Mar 2013 18:38:56 +0000 (19:38 +0100)]
weston-launch: move function calls out of assert()

11 years agotoytoolkit: avoid redrawing a window between maximize and configure
MoD [Sat, 2 Mar 2013 23:43:57 +0000 (23:43 +0000)]
toytoolkit: avoid redrawing a window between maximize and configure

Resolve a bad frame visible when maximizing toytoolkit programs with the the
maximize button in decorations. Windows now use wl_display.sync requests to
wait for a maximize to finish before drawing again, following suggestions from
http://lists.freedesktop.org/archives/wayland-devel/2013-February/007650.html

11 years agowindow: restore maximized state from fullscreen mode if necessary
Rafal Mielniczuk [Mon, 11 Mar 2013 18:26:56 +0000 (19:26 +0100)]
window: restore maximized state from fullscreen mode if necessary

This patch sets back maximized mode, if that was its state before going
fullscreen.

11 years agowindow: save allocation only for toplevel window
Rafal Mielniczuk [Mon, 11 Mar 2013 18:26:55 +0000 (19:26 +0100)]
window: save allocation only for toplevel window

Thanks to that we will not overwrite saved allocation, when going
fullscreen from maximized state

11 years agoshell: reset rotation for maximized surface
Rafal Mielniczuk [Mon, 11 Mar 2013 18:26:54 +0000 (19:26 +0100)]
shell: reset rotation for maximized surface

Surface will preserve its rotation transformation when maximizing, which
will cause inconsistencies (eg. no window shadows drawn)

This patch removes rotation from maximized surface and restore it when
unmaximizing (just like in fullscreen mode)

11 years agoshell: block move, rotate, resize in maximized state
Rafal Mielniczuk [Mon, 11 Mar 2013 18:26:53 +0000 (19:26 +0100)]
shell: block move, rotate, resize in maximized state

To remain consisten with client side window, which blocks moving and
resizing of window in maximized state, we should do so on the compositor
side as well.

(until there is some unmaximize notification from server, which will
allow window to start drawing shadows and revert itself to toplevel
state)

11 years agopixman-renderer: don't forget to initialize the debug fields
Philipp Brüschweiler [Fri, 8 Mar 2013 19:35:39 +0000 (20:35 +0100)]
pixman-renderer: don't forget to initialize the debug fields

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

11 years agocompositor, shell: surface transform inheritance
Pekka Paalanen [Fri, 8 Mar 2013 12:56:50 +0000 (14:56 +0200)]
compositor, shell: surface transform inheritance

Implements surface transform inheritance. A 'parent' pointer is added to
weston_surface::geometry, and is automatically used by
weston_surface_update_transform(). When updating the transform, the
parent transform is updated as needed, too.

shell_map_popup() is converted to use the new
weston_surface_set_transform_parent() function. Now, if we moved the
popup's parent surface while the popup is open, the popup surface will
stick to the parent properly.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: introduce weston_surface_geometry_dirty()
Pekka Paalanen [Fri, 8 Mar 2013 12:56:49 +0000 (14:56 +0200)]
compositor: introduce weston_surface_geometry_dirty()

Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.

This allows us to hook into geometry dirtying in a following patch.

Also add comments to weston_surface fields, whose modification causes
transform state to become outdated.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: remove redundant geometry dirtying
Pekka Paalanen [Fri, 8 Mar 2013 12:56:48 +0000 (14:56 +0200)]
compositor: remove redundant geometry dirtying

Remove redundant geometry dirtying from surface_commit() to simplify
further changes.

This code was added in commit 5df8ecac5d31467122a9d8bda6241d5957ae6848
"compositor: Fix partial repaints"

as the fix to:
https://bugs.freedesktop.org/show_bug.cgi?id=56538

The issue fixed by that commit was making the geometry dirty on every
attach, which caused full-surface repaints every time. The bug was
probably introduced by the opaque region changes during implementing
wl_surface.commit. The mentioned commit fixes the opaque handling by
comparing the new and old regions.

However, the commit also introduces additional checks that set
geometry.dirty. In the current code base, this should be unnecessary.

If the pending.sx or pending.sy are not zero, or if the surface size
changes, the configure() hook is responsible for applying the new
values, and so also marking the geometry dirty.

The configure() hook is only called, if there has been a new
wl_surface.attach. Nothing else can change these variables, so this
should be enough.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
11 years agoEat scroll event if a key binding function is executed because of it.
Rune K. Svendsen [Thu, 7 Mar 2013 20:50:00 +0000 (21:50 +0100)]
Eat scroll event if a key binding function is executed because of it.

When an axis (scroll) event results in a key binding function
being executed, eat the scroll event so the underlying window
doesn't receive it.
Thanks to Scott Moreau for helping me solve this.

11 years agoFix memory leaks
Scott Moreau [Thu, 7 Mar 2013 17:15:17 +0000 (10:15 -0700)]
Fix memory leaks

Fix a couple leaks caught by valgrind.

11 years agogl-renderer: Use EXT_buffer_age and don't assume double buffering
Ander Conselvan de Oliveira [Tue, 5 Mar 2013 15:30:30 +0000 (17:30 +0200)]
gl-renderer: Use EXT_buffer_age and don't assume double buffering

Now that we have EXT_buffer_age in mesa, we should stop assuming double
buffering and use the buffer age instead.

Note: this will cause system without the extension to repaint the whole
screen every frame.

11 years agocompositor: Don't rely on surface->clip to cull overlay obscured damage
Ander Conselvan de Oliveira [Tue, 5 Mar 2013 15:30:29 +0000 (17:30 +0200)]
compositor: Don't rely on surface->clip to cull overlay obscured damage

Before this change, surface->clip would contain the region of this the
surface that is obscured by opaque containing of other surfaces in any
plane. If a surface was obscured only by a surface in another plane and
the renderer was told to draw that region, the rendering would be
clipped because of that.

This patch changes the clip to be plane specific, so that it contains
only the region of the surface obscured by other surfaces in the same
plane. We also calculate a per plane clip, so that we don't tell the
renderer to draw regions of the primary plane that are obscured by
other planes. This damage remains on the primary plane until the its
clip changes so that they are not obscured anymore.

11 years agogl-renderer: Don't change the region supplied to output repaint
Ander Conselvan de Oliveira [Tue, 5 Mar 2013 15:30:28 +0000 (17:30 +0200)]
gl-renderer: Don't change the region supplied to output repaint

The core uses this region to clear from the primary plane damage the
area that was repainted. If we add the old buffer damage to that, it
may end up clearing more damage from the primary plane than it was
intended.

11 years agocompositor: Keep a z-ordered list of planes
Ander Conselvan de Oliveira [Tue, 5 Mar 2013 15:30:27 +0000 (17:30 +0200)]
compositor: Keep a z-ordered list of planes

This let us clear a plane's opaque region without adding code in the
backend, and will be used in a following commit to change how we track
damage.

11 years agocompositor-drm: Inspect result of gbm_create_device.
John Kåre Alsaker [Sat, 2 Mar 2013 11:27:39 +0000 (12:27 +0100)]
compositor-drm: Inspect result of gbm_create_device.

11 years agosrc/Makefile.am: Fix git-version.h for out of tree builds
Andre Heider [Fri, 1 Mar 2013 14:38:23 +0000 (15:38 +0100)]
src/Makefile.am: Fix git-version.h for out of tree builds

Use --git-dir instead of --work-tree, see
http://marc.info/?l=git&m=120390208721287&w=2

Signed-off-by: Andre Heider <a.heider@gmail.com>
11 years agocompositor: Only send release event in response to wl_surface.attach
Kristian Høgsberg [Mon, 4 Mar 2013 17:11:41 +0000 (12:11 -0500)]
compositor: Only send release event in response to wl_surface.attach

The current semantics would implicitly attach the most recently attached
buffer at commit time and send a release event when the buffer enventually
was released.  The implicit attach is a little too subtle though and this
patch changes the semantics to always only send release events in response
to an attach event.  As a consequence, once a compositor releases a buffer,
it no longer has a reference to it and wl_surfcea.damage is undefined.
Thus, the client side visible change is that damage request must always
be preceeded by a wl_surface.attach request, to ensure there's a valid buffer,
even if that means attaching the same buffer again.

11 years agocompositor: Fold weston_buffer_post_release into weston_buffer_reference
Kristian Høgsberg [Mon, 4 Mar 2013 17:07:46 +0000 (12:07 -0500)]
compositor: Fold weston_buffer_post_release into weston_buffer_reference

Nothing else calls weston_buffer_post_release and the ref-counting and
sending the release event is essentially what weston_buffer_reference is
all about.

11 years agocompositor-drm: Determine opaqueness of a surface correctly
Kristian Høgsberg [Fri, 1 Mar 2013 19:29:16 +0000 (14:29 -0500)]
compositor-drm: Determine opaqueness of a surface correctly

We subtract the screen space opaque region from the transformed surface
region.  That's going to fail for when we're scaling up a surface, since
the surface bounding box for the scaled up surface is going to be bigger
than the opaque region.  Instead, subtract the surface-space opaque region
from a 0,0 - width,height region and see if that's empty.

11 years agotests: attach the surface's buffer when moving it
Giulio Camuffo [Thu, 28 Feb 2013 17:44:54 +0000 (18:44 +0100)]
tests: attach the surface's buffer when moving it

move_client() needs to attach the buffer, even if it was attached already,
because since 184df50 configure() will be called only on newly attached
surfaces, but the one that sets the test surface position is the configure
function.

11 years agocompositor: Change notify_motion to take relative motion events
Kristian Høgsberg [Mon, 25 Feb 2013 22:04:47 +0000 (17:04 -0500)]
compositor: Change notify_motion to take relative motion events

11 years agocompositor: Split pointer motion code into its own function
Kristian Høgsberg [Mon, 25 Feb 2013 21:49:29 +0000 (16:49 -0500)]
compositor: Split pointer motion code into its own function

11 years agocompositor: Make sure surface->transform.inverse is a complete matrix
Kristian Høgsberg [Thu, 28 Feb 2013 19:56:43 +0000 (14:56 -0500)]
compositor: Make sure surface->transform.inverse is a complete matrix

We never init this, so we need to copy over the position matrix and then
overwrite the translation entries to make sure we have a valid matrix.

Thanks to Pekka for spotting this (twice).

11 years agoconfigure.ac: Use automake color-tests
Kristian Høgsberg [Thu, 28 Feb 2013 16:19:10 +0000 (11:19 -0500)]
configure.ac: Use automake color-tests

11 years agocompositor: Make sure surface->transform.matrix,inverse are always valid
Kristian Høgsberg [Tue, 19 Feb 2013 22:04:50 +0000 (17:04 -0500)]
compositor: Make sure surface->transform.matrix,inverse are always valid

First step towards getting rid of the transform.enabled optimization.

11 years agocompositor: call configure on surfaces with a null buffer too
Giulio Camuffo [Thu, 21 Feb 2013 10:29:21 +0000 (11:29 +0100)]
compositor: call configure on surfaces with a null buffer too

This way the shell can know when a surface has been unmapped by
checking the value returned by weston_surface_is_mapped(surface).
The configure handlers have now width and height parameters, so
they do not need anymore to check manually the buffer size.
If a surface's buffer is NULL the width and height passed to the
configure are both 0.
Configure is now only called after an attach. The variable
weston_surface.pending.newly_attached is set to 1 on attach, and
after the configure call is reset to 0.

11 years agoevdev: Wait for SYN event before sending events over to the client
Satyeshwar Singh [Wed, 27 Feb 2013 20:26:23 +0000 (15:26 -0500)]
evdev: Wait for SYN event before sending events over to the client

The issue was that touch::down event from the compositor to client apps
would send the previous motion events coordinates and this obviously made
the client do the wrong thing. This happened because we were not waiting
for a SYN event to come from evdev before sending down, motion or up events.

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

11 years agoupdate .gitignores for src/ and man/
Pekka Paalanen [Tue, 26 Feb 2013 13:19:02 +0000 (15:19 +0200)]
update .gitignores for src/ and man/

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor-drm: Fix a crash with a fullscreen surface with driver mode
Ander Conselvan de Oliveira [Tue, 26 Feb 2013 11:44:58 +0000 (13:44 +0200)]
compositor-drm: Fix a crash with a fullscreen surface with driver mode

If there was a fullscreen surface using driver mode when a vt switch is
triggered, but something caused it to be gone when switching back (such
as the client being killed), a call to drm_output_switch_mode() is made
to restore the old mode, and that sets the output's current drm_fb to
NULL, so that the new mode is set drm_output_repaint(). This led to a
crash in vt_func(), because it tried to access output->current for
restoring the old mode.

Fix this by not setting the mode if there's no current fb. Instead,
schedule a repaint so that the mode is set in drm_output_repaint().

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

11 years agocompositor-drm: Use __func__ instead of hardcoded string
Scott Moreau [Sat, 23 Feb 2013 19:04:56 +0000 (12:04 -0700)]
compositor-drm: Use __func__ instead of hardcoded string

11 years agoMakefile.am: Distribute weston.ini sample
Kristian Høgsberg [Mon, 25 Feb 2013 18:03:15 +0000 (13:03 -0500)]
Makefile.am: Distribute weston.ini sample

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

11 years agoMakefile.am: SUBDIRS is automagic
Quentin Glidic [Thu, 21 Feb 2013 18:13:20 +0000 (19:13 +0100)]
Makefile.am: SUBDIRS is automagic

DIST_SUBDIRS should be used for corner cases only, not for conditional
SUBDIRS:

  If `SUBDIRS' is defined conditionally using Automake conditionals,
  Automake will define `DIST_SUBDIRS' automatically from the possible
  values of `SUBDIRS' in all conditions.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
11 years agotests: Use&Fix parallel tests
Quentin Glidic [Thu, 21 Feb 2013 20:01:23 +0000 (21:01 +0100)]
tests: Use&Fix parallel tests

Also fix automake 1.13 support

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
11 years agoshell: Go straight to sleep if the sceensaver isn't configured
Ander Conselvan de Oliveira [Fri, 22 Feb 2013 12:16:19 +0000 (14:16 +0200)]
shell: Go straight to sleep if the sceensaver isn't configured

If the screensaver path is not set, nothing would set the compositor
state to sleeping. In that case, outpus DPMS state was never set to
off.

11 years agoshell: Use weston_compositor_sleep() instead of setting DPMS state
Ander Conselvan de Oliveira [Fri, 22 Feb 2013 12:16:18 +0000 (14:16 +0200)]
shell: Use weston_compositor_sleep() instead of setting DPMS state

This should have been changed when the weston_compositor_sleep() entry
point was added.

11 years agocompositor: Rename lock and unlock signals to idle and wake
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:23 +0000 (18:35 +0200)]
compositor: Rename lock and unlock signals to idle and wake

After the changes introduced in the previous patch, those names are
more appropriate. It is up to the shell to decide when to lock the
screen.

11 years agocompositor: Move state tracking complexity into shell
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:22 +0000 (18:35 +0200)]
compositor: Move state tracking complexity into shell

Previously, when coming back from idle the compositor would try to
track if the unlock signal needed to be sent, and the shell would
change the compositor state in order to track when to display or
hide the screensaver.

This patch finishes moving this out of the compositor. With this, the
compositor state should be changed only using the exported functions
weston_compositor_wake() and weston_compositor_sleep(). The unlock
signal will be sent if the compositor wasn't in the ACTIVE state
previously. The lock signal is sent when the compositor becomes idle.

The calls to weston_compositor_wake() in the shell where there to allow
it to trigger the fade in only after the lock surface was configured.
Now the shell has full control of the fade and does not needed to
change the compositor state to do that, so those calls were replaced
with shell_fade() calls.

11 years agoshell: Use its own timer for the screensaver timeout
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:21 +0000 (18:35 +0200)]
shell: Use its own timer for the screensaver timeout

Previously, the shell would change the idle_time of the compositor to
the screensaver timeout and wake the compositor again, so that after
the timeout the compositor would fade to black and then the shell would
receive the lock signal again and would set the dpms state of the
outputs to off.

Instead, use a screensaver-specific timer for that, and call lock
without the back and forth between the shell and core Weston.

11 years agocompositor: Move fade animation out of core Weston into shell
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:20 +0000 (18:35 +0200)]
compositor: Move fade animation out of core Weston into shell

Previously, it was impossible to override the fade in/out behavior of
Weston using a different shell, since this was implemented in core
Weston. This also led to complicated interaction between the shell and
the core when displaying lock surfaces and screensavers.

This patch starts to solve this issue by moving the fade animation out
of the core. On compositor.c, besides deleting the fade code, the idle
handler had to be changed to emit the lock signal, since it was called
from the fade_frame() function before. This causes a slight change of
behavior, since before the fade would happen with the compositor being
active, while now it is already in the idle state. That leads to the
dpms state being set when cancelling the fade with mouse movement, and
in turn, to a slight freeze with drm compositor. This problem will be
fixed in a follow up patch.

On the shell side, the fade was re-implemented in a slightly different
manner. Instead of using a custom frame function, the fade animation
from animation.c is used. The interface for starting the fade was also
changed to take the value of an enum instead of a float alpha value,
in order to improve readability.

11 years agoanimation: Schedule a repaint only on the outputs the surface is in
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:19 +0000 (18:35 +0200)]
animation: Schedule a repaint only on the outputs the surface is in

The function weston_surface_animation_frame() would schedule a repaint
on all outputs, as weston_surface_schedule_repaint() didn't exist when
it was implemented.

11 years agoanimation: When fading, round the surface alpha when close to 0 or 1
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:18 +0000 (18:35 +0200)]
animation: When fading, round the surface alpha when close to 0 or 1

The spring code stops when the current value is withing 0.0002 of the
target. In that case, round the value to 0.0 or 1.0 to enable the use
of fast paths, such as disabling blending in the GL renderer when an
opaque region is set.

11 years agoanimation: Make fade more controllable
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:17 +0000 (18:35 +0200)]
animation: Make fade more controllable

Add parameters to weston_fade_run() for setting the initial and target
values for the fade, as well as a parameter to set the spring constant
used for the animation.

Also add the weston_fade_update() function, that allows the animation
to be changed while it is still running.

This will be used to move the fade animation from core Weston into the
shell. These changes are needed to be able to fade out as well as in,
and to be able to reverse the fade in case of user input.

11 years agocompositor: Split util.c into binding.c and animation.c
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:16 +0000 (18:35 +0200)]
compositor: Split util.c into binding.c and animation.c

The few functions not related to bindings or animations were moved
into compositor.c.

11 years agocompositor: Don't free config_file before we done using it
Kristian Høgsberg [Fri, 22 Feb 2013 02:10:36 +0000 (21:10 -0500)]
compositor: Don't free config_file before we done using it

11 years agoxwm: Only call set_fullscreen if the window is mapped
Kristian Høgsberg [Fri, 22 Feb 2013 01:18:37 +0000 (20:18 -0500)]
xwm: Only call set_fullscreen if the window is mapped

If we get a fullscreen client message before we map the window, we don't
have a shell surface yet.  Just dont call set_fullscreen yet, and rely on
xserver_map_shell_surface() to fullscreen it when we map it.

11 years agoPass argc and argv to modules
Kristian Høgsberg [Wed, 20 Feb 2013 20:37:49 +0000 (15:37 -0500)]
Pass argc and argv to modules

This lets modules parse options from the command line.

11 years agoPass argc pointer to parse_options()
Kristian Høgsberg [Wed, 20 Feb 2013 20:27:49 +0000 (15:27 -0500)]
Pass argc pointer to parse_options()

This lets us keep argc up to date as the backend picks out arguments
from the argv array.

11 years agotests: Fix text-test
Jan Arne Petersen [Tue, 19 Feb 2013 18:26:55 +0000 (19:26 +0100)]
tests: Fix text-test

Updated to changed text protocol.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoAdd missing builddir includes for version.h
Kristian Høgsberg [Wed, 20 Feb 2013 19:47:43 +0000 (14:47 -0500)]
Add missing builddir includes for version.h

af4f2aaf198522b51cf2afc2f25f9189c2432887 broke this

11 years agowindow: fix display_acquire_window_surface()
Pekka Paalanen [Wed, 20 Feb 2013 11:39:17 +0000 (13:39 +0200)]
window: fix display_acquire_window_surface()

Make sure that display_acquire_window_surface() creates the Cairo
surface as necessary. Otherwise surface->toysurface can be NULL.

This fixes weston-screensaver fullscreen mode. Demo mode was not
affected as it uses window decorations, and so the Cairo surface is
created. This regression was introduced by:

commit 0c4445ba5756e51007606028bce00b2ecb352bd7
Author: Pekka Paalanen <ppaalanen@gmail.com>
Date:   Wed Feb 13 16:17:23 2013 +0200

    window: create Cairo surfaces on demand for redraw

Reported-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor-x11: Only try to fullscreen if WM has _NET_WM_STATE_FULLSCREEN
Kristian Høgsberg [Wed, 20 Feb 2013 02:19:04 +0000 (21:19 -0500)]
compositor-x11: Only try to fullscreen if WM has _NET_WM_STATE_FULLSCREEN

If the window manager doesn't support _NET_WM_STATE_FULLSCREEN, the
fullscreen protocol won't work and we end up waiting indefintely for a
confiure event that doesn't come.

Only try to fullscreen if we have _NET_WM_STATE_FULLSCREEN, and only
wait for map if we're fullscreen.

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

11 years agoweston.ini: Use 'modeline' key for modeline example
Kristian Høgsberg [Tue, 19 Feb 2013 01:10:35 +0000 (20:10 -0500)]
weston.ini: Use 'modeline' key for modeline example

When specifying a modeline, use the modeline key.  Make the example
weston.ini do that.

11 years agoshell: Do not hang when mapping a popup twice
Giulio Camuffo [Mon, 18 Feb 2013 21:26:01 +0000 (22:26 +0100)]
shell: Do not hang when mapping a popup twice

When calling shell_map_popup() more than one time on the same shell_surface
the parent transform was getting added more than one time to the transform
list, resulting in an infinite loop when going through the list with
wl_list_for_each in weston_surface_update_transform_enable().
This commit removes the old transform before adding it again.

11 years agocompositor: set data_device keyboard focus in seat_get_keyboard
Rafal Mielniczuk [Sun, 17 Feb 2013 14:55:55 +0000 (15:55 +0100)]
compositor: set data_device keyboard focus in seat_get_keyboard

Because seat_get_keyboard is called after initial
weston_surface_activate, wl_data_device_set_keyboard_focus
fails to send data offer for newly connected client due to
wl_seat.focus_resource being NULL.

This patch calls wl_data_device_set_keyboard_focus
in seat_get_keyboard, so it can send data offer for
newly created client (when wl_keyboard.resource_list
and wl_seat.focus_resource are properly set up).

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

11 years agoudev-seat: Simplfy enable/disable interface a bit
Kristian Høgsberg [Mon, 18 Feb 2013 21:50:19 +0000 (16:50 -0500)]
udev-seat: Simplfy enable/disable interface a bit

We always call enable_udev_monitor and add_devices together and always
disable_udev_monitor and remove_devices together.  Let's just have one
entry point for enable and one for disable.

11 years agocompositor-fbdev: Use udev_seat
Kristian Høgsberg [Mon, 18 Feb 2013 21:35:26 +0000 (16:35 -0500)]
compositor-fbdev: Use udev_seat

Let's share the udev input device discovery code.

11 years agocompositor-drm: Move udev_seat to its own file
Kristian Høgsberg [Mon, 18 Feb 2013 21:15:53 +0000 (16:15 -0500)]
compositor-drm: Move udev_seat to its own file

We get to move the input code out of compositor-drm.c and we'll be
able to share it with the fbdev backend.

11 years agocompositor-drm: Rename a few evdev_* functions to udev_seat_*
Kristian Høgsberg [Mon, 18 Feb 2013 20:43:29 +0000 (15:43 -0500)]
compositor-drm: Rename a few evdev_* functions to udev_seat_*

We used to have a bit of naming trouble when the protocol object was called
wl_input_device and the individual evdev devices were call evdev_device.
And we didn't have a drm_seat.  Now that we've fixed all that, it's clear
that the drm_seat is all about udev discovery and hotplug of evdev devices,
so let's call it udev_seat instead.

11 years agoconfigure.ac: Make xwayland tests depend on xwayland
Quentin Glidic [Mon, 18 Feb 2013 19:38:22 +0000 (20:38 +0100)]
configure.ac: Make xwayland tests depend on xwayland

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
11 years agoxkb: Don't call exit on failure in weston_compositor_xkb_init()
Kristian Høgsberg [Sat, 16 Feb 2013 19:29:24 +0000 (14:29 -0500)]
xkb: Don't call exit on failure in weston_compositor_xkb_init()

This will exit without cleaning vt modes and leave the system stuck.

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

11 years agocompositor-x11: Fix pointer type warning
Kristian Høgsberg [Mon, 18 Feb 2013 20:04:07 +0000 (15:04 -0500)]
compositor-x11: Fix pointer type warning

11 years agocompositor-drm: Remember to drop master in drm error handling
Kristian Høgsberg [Mon, 18 Feb 2013 20:02:27 +0000 (15:02 -0500)]
compositor-drm: Remember to drop master in drm error handling

Otherwise we'll kill whatever other display sever we're switching back to.
The tricky thing here is that we never explicitly set drm master in the
startup path, we get that implicitly from being the first to open the
drm device.  Even so, we need to drop it before switching VTs.

11 years agosrc/Makefile.am: Use $(libdir) instead of @libdir@
Kristian Høgsberg [Mon, 18 Feb 2013 20:26:28 +0000 (15:26 -0500)]
src/Makefile.am: Use $(libdir) instead of @libdir@

This allows overriding prefix and libdir at make time.  Noticed
by David Herrmann.

11 years agoInstall header files and pkg-config file for external modules
Kristian Høgsberg [Sat, 16 Feb 2013 01:53:20 +0000 (20:53 -0500)]
Install header files and pkg-config file for external modules

This patch installs the three header files that define the compositor
plugin interface as well as a pkg-config file.  This allows
building weston plugins outside the weston tree.  We currently don't make
any guarantees about the plugin API/ABI except that within a stable
branch we won't break it.

11 years agocompositor: Use libunwind if available for better backtraces
Marcin Slusarz [Mon, 18 Feb 2013 18:27:22 +0000 (13:27 -0500)]
compositor: Use libunwind if available for better backtraces

libunwind has a dwarf parser and automatically queries the dlinfo
for location of dlopened modules.  The resulting backtrace is much
better and includes stack frames in dynamically loaded modules.

krh: Originally submitted for Xorg, adapted for weston:

  http://lists.x.org/archives/xorg-devel/2013-February/035493.html

Note this require libunwind at least 1.1 to get the pkg-config files.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
11 years agotext: Split out cursor_position
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:23 +0000 (15:52 +0100)]
text: Split out cursor_position

Add an extra cursor_position, which also allows to change the anchor
(for slections). Change the index type to int to allow setting it before
the beginning of a commited string.

The cursor should not be moved as a direct repsonse to this event but
atomically on the next commit_string event.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Rename set_micro_focus request
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:22 +0000 (15:52 +0100)]
text: Rename set_micro_focus request

Rename set_micro_focus to set_cursor_rectangle to make more clear, what
it refers to.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add show/hide_input_panel requests
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:21 +0000 (15:52 +0100)]
text: Add show/hide_input_panel requests

Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add commit request
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:20 +0000 (15:52 +0100)]
text: Add commit request

Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Remove unused requests/events
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:19 +0000 (15:52 +0100)]
text: Remove unused requests/events

Put them back in, when we know what arguments they will have.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Move input_panel interface to input-method
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:55 +0000 (21:26 +0100)]
text: Move input_panel interface to input-method

Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).

Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoshell: Do not hang after setting input_panel twice
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:54 +0000 (21:26 +0100)]
shell: Do not hang after setting input_panel twice

Ignore multiple calls with the same surface in input_panel_set_surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoshell: Do not crash when hiding input_panel
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:53 +0000 (21:26 +0100)]
shell: Do not crash when hiding input_panel

Allow an input panel to attach a NULL-buffer for hiding.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Add support for backspace keysym events
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:52 +0000 (21:26 +0100)]
editor: Add support for backspace keysym events

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agodoc: add some more text protocol documentation
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:51 +0000 (21:26 +0100)]
doc: add some more text protocol documentation

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: fix weston key bindings with input methods
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:50 +0000 (21:26 +0100)]
text: fix weston key bindings with input methods

Add a struct weston_keyboard, to handle the input method grab.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agosimple-im: fix for protocol changes
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:49 +0000 (21:26 +0100)]
simple-im: fix for protocol changes

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agokeyboard: add support for invoke_action
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:48 +0000 (21:26 +0100)]
keyboard: add support for invoke_action

Set the pre-edit cursor on the clicked index on invoke_action.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: add support for invoke_action
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:47 +0000 (21:26 +0100)]
editor: add support for invoke_action

Call invoke_action request when a currently composed word is clicked.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: add support for invoke_action request
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:46 +0000 (21:26 +0100)]
text: add support for invoke_action request

Add a request to be called by the client when the word currently being
composed is tapped by the user. Input methods often use this information
to offer more word suggestions to the user.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Add content type example
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:45 +0000 (21:26 +0100)]
editor: Add content type example

Set the content type purpose to numeric of the second entry.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agokeyboard: Add support for a numeric layout
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:44 +0000 (21:26 +0100)]
keyboard: Add support for a numeric layout

Add support for a numeric key layout, which is used for some numeric
content purpose types.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add content type support to text protocol
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:43 +0000 (21:26 +0100)]
text: Add content type support to text protocol

Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: add support for pre-edit styling
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:42 +0000 (21:26 +0100)]
editor: add support for pre-edit styling

Add pango dependency to the example and use pango for text handling.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agokeyboard: Add support for pre-edit styling
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:41 +0000 (21:26 +0100)]
keyboard: Add support for pre-edit styling

Adds a button to the keyboard to support different styles of pre-edit
styling.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: support commit on reset
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:40 +0000 (21:26 +0100)]
editor: support commit on reset

Commit pending pre-edit text when focus-out or changing the cursor
location.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>