profile/ivi/weston-ivi-shell.git
12 years agocompositor: Don't hardcode output transform when sending the event
Kristian Høgsberg [Fri, 10 Aug 2012 14:09:20 +0000 (10:09 -0400)]
compositor: Don't hardcode output transform when sending the event

We add a transform field to weston_output and backends can override it
when they create the output.

12 years agocompositor: Remove compositor->seat
Kristian Høgsberg [Fri, 10 Aug 2012 14:08:21 +0000 (10:08 -0400)]
compositor: Remove compositor->seat

Get rid of this quick-and-dirty assumption.

12 years agozoom: Pick the first seat in seat_list instead of compositor->seat
Kristian Høgsberg [Fri, 10 Aug 2012 14:07:55 +0000 (10:07 -0400)]
zoom: Pick the first seat in seat_list instead of compositor->seat

12 years agoxwm: Use a simple heuristic for mapping X input events to a weston seat
Kristian Høgsberg [Fri, 10 Aug 2012 14:06:59 +0000 (10:06 -0400)]
xwm: Use a simple heuristic for mapping X input events to a weston seat

12 years agoshell: Track pointer focus for all seats
Kristian Høgsberg [Fri, 10 Aug 2012 14:05:39 +0000 (10:05 -0400)]
shell: Track pointer focus for all seats

12 years agocompositor-x11: Move X11 core input seat into x11_compositor
Kristian Høgsberg [Fri, 10 Aug 2012 14:04:36 +0000 (10:04 -0400)]
compositor-x11: Move X11 core input seat into x11_compositor

There can only ever be one of these, but keep that assumption in the
X11 backend.

12 years agocompositor-wayland: Move weston_seat into wayland_input
Kristian Høgsberg [Fri, 10 Aug 2012 14:01:33 +0000 (10:01 -0400)]
compositor-wayland: Move weston_seat into wayland_input

12 years agocompositor: Drop output->flags
Kristian Høgsberg [Fri, 10 Aug 2012 13:57:56 +0000 (09:57 -0400)]
compositor: Drop output->flags

All outputs are EGLSurface based so we can drop this detail now.

12 years agocompositor-drm: Fix bad rebase
Kristian Høgsberg [Thu, 9 Aug 2012 21:19:23 +0000 (17:19 -0400)]
compositor-drm: Fix bad rebase

I failed to compile test my rebase of Robs compositor-drm fixes.

12 years agoshell: move input panels into a designated layer
Philipp Brüschweiler [Thu, 9 Aug 2012 16:50:43 +0000 (18:50 +0200)]
shell: move input panels into a designated layer

This makes the separation between panels and input panels clearer and
prevents the (desktop) panel from removing existing input panels on
redraw.

The input panel layer is below the panel layer.

12 years agocompositor-drm: don't keep trying if hw doesn't support cursors
Rob Clark [Thu, 9 Aug 2012 18:24:45 +0000 (13:24 -0500)]
compositor-drm: don't keep trying if hw doesn't support cursors

Not all hw supports hw cursors.  Similar to the case with sprites, if
the driver does not support it, don't keep trying and spamming the log
with error messages.

Signed-off-by: Rob Clark <rob@ti.com>
12 years agocompositor-drm: don't attempt sprite for out of bounds dimensions
Rob Clark [Thu, 9 Aug 2012 19:18:28 +0000 (14:18 -0500)]
compositor-drm: don't attempt sprite for out of bounds dimensions

The drmModeAddFB2() call will fail anyways, and cause us to unnecessarily
set sprites_are_broken.

Signed-off-by: Rob Clark <rob@ti.com>
12 years agocompositor-drm: skip overlay for shm buffers
Rob Clark [Thu, 9 Aug 2012 19:18:27 +0000 (14:18 -0500)]
compositor-drm: skip overlay for shm buffers

They can't be imported by gbm, so no point in trying, and segfaulting
in gbm when we try to import (because it tries to deref the buffer as
a wl_drm_buffer).

Signed-off-by: Rob Clark <rob@ti.com>
12 years agocompositor-drm: Return the newly added mode in drm_output_add_mode()
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:45:00 +0000 (16:45 +0300)]
compositor-drm: Return the newly added mode in drm_output_add_mode()

Most of the times the caller will look at the output's mode list to get
the new mode, so just return that instead.

