chromiumos/third_party/wayland-demos.git
2 years agotablet-shell: Add more interesting lock and home screens factory-1412.B factory-1987.B factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B factory-3536.B factory-4128.B factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-3842.B factory-spring-4131.B factory-spring-4262.B firmware-butterfly-2788.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-link-2348.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-pit-4482.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-stout-2817.B firmware-wolf-4389.24.B master release-R17-1412.B release-R18-1660.B release-R19-2046.B release-R20-2268.B release-R21-2465.B release-R22-2723.B release-R23-2913.B release-R25-3428.B release-R26-3701.B release-R27-3912.B release-R28-4100.B release-R29-4319.B release-R30-4537.B stabilize stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-4443.B stabilize-4512.B stabilize-bluetooth-smart stabilize-daisy stabilize-link stabilize-link-2913.278 stabilize-spring-4100.53.B stabilize2 toolchain-3428.65.B toolchain-3701.42.B toolchainA toolchainB
Kristian Høgsberg [Sun, 27 Nov 2011 04:38:41 +0000 (23:38 -0500)]
tablet-shell: Add more interesting lock and home screens

2 years agotablet-shell: Add a stub tablet-shell client
Kristian Høgsberg [Sat, 26 Nov 2011 22:36:23 +0000 (17:36 -0500)]
tablet-shell: Add a stub tablet-shell client

For a start, this is just to we can run and test the corresponding
compositor plugin and keep it from bit-rotting.

2 years agowindow.c: Cache outputs
Kristian Høgsberg [Sat, 26 Nov 2011 22:27:37 +0000 (17:27 -0500)]
window.c: Cache outputs

2 years agoImplement the new dnd/selection protocol
Kristian Høgsberg [Fri, 28 Oct 2011 16:26:06 +0000 (12:26 -0400)]
Implement the new dnd/selection protocol

The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.

2 years agoshell: Unmap old backgrounds/panels when setting new ones
Benjamin Franzke [Wed, 23 Nov 2011 19:46:40 +0000 (20:46 +0100)]
shell: Unmap old backgrounds/panels when setting new ones

2 years agodesktop-shell: Make panel and background output dependent
Benjamin Franzke [Tue, 22 Nov 2011 11:43:52 +0000 (12:43 +0100)]
desktop-shell: Make panel and background output dependent

2 years agodesktop-shell: Unlock dialog needs to be a custom window
Benjamin Franzke [Wed, 23 Nov 2011 18:35:07 +0000 (19:35 +0100)]
desktop-shell: Unlock dialog needs to be a custom window

Since set_toplevel would overwrite set_lock_surface.

2 years agodesktop-shell: Fix some indents
Benjamin Franzke [Tue, 22 Nov 2011 11:38:48 +0000 (12:38 +0100)]
desktop-shell: Fix some indents

2 years agocompositor: Move more shell.c state into the new shell_surface
Kristian Høgsberg [Wed, 23 Nov 2011 15:52:40 +0000 (10:52 -0500)]
compositor: Move more shell.c state into the new shell_surface

2 years agoMerge remote-tracking branch 'pq/shell-priv'
Kristian Høgsberg [Wed, 23 Nov 2011 15:40:11 +0000 (10:40 -0500)]
Merge remote-tracking branch 'pq/shell-priv'

2 years agocompositor: The compositor is now jiust a regular global object
Kristian Høgsberg [Wed, 23 Nov 2011 15:39:34 +0000 (10:39 -0500)]
compositor: The compositor is now jiust a regular global object

We have to provide our own bind callback and add a wlsc_compositor pointer
to wlsc_input_device, but on the whole it's nice cleanup.

2 years agocompositor: Remove a couple of unused #defines
Kristian Høgsberg [Wed, 23 Nov 2011 15:17:41 +0000 (10:17 -0500)]
compositor: Remove a couple of unused #defines

2 years agocompositor: Remove unused resource field from wlsc_output
Kristian Høgsberg [Wed, 23 Nov 2011 15:17:15 +0000 (10:17 -0500)]
compositor: Remove unused resource field from wlsc_output

2 years agoshell: introduce shell_surface_purpose
Pekka Paalanen [Wed, 23 Nov 2011 14:42:16 +0000 (16:42 +0200)]
shell: introduce shell_surface_purpose

