profile/ivi/weston.git
11 years agodesktop-shell: respect CURSOR_NONE as grab cursor
Philipp Brüschweiler [Fri, 24 Aug 2012 13:43:55 +0000 (15:43 +0200)]
desktop-shell: respect CURSOR_NONE as grab cursor

11 years agotoytoolkit: try multiple names when loading cursors
Philipp Brüschweiler [Tue, 21 Aug 2012 18:36:16 +0000 (20:36 +0200)]
toytoolkit: try multiple names when loading cursors

The correspondence between cursor functions and names of cursors has
never been standardized. As a consequence, each cursor function can be
represented as a cursor with one of several names. Be more robust when
loading cursor by trying all known names that correspond to a cursor.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=50487
and https://bugs.freedesktop.org/show_bug.cgi?id=52609 a bit more
thoroughly.

11 years agotests: Add unit test for text model
Jan Arne Petersen [Tue, 21 Aug 2012 16:28:49 +0000 (18:28 +0200)]
tests: Add unit test for text model

Add tests for activate/deactivate and unfocusing of the assigned
surface.

11 years agotests: Explicitly define the test client to launch
Jan Arne Petersen [Tue, 21 Aug 2012 16:28:48 +0000 (18:28 +0200)]
tests: Explicitly define the test client to launch

Allow different test clients to launch. The test client is defined by
an argument in the test_client_launch() function.

11 years agoscreenshot: Use correct buffer size for transformed outputs.
Scott Moreau [Sun, 19 Aug 2012 01:52:42 +0000 (19:52 -0600)]
screenshot: Use correct buffer size for transformed outputs.

This is a workaround for screenshots with transformed outputs. It reorders
the output positions so the correct buffer size is determined for the final
image. This assumes the outputs are in succession on the x axis. The outputs
are rendered in their transformed state.

11 years agoterminal: support entering non-ascii characters
Philipp Brüschweiler [Sat, 18 Aug 2012 11:38:38 +0000 (13:38 +0200)]
terminal: support entering non-ascii characters

Unless the alt modifier is active and the MODE_ALT_SENDS_ESC mode is not
set, any value over 127 is converted to a UTF8 sequence.

Part of https://bugs.freedesktop.org/show_bug.cgi?id=53648 should be
fixed with this.

Part of https://bugs.freedesktop.org/show_bug.cgi?id=52419 is fixed, but
interestingly it depends on the activated keymap (i.e. it works with
dvorak, but not with ch).

11 years agoImplement output transformations.
Scott Moreau [Sat, 18 Aug 2012 07:04:05 +0000 (01:04 -0600)]
Implement output transformations.

This patch allows rotation and mirroring outputs for x11 and drm backends.
A new 'transform' key can be set in the [output] section. From the protocol:

"The flipped values correspond to an initial flip around a vertical axis
followed by rotation."

The transform key can be one of the following 8 strings:

normal
90
180
270
flipped
flipped-90
flipped-180
flipped-270

11 years agotoytoolkit: don't ignore resizes with negative width or height
Philipp Brüschweiler [Thu, 16 Aug 2012 08:50:07 +0000 (10:50 +0200)]
toytoolkit: don't ignore resizes with negative width or height

E.g. this can happen when you grab the lower right corner of a window
and move over the top of the window when resizing. In this case, the
changed width is still important and should be acted upon.

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

11 years agocompositor: Clear only the the damage that was actually repainted
Ander Conselvan de Oliveira [Wed, 15 Aug 2012 18:02:05 +0000 (14:02 -0400)]
compositor: Clear only the the damage that was actually repainted

Instead of clearing the whole output region after a repaint, clear
only the regions that were actually painted. This way, the damage
added when a surface moves from the primary plane to another one is
kept while this region is obscured by the opaque region. This allows
the contents below an overlaid surface to be culled, but to make this
work properly, it is also necessary to change the way previous damage
is drawn.

Consider the following scenario: a surface is moved to an overlay plane
leaving some damage in the primary plane. On the following frame, the
surface on the overlay moves, revealing part of the damaged region on
the primary plane. On the frame after that, the overlaid surface moves
back to its previous position obscuring the region of the primary plane
repainted before. At this point, the repainted region was added to the
output's previous damage so that it is draw to both buffers. But since
this region is now obscured, the redrawing is skipped. If the overlaid
surface moves again revealing this region, one of the buffers actually
contains the wrong content.

To fix this problem, this patch ensures that any previous damage that
would be lost is actually preserved by folding it back into the
primary plane damage just before repainting.

11 years agoRemove unused enum.
Scott Moreau [Thu, 16 Aug 2012 06:18:41 +0000 (00:18 -0600)]
Remove unused enum.

11 years agoCorrect mistake in config file.
Scott Moreau [Thu, 16 Aug 2012 06:04:25 +0000 (00:04 -0600)]
Correct mistake in config file.