12 years agocompositor-drm: Check for OUTPUT_CONFIG_OFF instead of using strcmp()
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:45:01 +0000 (16:45 +0300)]
compositor-drm: Check for OUTPUT_CONFIG_OFF instead of using strcmp()

A call to strcmp() is already made in output_section_done() and
output->config is set appropriately if mode is "off". There is
no need to duplicate that in create_output_for_connector().

12 years agoshell: Fix repaint debugging
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:44:59 +0000 (16:44 +0300)]
shell: Fix repaint debugging

Since weston_surface_update_transform() was changed so it called
surface_damage_below() instead of surface_damage(), the trick of
clearing the surface damage did not work anymore.

Fix this by moving the repaint surface to a special plane before
calling update_transform. The move is made manually (as opposed to
calling weston_surface_move_to_plane()) to avoid the call to
weston_surface_damage_below(). The transform update causes the
damage to be added to this special plane, which is simply ignored.
After the geometry.dirty bit is clear, the surface is moved back to
the primary plane.

12 years agocompositor: When redrawing, don't clip opaque regions from other planes
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:44:58 +0000 (16:44 +0300)]
compositor: When redrawing, don't clip opaque regions from other planes

When accumulating damage in the repaint loop, the opaque region of
surfaces in other planes is added to the overall opaque region. This
causes surface->clip to contain the areas obscured by surfaces in
other planes. Change it to contain only the opaque region of surfaces
in the primary plane

This fixes a bug where moving a window that was just moved from the
primary plane to another would leave artifacts on the screen. The
problem was that the damage generated by weston_surface_move_to_plane()
would be clipped on weston_surface_redraw(), leaving the contets below
it unchanged. Moving the overlaid surface would no longer generate
damage on the primary plane, so the contents would remain unchanged
(i.e. wrong) indefinitely.

12 years agospring: Avoid excessive calculation loops for the spring values
Rob Bradford [Thu, 9 Aug 2012 14:35:49 +0000 (15:35 +0100)]
spring: Avoid excessive calculation loops for the spring values

To handle the case where wall clock time jumps forwards by a large amount or
backwards limit the execution of the spring calculation loop.

We do this by forcing the spring update timestamp to being no older that 1s of
the most current time we've been given. We also present a log message if the
timestamp jumps more than expected.

12 years agocompositor-drm: handle vblanks on secondary crtc
Rob Clark [Thu, 9 Aug 2012 01:27:37 +0000 (20:27 -0500)]
compositor-drm: handle vblanks on secondary crtc

Signed-off-by: Rob Clark <rob@ti.com>
12 years agoimage: Don't segfault when the file doesn't exist
Juan Zhao [Tue, 7 Aug 2012 02:45:43 +0000 (19:45 -0700)]
image: Don't segfault when the file doesn't exist

Don't create a window when the file doesn't exist.

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

12 years agoshell: don't abuse link_layer for keeping track of input panel surfaces
Philipp Brüschweiler [Mon, 6 Aug 2012 11:44:42 +0000 (13:44 +0200)]
shell: don't abuse link_layer for keeping track of input panel surfaces

Input panel surfaces were kept in a list by using layer_link of
weston_surface. This was pretty hacky and resulted in the bug that
an input panel surface was not removed from the list if it was unmapped
at the time of destruction.

This patch wraps the surface in a new input_panel_surface struct and
properly handles destruction with a signal listener.

12 years agoevdev: rename evdev_input_device to evdev_device
Pekka Paalanen [Mon, 6 Aug 2012 11:57:08 +0000 (14:57 +0300)]
evdev: rename evdev_input_device to evdev_device

As said by krh: "Maybe we should also just call it an evdev_device
instead, shorter [and] not really ambiguous."

[krh: if my typo filled irc is going in a commit message, I'm at least going
to insert the missing words.]

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: do not pass a list to evdev_led_update()
Pekka Paalanen [Mon, 6 Aug 2012 11:57:07 +0000 (14:57 +0300)]
evdev: do not pass a list to evdev_led_update()

evdev_led_update() does not really need the whole list of device at
once, it can be called one device at a time.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: fix weston_log format warnings
Pekka Paalanen [Mon, 6 Aug 2012 11:57:06 +0000 (14:57 +0300)]
compositor: fix weston_log format warnings