Enumerate the different surface purposes for the shell: background, panel,
lock surface, and normal (other) surfaces.

Instead of testing wlsc_surface pointers against known pointers, check
the purpose field.

This change will ease implementing per-output background, panel, etc.
when the number of "known" surface pointers grows dynamically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoshell: add private surface struct
Pekka Paalanen [Wed, 23 Nov 2011 14:14:12 +0000 (16:14 +0200)]
shell: add private surface struct

Add a pointer to wlsc_surface for shell-private data. This is a
temporary solution.

Add struct shell_surface, where you can add any shell-private data
members related to a wlsc_surface. The getter function takes care of
creating the private data if it does not exist yet.

Not used anywhere yet.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: Set output for cursor surface so damage_below works
Kristian Høgsberg [Wed, 23 Nov 2011 00:47:57 +0000 (19:47 -0500)]
compositor: Set output for cursor surface so damage_below works

2 years agoSimplify evdev_flush_motion() a tiny bit
Kristian Høgsberg [Wed, 23 Nov 2011 00:24:25 +0000 (19:24 -0500)]
Simplify evdev_flush_motion() a tiny bit

2 years agoMerge remote-tracking branch 'vignatti/evdev'
Kristian Høgsberg [Wed, 23 Nov 2011 00:21:34 +0000 (19:21 -0500)]
Merge remote-tracking branch 'vignatti/evdev'

2 years agocairo-util: Dont use non-standard JCS_EXT_BGRX color space
Kristian Høgsberg [Tue, 22 Nov 2011 19:40:00 +0000 (14:40 -0500)]
cairo-util: Dont use non-standard JCS_EXT_BGRX color space

Everytime somebody has to write a channel swizzling loop,
God kills a kitten... and a dolphin and a unicorn.

2 years agoNever include wayland-util.h directly
Kristian Høgsberg [Tue, 22 Nov 2011 14:35:14 +0000 (09:35 -0500)]
Never include wayland-util.h directly

And fix a missing "" to <> conversion for wayland-client.h include.

2 years agoFix inconsistent #include style
Pekka Paalanen [Tue, 22 Nov 2011 12:18:50 +0000 (14:18 +0200)]
Fix inconsistent #include style

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoevdev: fetch absolute coordinates inside flush_motion only
Tiago Vignatti [Tue, 22 Nov 2011 10:05:22 +0000 (12:05 +0200)]
evdev: fetch absolute coordinates inside flush_motion only

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: remove useless field from device structure
Tiago Vignatti [Mon, 21 Nov 2011 16:29:40 +0000 (18:29 +0200)]
evdev: remove useless field from device structure

We'll want to enhance later the driver regarding the tool being used, but for
now just remove unused bits.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: reset accumulator inside evdev_flush_motion
Tiago Vignatti [Mon, 21 Nov 2011 15:59:31 +0000 (17:59 +0200)]
evdev: reset accumulator inside evdev_flush_motion

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: use a separate structure to denote accumulated motion events
Tiago Vignatti [Mon, 21 Nov 2011 15:40:30 +0000 (17:40 +0200)]
evdev: use a separate structure to denote accumulated motion events

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: use a separate struct for abs information
Tiago Vignatti [Mon, 21 Nov 2011 14:39:55 +0000 (16:39 +0200)]
evdev: use a separate struct for abs information

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agotty: fix command line parsing
Tiago Vignatti [Mon, 21 Nov 2011 12:55:23 +0000 (14:55 +0200)]
tty: fix command line parsing

revert typo from evdev commit 8b568806.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agowindow: Remove unused variable
Kristian Høgsberg [Fri, 18 Nov 2011 20:24:23 +0000 (15:24 -0500)]
window: Remove unused variable

2 years agoevdev: Reset accumulate values when we flush motion events
Kristian Høgsberg [Fri, 18 Nov 2011 15:42:34 +0000 (10:42 -0500)]
evdev: Reset accumulate values when we flush motion events

Otherwise we end up reporting all motion events twice.

