Commit Graph

2211 Commits

Author SHA1 Message Date
Kristian Høgsberg
05890dc621 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.
2012-08-10 10:09:20 -04:00
Kristian Høgsberg
16333ab0ab compositor: Remove compositor->seat
Get rid of this quick-and-dirty assumption.
2012-08-10 10:08:21 -04:00
Kristian Høgsberg
ef6f136d65 zoom: Pick the first seat in seat_list instead of compositor->seat 2012-08-10 10:07:55 -04:00
Kristian Høgsberg
5ba31891a1 xwm: Use a simple heuristic for mapping X input events to a weston seat 2012-08-10 10:06:59 -04:00
Kristian Høgsberg
f4d2f237f0 shell: Track pointer focus for all seats 2012-08-10 10:05:39 -04:00
Kristian Høgsberg
4f92c5392a 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.
2012-08-10 10:04:36 -04:00
Kristian Høgsberg
7af7cede2d compositor-wayland: Move weston_seat into wayland_input 2012-08-10 10:01:33 -04:00
Kristian Høgsberg
99fd1015d0 compositor: Drop output->flags
All outputs are EGLSurface based so we can drop this detail now.
2012-08-10 09:58:02 -04:00
Kristian Høgsberg
8a01580f17 compositor-drm: Fix bad rebase
I failed to compile test my rebase of Robs compositor-drm fixes.
2012-08-09 17:19:23 -04:00
Philipp Brüschweiler
711fda86cc 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.
2012-08-09 17:13:14 -04:00
Rob Clark
ab5b1e3149 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>
2012-08-09 17:11:03 -04:00
Rob Clark
4339add9e9 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>
2012-08-09 17:08:40 -04:00
Rob Clark
702ffaea3e 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>
2012-08-09 17:05:20 -04:00
Ander Conselvan de Oliveira
42c46466ab 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.
2012-08-09 14:40:12 -04:00
Ander Conselvan de Oliveira
dc79e6d289 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().
2012-08-09 14:39:13 -04:00
Ander Conselvan de Oliveira
383b671ccf 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.
2012-08-09 14:37:01 -04:00
Ander Conselvan de Oliveira
3b70b66fa9 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.
2012-08-09 13:46:55 -04:00
Rob Bradford
84cf541b27 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.
2012-08-09 12:51:45 -04:00
Rob Clark
5ca1a47e23 compositor-drm: handle vblanks on secondary crtc
Signed-off-by: Rob Clark <rob@ti.com>
2012-08-09 12:47:06 -04:00
Juan Zhao
19a4c2db26 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
2012-08-09 10:55:40 -04:00
Philipp Brüschweiler
8801357332 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.
2012-08-09 10:37:41 -04:00
Pekka Paalanen
3eb4761317 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>
2012-08-09 10:29:18 -04:00
Pekka Paalanen
b9d38f4552 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>
2012-08-09 10:28:35 -04:00
Pekka Paalanen
f1fc10a488 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>
2012-08-09 10:27:39 -04:00
Pekka Paalanen
ae29da2eb8 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>
2012-08-09 10:27:34 -04:00
Pekka Paalanen
d525b564ae 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>
2012-08-09 10:27:28 -04:00
Pekka Paalanen
df1fd36a14 compositor: log program launches
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:27:21 -04:00
Scott Moreau
ca9b09d945 compositor-x11: Always free output_mode on error. 2012-08-09 10:23:26 -04:00
Kristian Høgsberg
3d89049546 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.
2012-08-03 21:56:41 -04:00
Scott Moreau
248aaecda2 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.
2012-08-03 20:17:47 -04:00
Scott Moreau
a5021521f1 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.
2012-08-03 20:11:24 -04:00
Kristian Høgsberg
61f00f52fa shell: Make sure the black surface is opaque
So we don't repaint anything below it.
2012-08-03 16:37:01 -04:00
Kristian Høgsberg
982387011f 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.
2012-08-03 16:36:52 -04:00
Kristian Høgsberg
79af73e313 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.
2012-08-03 16:33:42 -04:00
Kristian Høgsberg
bcf4864bb7 simple-egl: Add help message 2012-08-03 16:32:55 -04:00
Kristian Høgsberg
45ce98829b simple-egl: Set opaque region when running opaque 2012-08-03 16:32:52 -04:00
Pekka Paalanen
4b141597c6 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>
2012-08-03 13:32:43 -04:00
Pekka Paalanen
b6df4f7de4 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>
2012-08-03 13:32:36 -04:00
Pekka Paalanen
168ed72dc7 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>
2012-08-03 13:32:33 -04:00
Pekka Paalanen
4ddf1b2c4d android: add basic evdev input support
Android backend needs mtdev now, and evdev-touchpad.c, too.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:32:26 -04:00
Pekka Paalanen
d858351a61 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>
2012-08-03 13:32:20 -04:00
Pekka Paalanen
81a13a3757 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>
2012-08-03 13:32:10 -04:00
Pekka Paalanen
42b3f6ae64 compositor-drm: log input device hot-unplugs
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:32:06 -04:00
Pekka Paalanen
d2e69c2c6f 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>
2012-08-03 13:32:03 -04:00
Pekka Paalanen
bf639ab892 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>
2012-08-03 13:32:00 -04:00
Pekka Paalanen
3315697739 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>
2012-08-03 13:31:30 -04:00
Pekka Paalanen
88594b699f evdev: expose the generic evdev API
This API does not depend on udev or launcher-util.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:26:58 -04:00
Pekka Paalanen
3b003399ce evdev: rename evdev_seat to drm_seat
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:19:22 -04:00
Pekka Paalanen
43f0a1efcb evdev: pass weston_seat to evdev_input_device_create()
in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:18:59 -04:00
Pekka Paalanen
3bfb20104d evdev: make evdev_notify_keyboard_focus() independent of evdev_seat
in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:18:37 -04:00