compositor.c: In function ‘log_extensions’:
compositor.c:3085:7: warning: field precision should have type ‘int’,
but argument 2 has type ‘long int’
compositor.c:3087:4: warning: field precision should have type ‘int’,
but argument 2 has type ‘long int’

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm: fix weston_log format errors
Pekka Paalanen [Mon, 6 Aug 2012 11:57:05 +0000 (14:57 +0300)]
compositor-drm: fix weston_log format errors

compositor-drm.c: In function 'drm_output_set_cursor':
compositor-drm.c:754:4: warning: too few arguments for format
compositor-drm.c:759:4: warning: too few arguments for format

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: format check for weston_log arguments
Pekka Paalanen [Mon, 6 Aug 2012 11:57:04 +0000 (14:57 +0300)]
compositor: format check for weston_log arguments

Add gcc format check attribute to the weston_log() and
weston_log_continue() functions.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor: log program launches
Pekka Paalanen [Mon, 6 Aug 2012 11:57:03 +0000 (14:57 +0300)]
compositor: log program launches

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-x11: Always free output_mode on error.
Scott Moreau [Mon, 6 Aug 2012 07:27:06 +0000 (01:27 -0600)]
compositor-x11: Always free output_mode on error.

12 years agoconfig-parser: Handle lines that don't end in \n
Kristian Høgsberg [Sat, 4 Aug 2012 01:56:41 +0000 (21:56 -0400)]
config-parser: Handle lines that don't end in \n

If the last line in a config file doesn't have a newline
we end up chopping off the last character from that line.

12 years agocompositor-x11: Allow output configuration from config file.
Scott Moreau [Fri, 3 Aug 2012 20:19:52 +0000 (14:19 -0600)]
compositor-x11: Allow output configuration from config file.

This patch provides a way to define outputs for the x11 backend. It
parses [output] sections and checks for 'name' and 'mode' keys. The
'name' must start with an 'X' to distinguish from drm output names.
Command line options --width and --height supersede what is in the
config file. When --output-count is passed, the number of outputs
are limited or additional outputs added with default values.

12 years agocompositor: Always set output_mask in weston_surface_update_output_mask().
Scott Moreau [Fri, 3 Aug 2012 23:11:51 +0000 (17:11 -0600)]
compositor: Always set output_mask in weston_surface_update_output_mask().

Commit 982387011 causes a bug where starting weston results in a black screen
(if no clients are immediately started). The problem is that the offending
commit causes the compositor to not damage if a surface has an empty output
mask, which is the case for the fade surface, which is created by the
compositor.  This patch updates the surface output_mask unconditionally,
and only skips sending out the events if there no client.

12 years agoshell: Make sure the black surface is opaque
Kristian Høgsberg [Fri, 3 Aug 2012 20:31:36 +0000 (16:31 -0400)]
shell: Make sure the black surface is opaque

So we don't repaint anything below it.

12 years agocompositor: Add weston_surface_schedule_repaint() for limited repaint
Kristian Høgsberg [Fri, 3 Aug 2012 20:29:12 +0000 (16:29 -0400)]
compositor: Add weston_surface_schedule_repaint() for limited repaint

In cases where we know the surface bounding box doesn't change in the
next frame, we can limit redraws to only the outputs the surface is
currently on.  We could do even better by forcing the transform
update so we know where the surface will be in the next frame, but
this is a much simpler first step.

12 years agocompositor-drm: Disable planes when zoomed or capturing
Kristian Høgsberg [Fri, 3 Aug 2012 19:45:23 +0000 (15:45 -0400)]
compositor-drm: Disable planes when zoomed or capturing

When the entire output is transformed or we're capturing the output
for screenshot or video, disable all output specific overlays
(drm planes, hw cursors etc) and move all surfaces into the primary
plane.

12 years agosimple-egl: Add help message
Kristian Høgsberg [Fri, 3 Aug 2012 19:29:08 +0000 (15:29 -0400)]
simple-egl: Add help message

12 years agosimple-egl: Set opaque region when running opaque
Kristian Høgsberg [Fri, 3 Aug 2012 19:27:14 +0000 (15:27 -0400)]
simple-egl: Set opaque region when running opaque