2 years agoMerge remote-tracking branch 'pq/glmatrix'
Kristian Høgsberg [Fri, 18 Nov 2011 14:57:50 +0000 (09:57 -0500)]
Merge remote-tracking branch 'pq/glmatrix'

2 years agocompositor: Queue buffer.release instead of sending immediately
Kristian Høgsberg [Thu, 17 Nov 2011 21:46:19 +0000 (16:46 -0500)]
compositor: Queue buffer.release instead of sending immediately

2 years agoevdev: fix order of events being sent to the compositor
Tiago Vignatti [Fri, 18 Nov 2011 12:56:58 +0000 (14:56 +0200)]
evdev: fix order of events being sent to the compositor

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agowscreensaver: configure glmatrix
Pekka Paalanen [Fri, 18 Nov 2011 12:36:14 +0000 (14:36 +0200)]
wscreensaver: configure glmatrix

Since I have commented out all the config structures in glmatrix.c, it
was not getting proper default values. Hardcode some default there.

Remove glClear from reshape_matrix(), as wscreensaver does not support
rendering commands in reshape call.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoclients: add wscreensaver
Pekka Paalanen [Thu, 17 Nov 2011 09:33:06 +0000 (11:33 +0200)]
clients: add wscreensaver

Implement all the required support code for running glmatrix.c.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoclients: import glmatrix.c and matrix3.xpm
Pekka Paalanen [Thu, 17 Nov 2011 09:06:36 +0000 (11:06 +0200)]
clients: import glmatrix.c and matrix3.xpm

Copy hacks/glx/glmatrix.c and hacks/images/matrix3.xpm from
xscreensaver-5.15 distribution package.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoevdev: remove signed value checks
Tiago Vignatti [Thu, 10 Nov 2011 12:47:30 +0000 (14:47 +0200)]
evdev: remove signed value checks

Very likely that 2.4 kernels won't be used with Wayland compositor so the
check for signal value is pretty much useless.

It's okay to change e->value inside evdev_process_absolute_motion_touchpad
given it's not used later on, and I also rather not touch this snip because it
will be changed when multi-touch support arrives.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agosimple-shm: Add a wl_shm listener
Kristian Høgsberg [Thu, 17 Nov 2011 15:27:17 +0000 (10:27 -0500)]
simple-shm: Add a wl_shm listener

This way we properly check that WL_SHM_FORMAT_XRGB32 is available.

2 years agoshell: fix handle_lock_surface_destroy()
Pekka Paalanen [Wed, 16 Nov 2011 11:47:35 +0000 (13:47 +0200)]
shell: fix handle_lock_surface_destroy()

A copy & paste bug, that resulted setting to NULL something else than
shell->lock_surface when that surface was destroyed.

The symptom: let compositor lock down, unlock it, let it lock down
again, and the unlock dialog is never requested again. This bug was
triggered by the previous fix "shell: fix compositor wakeup while
locked".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoshell: fix compositor wakeup while locked
Pekka Paalanen [Wed, 16 Nov 2011 11:47:34 +0000 (13:47 +0200)]
shell: fix compositor wakeup while locked

Compositor is locked, woken up, unlock dialog is shown; if the
compositor does to sleep again, before being unlocked, it will never
wake up again, because unlock() becomes a no-op, yet it should wake the
compositor up.

Fix this by letting unlock() to wake up the compositor, if lock surface
is present.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoshell: fix lock surface mapping
Pekka Paalanen [Wed, 16 Nov 2011 11:47:33 +0000 (13:47 +0200)]
shell: fix lock surface mapping

When the lock surface was map()'d while the compositor was locked,
wlsc_surface_configure() was never called for the lock surface. Hence,
the surface->output was NULL, and the 'frame' event was never sent,
causing desktop-shell to loop in dri2_swap_buffers().

Fix this by calling wlsc_surface_configure() for the lock surface
always in map().

Additionally, adjust the comments in map() to make it more readable.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: Hide surfaces by setting surface->output to NULL
Kristian Høgsberg [Tue, 15 Nov 2011 21:39:55 +0000 (16:39 -0500)]
compositor: Hide surfaces by setting surface->output to NULL

This way we can still use surface->link when a surface is not in
the main compositor surface list and don't need the hidden_surface
wrapper object.  Also, setting surface->output to NULL will block
the surface frame callback until we put the surface back into the
main list.  This has the effect of blocking animations while a surface
isn't visible.