11 years agoweston-info: an output can have multiple modes
Philipp Brüschweiler [Wed, 15 Aug 2012 19:57:24 +0000 (21:57 +0200)]
weston-info: an output can have multiple modes

11 years agoweston-info: remove timerfd termination hack
Philipp Brüschweiler [Wed, 15 Aug 2012 19:57:23 +0000 (21:57 +0200)]
weston-info: remove timerfd termination hack

Use wl_display_roundtrip to listen exactly as long as necessary.

11 years agoclients: Move weston-info to bin_PROGRAMS
Kristian Høgsberg [Wed, 15 Aug 2012 16:12:33 +0000 (12:12 -0400)]
clients: Move weston-info to bin_PROGRAMS

It's properly prefixed and pretty useful; let's install it.

11 years agoweston-info: client that print out information about the running compositor
Philipp Brüschweiler [Wed, 15 Aug 2012 15:12:00 +0000 (17:12 +0200)]
weston-info: client that print out information about the running compositor

This includes seat capabilities, shm formats and output information.

11 years agocompositor: a couple debug logs
Rob Clark [Mon, 13 Aug 2012 22:39:17 +0000 (17:39 -0500)]
compositor: a couple debug logs

Well, they were useful to me in debugging, so probably sooner or later
useful to someone else.

Signed-off-by: Rob Clark <rob@ti.com>
11 years agotoytoolkit: add axis handler
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:41 +0000 (11:02 +0200)]
toytoolkit: add axis handler

11 years agoevent-test: fix compilation
Philipp Brüschweiler [Tue, 14 Aug 2012 12:46:38 +0000 (14:46 +0200)]
event-test: fix compilation

Also fixes a compiler warning in test-client. The test is still failing,
but that's for another patch.

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

11 years agotoytoolkit: remove unused actions from titlebar menu
Philipp Brüschweiler [Tue, 14 Aug 2012 10:26:54 +0000 (12:26 +0200)]
toytoolkit: remove unused actions from titlebar menu

They were introduced in b3cca0a41130ff45b70b730cb8f2273dd91531a5
but never actually implemented. Removing them should at least stop
users from wondering if weston is broken.

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

11 years agoeventdemo: add axis logging
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:42 +0000 (11:02 +0200)]
eventdemo: add axis logging

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

11 years agoeventdemo: fix --no-border
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:40 +0000 (11:02 +0200)]
eventdemo: fix --no-border

This was broken by commit 29af3ebce676b3cdd516dedc0cbedc47f70ce425

11 years agoeventdemo: fix incorrect comments
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:39 +0000 (11:02 +0200)]
eventdemo: fix incorrect comments

11 years agocompositor-wayland: Set make and model
Kristian Høgsberg [Tue, 14 Aug 2012 03:34:04 +0000 (23:34 -0400)]
compositor-wayland: Set make and model

11 years agocompositor-wayland: Call notify_pointer_focus() for content area only
Kristian Høgsberg [Tue, 14 Aug 2012 03:29:53 +0000 (23:29 -0400)]
compositor-wayland: Call notify_pointer_focus() for content area only

We don't want to send enter/leave events to the compositor when the pointer
enters the surface, only when the pointer enters the content area.  This
avoids hiding the cursor when entering the frame and sending out-of-bounds
coordinates to notify_pointer_focus().

11 years agowindow.c: Handle multiple keyboard foci
Kristian Høgsberg [Tue, 14 Aug 2012 02:25:53 +0000 (22:25 -0400)]
window.c: Handle multiple keyboard foci

Keep a count of number of wl_keyboard focus we have instead of
tracking the more recent wl_keyboard.

11 years agocompositor: Use pointer_cursor_surface_configure() in wl_pointer.set_cursor
Kristian Høgsberg [Mon, 13 Aug 2012 22:14:15 +0000 (18:14 -0400)]
compositor: Use pointer_cursor_surface_configure() in wl_pointer.set_cursor

This way we map the surface if it currently isn't mapped and avoid
duplicating some of the code already in pointer_cursor_surface_configure().
Without this, the cursor code relied on a wl_surface.attach() to show the
new pointer surface.  If we're not changing the cursor buffer, we don't
get that, but we still need to map the cursor.

11 years agoshell: don't segfault when pressing super+k when no surface is focused
Philipp Brüschweiler [Mon, 13 Aug 2012 19:27:27 +0000 (21:27 +0200)]
shell: don't segfault when pressing super+k when no surface is focused

11 years agoimage: handle multiple images correctly
Philipp Brüschweiler [Mon, 13 Aug 2012 19:16:47 +0000 (21:16 +0200)]
image: handle multiple images correctly

Don't stop the application when only one window is closed. Don't stall
indefinitely if no valid image file is given as input.

11 years agodnd: fix segfault on grabbing
Philipp Brüschweiler [Mon, 13 Aug 2012 18:04:54 +0000 (20:04 +0200)]
dnd: fix segfault on grabbing