12 years agoconfigure: make setbacklight optional
Pekka Paalanen [Fri, 3 Aug 2012 11:39:16 +0000 (14:39 +0300)]
configure: make setbacklight optional

Modify the pkg-config check for setbacklight so that failure only
disables building setbacklight, instead of failing the whole configure.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agodesktop-shell: use the standard 'environ' variable
Pekka Paalanen [Fri, 3 Aug 2012 11:39:15 +0000 (14:39 +0300)]
desktop-shell: use the standard 'environ' variable

The variable '__environ' seems to be libc implementation specific, and
not avaible on Android.

Use the POSIX standard variable 'environ', which also luckily happens to
be available on Android, which is not POSIX.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: kill a warning in evdev_led_update()
Pekka Paalanen [Fri, 3 Aug 2012 11:39:14 +0000 (14:39 +0300)]
evdev: kill a warning in evdev_led_update()

evdev.c: In function 'evdev_led_update':
evdev.c:57:9: warning: ignoring return value of 'write', declared with
attribute warn_unused_result

Useless in this case.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoandroid: add basic evdev input support
Pekka Paalanen [Fri, 3 Aug 2012 11:39:13 +0000 (14:39 +0300)]
android: add basic evdev input support

Android backend needs mtdev now, and evdev-touchpad.c, too.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm, evdev: don't crash on missing keyboard
Pekka Paalanen [Fri, 3 Aug 2012 11:39:11 +0000 (14:39 +0300)]
compositor-drm, evdev: don't crash on missing keyboard

Weston's notify_keyboard_focus_*() assume that a keyboard is present, if
they are called. With evdev, there might not always be a keyboard.

Also clean up the variable definition in evdev_notify_keyborad_focus().
I read that function through many times and finally had to grep where
does 'all_keys' come from.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm: log enter/leave VT
Pekka Paalanen [Fri, 3 Aug 2012 11:39:10 +0000 (14:39 +0300)]
compositor-drm: log enter/leave VT

All input devices are re-added during enter VT, so these messages in the
log will clarify what happened with input.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm: log input device hot-unplugs
Pekka Paalanen [Fri, 3 Aug 2012 11:39:09 +0000 (14:39 +0300)]
compositor-drm: log input device hot-unplugs

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm: fix leak in evdev_udev_handler()
Pekka Paalanen [Fri, 3 Aug 2012 11:39:08 +0000 (14:39 +0300)]
compositor-drm: fix leak in evdev_udev_handler()

If the sysname of the udev device did not start with "event", the
function returned without unreferencing udev_device.

The function is refactored to have a common exit path that unrefs
udev_device. The return value semantics are not changed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: log input devices
Pekka Paalanen [Fri, 3 Aug 2012 11:39:07 +0000 (14:39 +0300)]
evdev: log input devices

Write information about found input devices into the log. Also fetch and
record the device name.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: move udev code into compositor-drm.c
Pekka Paalanen [Fri, 3 Aug 2012 17:30:30 +0000 (13:30 -0400)]
evdev: move udev code into compositor-drm.c

Move all udev-related and now drm backend specific code into
compositor-drm.c.

This makes evdev.c free of udev and launcher-util, and allows it to be
used on Android.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: expose the generic evdev API
Pekka Paalanen [Fri, 3 Aug 2012 11:39:05 +0000 (14:39 +0300)]
evdev: expose the generic evdev API

This API does not depend on udev or launcher-util.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: rename evdev_seat to drm_seat
Pekka Paalanen [Fri, 3 Aug 2012 11:39:04 +0000 (14:39 +0300)]
evdev: rename evdev_seat to drm_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: pass weston_seat to evdev_input_device_create()
Pekka Paalanen [Fri, 3 Aug 2012 11:39:03 +0000 (14:39 +0300)]
evdev: pass weston_seat to evdev_input_device_create()

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: make evdev_notify_keyboard_focus() independent of evdev_seat
Pekka Paalanen [Fri, 3 Aug 2012 11:39:02 +0000 (14:39 +0300)]
evdev: make evdev_notify_keyboard_focus() independent of evdev_seat

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: make evdev_led_update independent from struct evdev_seat
Pekka Paalanen [Fri, 3 Aug 2012 11:39:01 +0000 (14:39 +0300)]
evdev: make evdev_led_update independent from struct evdev_seat

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: change evdev_seat into weston_seat in struct evdev_input_device
Pekka Paalanen [Fri, 3 Aug 2012 11:39:00 +0000 (14:39 +0300)]
evdev: change evdev_seat into weston_seat in struct evdev_input_device