2 years agodesktop-shell: add unlock dialog
Pekka Paalanen [Tue, 15 Nov 2011 11:34:56 +0000 (13:34 +0200)]
desktop-shell: add unlock dialog

The unclock dialog is just a normal window with a green ball in it. When
you click the ball, the screen will be unlocked.

Made for testing the screen locking.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agowindow: clean up redraw and focuses on destroy
Pekka Paalanen [Tue, 15 Nov 2011 11:34:55 +0000 (13:34 +0200)]
window: clean up redraw and focuses on destroy

Currently, the way to destroy a window in a response to an event (e.g.
button click), is to put a task into the deferred list with
display_defer(). The task will then call window_destroy() from outside
event handling code.

As events are handled, it is possible that the deferred list contains
also the redraw task for this window. As the execution order of these
tasks is unknown (redrawing a freed window is a bug) and redrawing
something that goes away immediately is not useful, the redraw task must
be removed on window_destroy().

'struct input' contains pointers to windows currently in focus for that
input device. These pointers must also be cleared on window_destroy().
This fixes a use-after-free bug for the unlock dialog in desktop-shell
(future commit).

As an irrelevant minor cleanup, window::grab_device member is not used
anywhere, and is removed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: implement screen locking
Pekka Paalanen [Tue, 15 Nov 2011 11:34:54 +0000 (13:34 +0200)]
compositor: implement screen locking

When the compositor is locked, all surfaces are moved from the
compositor's list to a private list in the shell plugin. This prevents
any of those surfaces from being visible or receiving input. All new
surfaces will be moved to the private list, too.

The background surface is an exception, it is left to the compositor's
list, so the background will be painted. It is assumed that the
background surface does not allow any actions while being locked.

When desktop-shell announces a lock surface (an unlock dialog), it is
added to the compositor's list, so the user can interact with it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: check wlsc_surface::link before accessing neighbors
Pekka Paalanen [Tue, 15 Nov 2011 11:34:53 +0000 (13:34 +0200)]
compositor: check wlsc_surface::link before accessing neighbors

Check that wlsc_surface::link is part of a list before assuming it is
part of the compositor->surface_list list.

The shell plugin may want to remove a surface from the compositor's
surface list to hide it. Note, that the shell plugin cannot use
wlsc_surface::link for its own purposes.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: fix repaint on first wakeup
Pekka Paalanen [Tue, 15 Nov 2011 11:34:51 +0000 (13:34 +0200)]
compositor: fix repaint on first wakeup

wlsc_compositor_fade() ends up in wlsc_compositor_schedule_repaint(),
which is a no-op if compositor is SLEEPING.

On wakeup, first set status to ACTIVE, then call wlsc_compositor_fade()
to start and actually show the animation.

Before, fade was called first, which reset the animation, but did not
cause a repaint. The following wakeup (any input event) would then cause
a repaint, showing the animation from the middle or end of it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: remove idle_inhibit optimization
Pekka Paalanen [Tue, 15 Nov 2011 11:34:50 +0000 (13:34 +0200)]
compositor: remove idle_inhibit optimization

With the idle_inhibit optimization, wlsc_compositor_wake() is a no-op if
idle_inhibit > 0.

When the shell is waking up the compositor from SLEEPING state as an
indirect response to input activity, it does not work. The call path is:
notify_key() / notify_button()
wlsc_compositor_idle_inhibit()
wlsc_compositor_activity()
shell->unlock()
send prepare_lock_surface event
idle_inhibit++

and when the desktop-shell client responds to the event:

desktop_shell_set_lock_surface() / desktop_shell_unlock()
wlsc_compositor_wake()
no-op, because idle_inhibit > 0

Fix this by removing the idle_inhibit check from wlsc_compositor_wake().
The optimization did not work for pointer motion while no keys pressed,
anyway, so the performance hit is probably unobservable.

Now the compositor wakes up also on key or button press.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: let the shell wake up the compositor
Kristian Høgsberg [Tue, 15 Nov 2011 11:34:49 +0000 (13:34 +0200)]
compositor: let the shell wake up the compositor