Some cursor themes don't include a "grabbing" icon, causing a segfault.
This patch fixes this by just reverting to the stardard cursor instead.

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

11 years agocompositor: Set WAYLAND_DISPLAY only after creating backend
Kristian Høgsberg [Mon, 13 Aug 2012 17:56:03 +0000 (13:56 -0400)]
compositor: Set WAYLAND_DISPLAY only after creating backend

The wayland backend needs to connect to the original WAYLAND_DISPLAY
before we overwrite it.

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

11 years agoshell: Eliminate unneeded function.
Scott Moreau [Mon, 13 Aug 2012 15:58:41 +0000 (09:58 -0600)]
shell: Eliminate unneeded function.

Replace all occurrences of workspace_damage_all_surfaces() with
weston_compositor_schedule_repaint(). This fixes a bug exposed by
982387011ff where trying to switch workspaces while there are no
surfaces on the current workspace fails to start the animation.

11 years agoAdd support in Weston for X cursor themes.
Christopher Michael [Sat, 11 Aug 2012 14:12:09 +0000 (15:12 +0100)]
Add support in Weston for X cursor themes.

This patch, along with the wayland patch, adds the ability to specify
a cursor theme in the weston.ini file:

[cursors]
theme=THEME_NAME

If specified, than Weston can use a specific X cursor theme for the
pointer. This relies on the 0001-Add-support-for-X-cursor-themes.patch
for wayland.

[krh: edited to use shell section and key name cursor-theme]

11 years agoshell: Avoid modulo by zero error in positioning algorithm
Rob Bradford [Mon, 13 Aug 2012 14:18:44 +0000 (15:18 +0100)]
shell: Avoid modulo by zero error in positioning algorithm

As spotted by Philipp Brüschweiler <blei42@gmail.com>

11 years agoshell: Enhance the basic random positioning algorithm
Rob Bradford [Mon, 13 Aug 2012 13:07:52 +0000 (14:07 +0100)]
shell: Enhance the basic random positioning algorithm

Place the window in a random position on the output where the first seat with
a pointer is. When calculating the random position limit the range to the
area that would ensure that the whole surface is visible. If the surface is
larger than the output then the surface is placed at the origin of the
output.

This change is based on the good work of Scott Moreau <oreaus@gmail.com>

11 years agowindow.c: Rearrange input handlers so they appear in the right order
Kristian Høgsberg [Sat, 11 Aug 2012 18:56:08 +0000 (14:56 -0400)]
window.c: Rearrange input handlers so they appear in the right order

They were all over the place before, now they appear in protocol order.

11 years agoshell: Ignore unsolicited pong requests
Kristian Høgsberg [Sun, 12 Aug 2012 02:39:12 +0000 (22:39 -0400)]
shell: Ignore unsolicited pong requests

If a client sends a pong message out of the blue, we deref ping_timer
which is NULL and then crash.  Unsolicited pong requests indicate that
something is wrong on the client, but the compositor should survide that.

11 years agotext: Deactivate text_model on keyboard focus lost
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:23 +0000 (16:47 +0200)]
text: Deactivate text_model on keyboard focus lost

Assign a surface to a text_model on the text_model_activate request and
deactivate the text_model when the surface looses the keyboard focus.

11 years agotext: Assign text_model to a wl_seat
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:22 +0000 (16:47 +0200)]
text: Assign text_model to a wl_seat

Add a wl_seat argument to the activate and deactivate requests of
text_method.

On activation a text_model gets assigned to the input_method of the
wl_seat specified in the activate request.

11 years agotext: Add activate/deactivate events
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:21 +0000 (16:47 +0200)]
text: Add activate/deactivate events

Let the client know when a text model gets activated or deactiavted.

11 years agotext: Rename text_model_manager to factory
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:20 +0000 (16:47 +0200)]
text: Rename text_model_manager to factory

The text_model_manager interface is just used to create text_model
instances. It is more a factory than a manager so rename it to
text_model_factory.

11 years agotext: Add missing callbacks for text_model events
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:19 +0000 (16:47 +0200)]
text: Add missing callbacks for text_model events

Add all required callbacks for the text_model_listener in the editor
example.

11 years agocompositor: Change notify_* function to take a weston_seat
Kristian Høgsberg [Fri, 10 Aug 2012 13:50:11 +0000 (09:50 -0400)]
compositor: Change notify_* function to take a weston_seat

Fewer indirections and derefs, and it's also more appropriate for a
backend calling into weston core to pass a weston_seat.

11 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.

11 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.

11 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

11 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

11 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

11 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.

11 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

11 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.

11 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.

11 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.

11 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>
11 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>
11 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>
11 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.

11 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().

11 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.

11 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.

11 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.

11 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>
11 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

11 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.

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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

11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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)

11 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.

11 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.