We are phasing out struct evdev_seat.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: merge evdev-private.h into evdev.h
Pekka Paalanen [Fri, 3 Aug 2012 11:38:59 +0000 (14:38 +0300)]
evdev: merge evdev-private.h into evdev.h

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: move device opening out from evdev_input_device_create
Pekka Paalanen [Fri, 3 Aug 2012 11:38:58 +0000 (14:38 +0300)]
evdev: move device opening out from evdev_input_device_create

This makes the generic evdev code (i.e. the functions not relying on
udev) independent of launcher-util too. The aim is to allow re-using the
generic evdev code in the Android backend, where neither udev nor
launcher-util are available.

evdev_input_device_create() signature is changed:
- add the opened device file descriptor
- remove wl_display as unused

Also add a bit of failure logging.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: rename device_removed() to evdev_input_device_destroy()
Pekka Paalanen [Fri, 3 Aug 2012 11:38:57 +0000 (14:38 +0300)]
evdev: rename device_removed() to evdev_input_device_destroy()

evdev_input_device_destroy() will completement the API of
evdev_input_device_create(), both being independent from udev.

Since the udev-specific device_removed() would only call
evdev_input_device_destroy() and do nothing else, device_remove() calls
are simply replaced with evdev_input_device_destroy().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agospring: Avoid looping if time appears to be going backwards
Rob Bradford [Fri, 3 Aug 2012 16:02:04 +0000 (17:02 +0100)]
spring: Avoid looping if time appears to be going backwards

Since the time values are unsigned integers we can check whether the msec is
smaller than spring->timestamp by checking if the subtraction overflows into a
value greater than half the maximum unsigned integer range (ie. top bit set)

12 years agoterminal: Don't crash on non-ascii chars
Andre Heider [Thu, 2 Aug 2012 18:59:43 +0000 (20:59 +0200)]
terminal: Don't crash on non-ascii chars

isalpha() and isdigit() don't like huge values.
Noticed with ascii-art in the shell prompt.

12 years agocompositor-drm: Split cursor handling into prepare and set
Kristian Høgsberg [Fri, 3 Aug 2012 15:50:05 +0000 (11:50 -0400)]
compositor-drm: Split cursor handling into prepare and set

Like how we handle overlays, we split drm_output_set_cursor() into
drm_output_prepare_cursor_surface() that will assign the hw cursor to
a suitable surface and drm_output_set_cursor() that will do the actual
work of updating cursor contents and moving it.  This is more in line
with how we handle everything else, and lets us update cursor contents
based on changes to the cursor plane damage.

This works when the cursor content changes but also accumulates
damage when the cursor changes output.  In that case we move the
cursor surface to the cursor plane in the new output and
weston_surface_move_to_plane() will generate the damage that triggers
download of sprite contents there.

12 years agocompositor: Accumulate damage per plane
Kristian Høgsberg [Fri, 3 Aug 2012 15:30:18 +0000 (11:30 -0400)]
compositor: Accumulate damage per plane

When we analyze and accumulate damage prior to repainting, we need to
accumulate damage per plane, so that whatever damage a surface
contributes is accumulated in the plane that it's assigned to.  Before,
we would always accumulate damge in the primary plane, which caused
repaints in the primary plane whenever a surface in a sprite or
framebuffer was damaged.  Eliminating this repaint is a big win for
cases where we pageflip to a client surface or use a sprite overlay.

This also prepares for fixing the missing cursor updates, since we
now track damage to the cursor surface in a dedicated sprite plane.

12 years agoterminal: Don't output @ for ASCII NUL
Kristian Høgsberg [Fri, 3 Aug 2012 13:37:05 +0000 (09:37 -0400)]
terminal: Don't output @ for ASCII NUL

Fixes visual bell in screen.

12 years agocompositor: Use uint32_t for the msecs value consistently
Rob Bradford [Thu, 2 Aug 2012 14:36:57 +0000 (15:36 +0100)]
compositor: Use uint32_t for the msecs value consistently

12 years agocompositor: remove OpenWFD backend
Pekka Paalanen [Wed, 1 Aug 2012 13:34:58 +0000 (16:34 +0300)]
compositor: remove OpenWFD backend