When compositor enters SLEEPING state, the shell plugin goes locked. If
compositor wakes up itself, it will fade in while the shell may not yet
have a lock surface to show.

Fix this by assigning wake-up to be called from the shell, if the
compositor is SLEEPING. The shell may wait for the lock surface request,
and only then wake up the compositor. The compositor will fade in
directly to the lock screen.

krh: original patch for compositor.c
ppaalanen: integration and shell.c changes

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agodesktop-shell: screen locking protocol
Pekka Paalanen [Tue, 15 Nov 2011 11:34:48 +0000 (13:34 +0200)]
desktop-shell: screen locking protocol

Add protocol and functions for supporting screen locking, triggered by
activity timeout.

After activity timeout, compositor starts the fade to black, and then
enters SLEEPING state. At that point it calls lock() in the shell
plugin.

When input events trigger a wakeup, unlock() in the shell plugin is
called. This sends prepare_lock_surface event to the desktop-shell
client. The screen stays locked while the compositor starts fade-in.

At this point, desktop-shell client usually creates a surface for the
unlocking GUI (e.g. a password prompt), and sends it with the
set_lock_surface request. The compositor supposedly shows and allows
interaction only with the given lock surface (not yet implemented).

When desktop-shell has authenticated the user, or instead of issuing
set_lock_surface, it sends the unlock request. Upon receiving the unlock
request, the shell plugin unlocks the screen.

If desktop-shell client dies, the screen is unlocked automatically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: Hold on to surface.frame requests until we assign an output
Kristian Høgsberg [Tue, 15 Nov 2011 18:50:21 +0000 (13:50 -0500)]
compositor: Hold on to surface.frame requests until we assign an output

We can't just throw away the callback, so hold on to the requests until
we have an output for the surface.

2 years agocompositor: Drop unused wlsc_output field 'background'
Kristian Høgsberg [Tue, 15 Nov 2011 16:57:54 +0000 (11:57 -0500)]
compositor: Drop unused wlsc_output field 'background'

2 years agocompositor: fix destroy_frame_callback()
Pekka Paalanen [Tue, 15 Nov 2011 09:45:42 +0000 (11:45 +0200)]
compositor: fix destroy_frame_callback()

Pass the correct pointer to free().

This is just a cosmetic change, because 'resource' happens to be the
first member in wlsc_frame_callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoconfig: fix boolean parsing
Pekka Paalanen [Tue, 15 Nov 2011 09:45:41 +0000 (11:45 +0200)]
config: fix boolean parsing

The rest of the line contains the newline, so cannot match simply 'true'
or 'false'.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agoconfig: Don't print warning when XDG_CONFIG_HOME isn't set
Kristian Høgsberg [Tue, 15 Nov 2011 14:01:42 +0000 (09:01 -0500)]
config: Don't print warning when XDG_CONFIG_HOME isn't set

According to the spec, it's ok for this not to be set and just means that
we should default to $HOME/.config.

2 years agowindow: add a helper for config file paths
Pekka Paalanen [Tue, 15 Nov 2011 09:45:40 +0000 (11:45 +0200)]
window: add a helper for config file paths

Add a helper function, that constructs a path to a config file from
XDG_CONFIG_HOME environment variable, by the rules of
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Make desktop-shell find its config file from XDG_CONFIG_HOME. This
allows to have a personal config file without continuously fighting with
git about wayland-desktop-shell.ini.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agodesktop-shell: Add sample ini file
Kristian Høgsberg [Tue, 15 Nov 2011 03:56:50 +0000 (22:56 -0500)]
desktop-shell: Add sample ini file

2 years agowindow: Add a cheesy parser for ini-files, use it in desktop-shell
Kristian Høgsberg [Tue, 15 Nov 2011 03:43:37 +0000 (22:43 -0500)]
window: Add a cheesy parser for ini-files, use it in desktop-shell

2 years agoDe-brand the tablet shell
Kristian Høgsberg [Mon, 14 Nov 2011 20:50:03 +0000 (15:50 -0500)]
De-brand the tablet shell

Drop the MeeGo part of the name.

2 years agoInstall desktop-shell in $prefix/libexec
Kristian Høgsberg [Mon, 14 Nov 2011 19:57:17 +0000 (14:57 -0500)]
Install desktop-shell in $prefix/libexec