This backend has not seen even build testing for months, presumably does
not even compile, and is starting to hinder development a little.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Benjamin Franzke <benjaminfranzke@googlemail.com>
12 years agocompositor: Don't allow setting a NULL cursor without pointer focus
Kristian Høgsberg [Wed, 1 Aug 2012 13:46:12 +0000 (09:46 -0400)]
compositor: Don't allow setting a NULL cursor without pointer focus

12 years agowindow.c: Use pointer enter serial for setting cursor
Kristian Høgsberg [Wed, 1 Aug 2012 13:41:08 +0000 (09:41 -0400)]
window.c: Use pointer enter serial for setting cursor

12 years agocompositor: Check serial number ordering without overflowing
Kristian Høgsberg [Wed, 1 Aug 2012 13:39:11 +0000 (09:39 -0400)]
compositor: Check serial number ordering without overflowing

12 years agoProperly free drm configured mode variables.
Scott Moreau [Wed, 1 Aug 2012 04:29:56 +0000 (22:29 -0600)]
Properly free drm configured mode variables.

12 years agoshell: Make it possible to move and raise unresponsive surfaces
Kristian Høgsberg [Wed, 1 Aug 2012 04:20:21 +0000 (00:20 -0400)]
shell: Make it possible to move and raise unresponsive surfaces

12 years agoshell: Move surface move code back to just after the move grab functions
Kristian Høgsberg [Wed, 1 Aug 2012 04:08:07 +0000 (00:08 -0400)]
shell: Move surface move code back to just after the move grab functions

This chunk of code is what uses the move grab and used to come right
after it.  At some point it got split up, but move it back now.

12 years agocompositor: Fold the log prototypes into compositor.h and drop log.h
Kristian Høgsberg [Wed, 1 Aug 2012 04:00:57 +0000 (00:00 -0400)]
compositor: Fold the log prototypes into compositor.h and drop log.h

We're trying to keep the API exposed by the core compositor in compositor.h

12 years agoAdd raw modeline support.
Scott Moreau [Tue, 31 Jul 2012 21:30:41 +0000 (15:30 -0600)]
Add raw modeline support.

This allows specifying a modeline in the config for the 'mode' key
in the output section, such as one you would get from cvt.

12 years agoconfigure: link image libs with libshared
Tiago Vignatti [Tue, 31 Jul 2012 12:47:48 +0000 (15:47 +0300)]
configure: link image libs with libshared

This fix xwayland.so that was complaining about jpeg symbols from the
libshared.

Note that xwayland is not using the jpeg ones, but now that symbols are read
up front we need to link anyway.. or break apart that library.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agosimple-touch: use proper damage in touch_paint()
Pekka Paalanen [Tue, 31 Jul 2012 10:21:13 +0000 (13:21 +0300)]
simple-touch: use proper damage in touch_paint()

Should reduce update overhead.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agosimple-touch: fix off-by-one in position checks
Pekka Paalanen [Tue, 31 Jul 2012 10:21:12 +0000 (13:21 +0300)]
simple-touch: fix off-by-one in position checks

Fix the off by one error in checking whether we can draw the marker
without exceeding buffer dimensions.

Fixes a segfault.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agosimple-touch: more colors and thicker marks
Pekka Paalanen [Tue, 31 Jul 2012 10:21:11 +0000 (13:21 +0300)]
simple-touch: more colors and thicker marks

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agosimple-touch: respond to ping protocol
Pekka Paalanen [Tue, 31 Jul 2012 10:21:10 +0000 (13:21 +0300)]
simple-touch: respond to ping protocol

Without this, it won't get any input anymore.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agowindow: warn on cursor load failure
Pekka Paalanen [Tue, 31 Jul 2012 10:21:09 +0000 (13:21 +0300)]
window: warn on cursor load failure

12 years agocompositor: rework touch focus
Pekka Paalanen [Tue, 31 Jul 2012 10:21:08 +0000 (13:21 +0300)]
compositor: rework touch focus

In the wl_seat conversion, struct wl_touch got fields for the focused
surface and the client resource for the input device being focused.
However, the conversion was incomplete: the old fields
weston_seat::touch_focus* we still used by the event dispatching code,
but the new code never set them. Therefore no touch events were ever
sent.

From weston_seat, remove the fields touch_focus, touch_focus_listener,
touch_focus_resource, and touch_focus_resource_listener. They are
replaced by the corresponding fields and listeners from struct
wl_touch.

While doing this, fix touch_set_focus().

If touch_set_focus() was called first with surface A, and then with
surface B, without being called with NULL in between, it would corrupt
the destroy_signal list. It was equivalent of calling wl_signal_add()
for different signal sources with the same listener without removing in
between.

Now, touch_set_focus() first removes focus and listeners, and then
attempts to assign focus if requested. If the target client has not
subscribed for touch events, the touch focus will now be NULL.
Before this patch, the touch focus was left to the previous surface.

NOTE: this patch depends on the patch "server: add lose_touch_focus()"
for Wayland.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoevdev: query position ranges for MT, too
Pekka Paalanen [Tue, 31 Jul 2012 10:21:07 +0000 (13:21 +0300)]
evdev: query position ranges for MT, too

For a true multi-touch input device, the code ended up using
uninitialised fields of evdev_input_device::abs.

Fix it by querying the corresponding MT ranges.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoweston-launcher: use CLOEXEC on fallback path
Pekka Paalanen [Tue, 31 Jul 2012 10:21:06 +0000 (13:21 +0300)]
weston-launcher: use CLOEXEC on fallback path

If there is no weston-launcher available, launcher-util.c will fall back
to opening the given file itself. It that case it does not set the
close-on-exec flag, and will presumably leak the file descriptor to
children.

Use O_CLOEXEC on the fallback path, too.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocompositor-drm: Handle incomplete [output] sections without crashing
Kristian Høgsberg [Wed, 1 Aug 2012 02:18:28 +0000 (22:18 -0400)]
compositor-drm: Handle incomplete [output] sections without crashing

12 years agoshell: Give keyboard focus to top surface when current keyboard focus goes away
Kristian Høgsberg [Tue, 31 Jul 2012 21:29:30 +0000 (17:29 -0400)]
shell: Give keyboard focus to top surface when current keyboard focus goes away

12 years agoshell: Always track focus state per workspace
Kristian Høgsberg [Tue, 31 Jul 2012 20:36:34 +0000 (16:36 -0400)]
shell: Always track focus state per workspace

It's a little simpler than always creating and destroying it when we
switch workspace, and we'll need the focus_state soon.

12 years agocompositor: Set WAYLAND_DISPLAY if we're given a --socket argument
Kristian Høgsberg [Tue, 31 Jul 2012 18:54:48 +0000 (14:54 -0400)]
compositor: Set WAYLAND_DISPLAY if we're given a --socket argument

This lets us run multiple compositors (nested or on different VTs).

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

12 years agocompositor: Use a minimal restore handler for crash clean up
Kristian Høgsberg [Tue, 31 Jul 2012 18:32:01 +0000 (14:32 -0400)]
compositor: Use a minimal restore handler for crash clean up

When we hit a segv, it's often the case that we might crash again in
the attempt to clean up.  Instead we introduce a minimal restore callback
in the backend abstraction, that shuts down as simply as possible.  Then
we can call that from the segv handler, and then to aid debugging, we
raise SIGTRAP in the segv handler.  This lets us run gdb on weston from
a different vt, and if we tell gdb

  (gdb) handle SIGSEGV nostop

gdb won't stop when the segv happens but let weston clean up and switch vt,
and then stop when SIGTRAP is raised.

It's also possible to just let gdb catch the segv, and then use sysrq+k
followed by manual vt switch to get back.

12 years agowindow.c: Set input region after (potentially) adjusting the surface size
Kristian Høgsberg [Tue, 31 Jul 2012 15:59:12 +0000 (11:59 -0400)]
window.c: Set input region after (potentially) adjusting the surface size

Regressed in dd263e546bc20a2a7f42, spotted by Scott Moreau <oreaus@gmail.com>

12 years agoshell: Remove unused shsurf->focus_state
Kristian Høgsberg [Tue, 31 Jul 2012 14:51:22 +0000 (10:51 -0400)]
shell: Remove unused shsurf->focus_state