2 years agocompositor: Drop redundant compositor->damage
Kristian Høgsberg [Fri, 11 Nov 2011 16:48:12 +0000 (11:48 -0500)]
compositor: Drop redundant compositor->damage

This is the same as the damage of the top-level surface so just use that.
There's a problem that if we change the stacking, the damage layering breaks,
but that's a problem we already have.

2 years agoshell: Set initial toplevel position in map callback
Kristian Høgsberg [Wed, 9 Nov 2011 17:38:53 +0000 (12:38 -0500)]
shell: Set initial toplevel position in map callback

2 years agocompositor: Split shell->attach into map and configure
Kristian Høgsberg [Wed, 9 Nov 2011 17:07:35 +0000 (12:07 -0500)]
compositor: Split shell->attach into map and configure

The shell module only needs to deal with attach when it's either the initial
attach or when the attach changes the size of the surface.  In case of
initial attach, the shell needs to pick a position for the surface and a
place in the surface stack.  We split this case out as a new shell->map
callback.  The other case is split into the shell->configure callback,
where the shell may adjust the surface position or reject the new size.

2 years agocompositor-drm: Fix setting O_CLOEXEC
David Herrmann [Sat, 5 Nov 2011 17:46:01 +0000 (18:46 +0100)]
compositor-drm: Fix setting O_CLOEXEC

The third parameter of open() is for file-creation modes. File flags are passed
in the second paramater.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2 years agocompositor: only authorized client can bind desktop_shell
Pekka Paalanen [Thu, 3 Nov 2011 12:11:33 +0000 (14:11 +0200)]
compositor: only authorized client can bind desktop_shell

Check, that only the desktop-shell client spawned by the compositor
(desktop-shell plugin) is allowed to bind to desktop_shell interface.
Other clients will receive an error like:

  wl_display@1.error(desktop_shell@20, 0,
  "permission to bind desktop_shell denied")

The error has the proper object id and interface type.

Note: desktop-shell cannot be started manually anymore, it has to be
started by the compositor automatically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agodesktop-shell: launch from the compositor
Pekka Paalanen [Thu, 3 Nov 2011 12:11:32 +0000 (14:11 +0200)]
desktop-shell: launch from the compositor

Fork and exec desktop-shell in the compositor. This is a way to create
an authenticated client. Later, the desktop-shell interface will be
reserved for this client only.

For exec to work, the compositor should be started from the
wayland-demos' root directory.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor-*: check for surfaceless_gles2 instead of surfaceless_opengl
Ander Conselvan de Oliveira [Tue, 1 Nov 2011 14:37:41 +0000 (16:37 +0200)]
compositor-*: check for surfaceless_gles2 instead of surfaceless_opengl

All the compositors are using GLES2 so check for the appropriate
surfaceless extension.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agocompositor: Tweak fade spring to not overshoot
Kristian Høgsberg [Sat, 29 Oct 2011 19:04:42 +0000 (15:04 -0400)]
compositor: Tweak fade spring to not overshoot

2 years agocompositor-x11: Call finish_frame from a timer callback
Kristian Høgsberg [Sat, 29 Oct 2011 18:39:13 +0000 (14:39 -0400)]
compositor-x11: Call finish_frame from a timer callback

The repaint logic breaks when finish_frame is called from the present
callback.  Ideally we should throttle to vsync (or even better, the
compositor repaint cycle, but hey, X is X), but this goes a long way.

2 years agocompositor: Make spring model always use the same time step
Kristian Høgsberg [Sat, 29 Oct 2011 17:41:18 +0000 (13:41 -0400)]
compositor: Make spring model always use the same time step

2 years agocompositor: Clear cursor buffer in create_sprite_from_png()
Kristian Høgsberg [Sat, 29 Oct 2011 00:41:28 +0000 (20:41 -0400)]
compositor: Clear cursor buffer in create_sprite_from_png()

2 years agocomposior: fix tiny cursor bug with drm compositor
Ander Conselvan de Oliveira [Thu, 27 Oct 2011 14:09:17 +0000 (17:09 +0300)]
composior: fix tiny cursor bug with drm compositor