12 years agoshell: Use the right destroy listener in focus_state_surface_destroy()
Kristian Høgsberg [Tue, 31 Jul 2012 14:30:26 +0000 (10:30 -0400)]
shell: Use the right destroy listener in focus_state_surface_destroy()

We were dereferencing the seat destroy listener.

12 years agoAllow output configuration from config file.
Scott Moreau [Tue, 31 Jul 2012 01:51:08 +0000 (19:51 -0600)]
Allow output configuration from config file.

Parse the config file for [output] sections and check for 'name'
and 'mode' keys. The key strings are compared to what is reported
by weston log. The 'mode' key string can be one of the following:

1) WIDTHxHEIGHT - one that is reported by weston log
2) off - Disables the output
3) preferred - Uses the preferred mode
4) current - Uses the mode currently driving the crtc

12 years agocompositor-drm: Handle unconnected connectors better
Wang Quanxian [Mon, 30 Jul 2012 22:09:46 +0000 (18:09 -0400)]
compositor-drm: Handle unconnected connectors better

If a connector is not attached to a crtc, weston fails to bring it up.
Typically kms fbdev drives all crtc and connectors, but if kms hasn't been
initialzed and weston is the first to set a mode of if a monitor is
hotplugged, we just fail to bring it up.

(krh: reformatted and edited a bit from original patch)

12 years agocompositor: Add --help option
Kristian Høgsberg [Mon, 30 Jul 2012 19:41:14 +0000 (15:41 -0400)]
compositor: Add --help option

12 years agogears: Exit on ESC
Kristian Høgsberg [Mon, 30 Jul 2012 19:40:57 +0000 (15:40 -0400)]
gears: Exit on ESC

12 years agocompositor: do clean-up on init failure
Pekka Paalanen [Mon, 30 Jul 2012 13:56:57 +0000 (16:56 +0300)]
compositor: do clean-up on init failure

Simply exit(1)'ing the program will leave the VT unusable, since
DRM backend's clean-up does not run.

After a backend has been initialised, prefer jumping to clean-up instead
of directly exiting.

This fixes the case where 'weston-launch -- -i 5' would leave the
console unusable.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agosimple-egl: Add keyboard fullscreen toggle
Ander Conselvan de Oliveira [Fri, 27 Jul 2012 14:18:13 +0000 (17:18 +0300)]
simple-egl: Add keyboard fullscreen toggle

Make simple-egl toggle the fullscreen state whenever the key F11 is
pressed. A sync callback is used to stop drawing while the surface has
not received the configure event, to prevent a buffer with the windowed
size to be attached to the surface after the set_fullscreen request.

12 years agogears: Keep gears inside screen in fullscreen mode
Kristian Høgsberg [Fri, 27 Jul 2012 03:53:05 +0000 (23:53 -0400)]
gears: Keep gears inside screen in fullscreen mode

12 years agocompositor-drm: Don't leak output->name
Kristian Høgsberg [Fri, 27 Jul 2012 03:03:57 +0000 (23:03 -0400)]
compositor-drm: Don't leak output->name

12 years agocompositor-drm: Look through all crtc/encoder combinations
Kristian Høgsberg [Fri, 27 Jul 2012 02:44:55 +0000 (22:44 -0400)]
compositor-drm: Look through all crtc/encoder combinations

We used to only check the first possible encoder, now we go through all
possible encoders and look through all possible crtcs for each encoder.

12 years agogears: add a warning about refresh rate limitation
Olivier Blin [Thu, 26 Jul 2012 16:55:53 +0000 (18:55 +0200)]
gears: add a warning about refresh rate limitation

12 years agogears: show FPS count (as in glxgears from mesa/demos)
Olivier Blin [Wed, 25 Jul 2012 13:19:23 +0000 (15:19 +0200)]
gears: show FPS count (as in glxgears from mesa/demos)

12 years agocompositor-drm: Assign unique output names like xrandr does
Kristian Høgsberg [Thu, 26 Jul 2012 21:57:15 +0000 (17:57 -0400)]
compositor-drm: Assign unique output names like xrandr does

12 years agocompositor: Load modules with RTLD_NOW so we get missing symbols up front
Kristian Høgsberg [Thu, 26 Jul 2012 15:39:26 +0000 (11:39 -0400)]
compositor: Load modules with RTLD_NOW so we get missing symbols up front

Otherwise we have no way to clean up when we hit something undefined.