The drm compositor always creates a 64x64 bo for the cursor image
regardless of the size of the actual cursor. When the fade animation
kicks in it disables the hardware cursor so that it is rendered as a
regular surface. This surface is rendered to a 32x32 region but using
a 64x64 texture so the cursor gets scaled down.

Fix this by making create_cursor_image return the actual size of the
image created to the compositor.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agoUpdate .gitignores
Casey Dahlin [Tue, 25 Oct 2011 22:58:56 +0000 (18:58 -0400)]
Update .gitignores

2 years agoevdev: Simplify error path for device creation
Tiago Vignatti [Fri, 28 Oct 2011 17:15:25 +0000 (13:15 -0400)]
evdev: Simplify error path for device creation

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: Delete unused fields from evdev_input_device
Tiago Vignatti [Fri, 28 Oct 2011 17:09:42 +0000 (13:09 -0400)]
evdev: Delete unused fields from evdev_input_device

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agoevdev: Add hotplug support
Tiago Vignatti [Fri, 28 Oct 2011 17:05:06 +0000 (13:05 -0400)]
evdev: Add hotplug support

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2 years agocompositor: page flip away from a client buffer if it's destroyed
Ander Conselvan de Oliveira [Wed, 26 Oct 2011 13:48:45 +0000 (16:48 +0300)]
compositor: page flip away from a client buffer if it's destroyed

If the current or pending scanout buffer is destroyed, the client frame
will remain being displayed until something else causes a repaint to be
scheduled.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agoMerge remote-tracking branch 'robster/rob/pointer-fixes'
Kristian Høgsberg [Tue, 25 Oct 2011 13:07:12 +0000 (09:07 -0400)]
Merge remote-tracking branch 'robster/rob/pointer-fixes'

2 years agocompositor: Report an error if we cannot the load the pointer image files
Rob Bradford [Tue, 25 Oct 2011 12:43:44 +0000 (13:43 +0100)]
compositor: Report an error if we cannot the load the pointer image files

2 years agocompositor: Don't try and use a NULL sprite for the device pointer
Rob Bradford [Tue, 25 Oct 2011 12:38:31 +0000 (13:38 +0100)]
compositor: Don't try and use a NULL sprite for the device pointer

If loading the pointer images to the sprites fails then do not try and use
those NULL sprites for the pointer.

2 years agowindow: Avoid setting an invalid surface for the pointer
Rob Bradford [Tue, 25 Oct 2011 11:20:51 +0000 (12:20 +0100)]
window: Avoid setting an invalid surface for the pointer

If we failed to load the pointer image to the surface then do not create a
buffer from a NULL surface and do not attach that to the device.

2 years agowindow: Report an error if we cannot load the pointer files
Rob Bradford [Tue, 25 Oct 2011 11:19:36 +0000 (12:19 +0100)]
window: Report an error if we cannot load the pointer files

2 years agocompositor: Clean up resource destroy callback handling factory-1235.B factory-1284.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B
Kristian Høgsberg [Mon, 24 Oct 2011 21:51:02 +0000 (17:51 -0400)]
compositor: Clean up resource destroy callback handling

2 years agocompositor: fix drag segfault
Pekka Paalanen [Mon, 24 Oct 2011 14:34:53 +0000 (17:34 +0300)]
compositor: fix drag segfault

Without this fix, the dnd demo would make the demo compositor crash in
shell.c:drag_offer() because resource->data is NULL.

Initialise resource->data in shell_create_drag().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2 years agocompositor: fix whitespace error in wlsc_output_set_cursor
Ander Conselvan de Oliveira [Mon, 24 Oct 2011 13:30:15 +0000 (16:30 +0300)]
compositor: fix whitespace error in wlsc_output_set_cursor

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agocompositor: don't schedule idle_repaint from calls to repaint
Ander Conselvan de Oliveira [Mon, 24 Oct 2011 13:30:14 +0000 (16:30 +0300)]
compositor: don't schedule idle_repaint from calls to repaint

wlsc_output_repaint may call wlsc_surface_damage indirectly through
wlsc_output_set_cursor. If this happens in the call made from repaint,
one ends up with repaint being called from both idle_repaint and
wlsc_output_finish_frame.

Fix this by setting output->repaint_scheduled to 1 before calling
wlsc_output_repaint in the function repaint.

[krh] Edited to just only clear repaint_scheduled, when we no longer have
a repaint scheduled.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agodrm: Only add an output once we've successfully initialized it
Kristian Høgsberg [Mon, 24 Oct 2011 17:26:32 +0000 (13:26 -0400)]
drm: Only add an output once we've successfully initialized it

2 years agodrm: Remove unneccesary drm_output_prepare_render() call
Kristian Høgsberg [Mon, 24 Oct 2011 17:23:07 +0000 (13:23 -0400)]
drm: Remove unneccesary drm_output_prepare_render() call

2 years agodrm: Specify depth as 24 when creating the KMS FB
Kristian Høgsberg [Mon, 24 Oct 2011 17:13:22 +0000 (13:13 -0400)]
drm: Specify depth as 24 when creating the KMS FB

At least intel kms rejects depth 32 now, and 24 is want we want.

2 years agocompositor: Rename scanout surfaces
Kristian Høgsberg [Thu, 20 Oct 2011 21:51:45 +0000 (17:51 -0400)]
compositor: Rename scanout surfaces

Let's call the surface that's about to be pageflipped 'pending' and the
one we're currently showing 'scanout'.

2 years agocompositor: don't release the front buffer after page flip
Ander Conselvan de Oliveira [Tue, 18 Oct 2011 14:02:07 +0000 (17:02 +0300)]
compositor: don't release the front buffer after page flip

On repaint, wlsc_output_repaint will replace output->scanout_buffer with
the new front buffer and then output->present() will cause this buffer
to be displayed. When wlsc_output_finish_frame is called, the
compositor will send a release buffer event for output->scanout_buffer
which is actually the front buffer now.

This patch changes this code to release the previous scanout_buffer
instead of the front buffer on wlsc_output_finish_frame.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agocompositor: move setup of scanout surface out of wlsc_output_repaint
Ander Conselvan de Oliveira [Tue, 18 Oct 2011 14:02:06 +0000 (17:02 +0300)]
compositor: move setup of scanout surface out of wlsc_output_repaint

Move this to a separate function to better accommodate changes in the
following commit.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2 years agoAdd missing include for gio.h.
Eugeni Dodonov [Mon, 24 Oct 2011 15:49:38 +0000 (13:49 -0200)]
Add missing include for gio.h.

This is needed by GFile, used by view.c.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
3 years agocairo-util: Fix another last-minute typo
Kristian Høgsberg [Thu, 20 Oct 2011 18:44:48 +0000 (14:44 -0400)]
cairo-util: Fix another last-minute typo

3 years agocairo-util: Add helper to load jpeg files
Kristian Høgsberg [Thu, 20 Oct 2011 17:11:12 +0000 (13:11 -0400)]
cairo-util: Add helper to load jpeg files

3 years agosimple-egl: Remove leftover wl_visual variable
Kristian Høgsberg [Thu, 20 Oct 2011 01:16:58 +0000 (21:16 -0400)]
simple-egl: Remove leftover wl_visual variable

3 years agocompositor: Silence a couple of valgrind warnings
Kristian Høgsberg [Wed, 12 Oct 2011 20:29:31 +0000 (16:29 -0400)]
compositor: Silence a couple of valgrind warnings

3 years agocompositor: Dont repick for grabbed surfaces
Kristian Høgsberg [Wed, 12 Oct 2011 04:36:54 +0000 (00:36 -0400)]
compositor: Dont repick for grabbed surfaces

3 years agodesktop-shell: Add beginning of pop-up menu to panel
Kristian Høgsberg [Wed, 12 Oct 2011 04:36:16 +0000 (00:36 -0400)]
desktop-shell: Add beginning of pop-up menu to panel

3 years agox11: Fix last-minute edit bug
Kristian Høgsberg [Wed, 12 Oct 2011 04:01:18 +0000 (00:01 -0400)]
x11: Fix last-minute edit bug

3 years agox11: Manage xserver focus better
Kristian Høgsberg [Wed, 12 Oct 2011 03:41:17 +0000 (23:41 -0400)]
x11: Manage xserver focus better