Commit Graph

1185 Commits

Author SHA1 Message Date
Kristian Høgsberg
4a2a274350 input: Fold wl_seat init/release into weston_seat init/release 2013-05-06 22:24:50 -04:00
Kristian Høgsberg
e329f36533 input: Rename wl_touch to weston_touch
This is now a weston object.
2013-05-06 22:19:57 -04:00
Kristian Høgsberg
02bbabbd56 input: Rename wl_pointer to weston_pointer
This is now a weston object.
2013-05-06 22:15:05 -04:00
Kristian Høgsberg
a71e8b2e4d input: Rename weston_device_repick() to weston_seat_repick()
Old left-over misnaming.
2013-05-06 21:51:21 -04:00
Kristian Høgsberg
80fb82df3a input: Drop find_resource_for_client()
We can use find_resource_for_surface() instead now that it's all in the
same file.
2013-05-06 21:49:55 -04:00
Kristian Høgsberg
b5e26104ee move input code from compositor.c into input.c 2013-05-06 21:46:18 -04:00
Kristian Høgsberg
29139d4a45 fold wl_keyboard into weston_keyboard 2013-05-06 21:40:36 -04:00
Kristian Høgsberg
2158a889a1 Import input structs and helper functions from wayland 2013-05-06 21:40:32 -04:00
Jan Arne Petersen
cc75ec11ca text: Rename input_method to wl_input_method
Also rename input_method_context to wl_input_method_context,
input_panel to wl_input_panel and input_panel_surface to
wl_input_panel_surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 17:18:46 -04:00
Jan Arne Petersen
70d942b4d7 text: Rename ::set_panel to ::set_overlay_panel
Also add documentation to input_panel_surface::set_overlay_panel.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 17:12:02 -04:00
Jan Arne Petersen
62ece76b1e text: Rename text_input to wl_text_input
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 17:06:27 -04:00
Jan Arne Petersen
00191c7c4a text: Fix serial handling
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:41:48 -04:00
Jan Arne Petersen
b41531a88e text: Only allow input-method started by weston to bind
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:41:48 -04:00
Jan Arne Petersen
7cd29e199a text: Add output argument to set_toplevel
Allow to specify an output for a toplevel  input panel surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:41:47 -04:00
Jan Arne Petersen
14da96bf81 text: Add support for panels following the cursor
Add input_panel_surface::set_panel to specify input panel surfaces which
are overlaying the application and are following the input cursor.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:41:47 -04:00
Jan Arne Petersen
78d00e45cc text: Rename text_model to text_input
Also rename text_model_factory to text_input_manager.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:35 -04:00
Jan Arne Petersen
7ef8effca5 text: Order requests and events in a nice way
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:14 -04:00
Jan Arne Petersen
fa3573852d text: rename text_model::commit to commit_state
Use ::commit_state as a request name to make clear what is commited.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:22:36 -04:00
Jan Arne Petersen
ece6b5af51 text: Add language and text-direction to protocol
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:21:18 -04:00
Kristian Høgsberg
f91871980e xwm: Reparent client windows into ARGB windows
We used to rely on an ugly hack where the xwayland server would always
report RGB X windows as having ARGB pixels, so that texturing from these
would also sample the undefined alpha.  We also relied on Xrender rendering
to RGB X windows to write the alpha channel correctly, so that when we
texture from the RGB X window as an ARGB surface we end up getting the
alpha written by Xrender.

That was obviously all broken.  We can instead reparent client windows into
ARGB frame windows.  That way we can render the decorations using a
ARGB render pictformat and sample back those alpha values in a well-defined
way.  We can also unbreak xwayland and let it report RGB pixel format for
RGB windows.  We still need the opaque region or the RGB-only client window
but that's OK.
2013-05-02 13:43:34 -04:00
Richard Hughes
afe690cbcf Move the optional output name property from drm_output to weston_output
In the future the CMS plugins will need to read the config file and setup a list
of hardcoded names to ICC profiles.
2013-05-02 09:53:20 -04:00
Chris Michael
eb2074a18b Fix not checking return value of drmIoctl function call to map dumb buffer
in drm_fb_create_dumb, the return value of the drmIoctl function call
to map the dumb buffer was never checked, thus the following "if
(ret)" check was invalid as it was checking the previous return value
from the above drmModeAddFB call.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-01 21:26:02 -04:00
Richard Hughes
ab74562335 Include config.h in compositor-drm.c 2013-05-01 21:14:16 -04:00
Richard Hughes
e7299962a9 Add a set_gamma vfunc on weston_output 2013-05-01 21:14:10 -04:00
Richard Hughes
59d5da79be Add a output_created_signal on weston_compositor 2013-05-01 21:13:16 -04:00
Richard Hughes
64ddde1e70 Add a destroy_signal on weston_output 2013-05-01 21:11:46 -04:00
Richard Hughes
2b2092adb4 Extract and parse the EDID when outputs are added
At the moment we're only extracting interesting strings. We have to be quite
careful parsing the EDID data, as vendors like to do insane things.

The original EDID parsing code was written by me for gnome-color-manager.
2013-05-01 13:55:42 -04:00
Philipp Brüschweiler
63e7be60b3 shell: clear popup grab interface on remove_popup_grab and popup_grab_end
Fixes a segfault. Steps to reproduce:

* start weston with the x11 backend
* open a terminal
* click on the icon in the top left corner, choose close
* close the x11 window containing weston
2013-04-15 21:13:34 -04:00
Hardening
4a3c150c96 Correctly handle extended RDP keycodes
The keycodes received by the FreeRDP server aren't evdev keycodes.
This patch adds the correct convertion to evdev keycodes. After the
patch all keys that are marked as extended in RDP packets become
functionnal (that's the case for the windows key).
Please note that this patch rely on some corrections that have been
pushed on the FreeRDP github tonight.
2013-04-11 16:11:11 -04:00
Jonas Ådahl
e5a1225bc4 Make backends always specify output repaint time
Most backends relies on gettimeofday(2) for output repaint timestamps
but this is not a requirement. Before this patch repaints coming from
idle_repaint() always used gettimeofday(2) for timestamps. For backends
not using that time source this could cause large jumps between
timestamps.

To fix this, timestamps needs to always come from the backend. This
means that the backend needs to always be responsible of starting the
repaint loop in case that the repaint cannot start immediately.

The drm backend implementation is from the patch by Ander Conselvan de
Oliveira found here:
http://lists.freedesktop.org/archives/wayland-devel/2013-February/007393.html

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-04-08 14:24:03 -04:00
Kristian Høgsberg
b76237e508 compositor-drm: Allow running without launcher if effective UID is 0
This lets us keep running weston as root or setuid root.
2013-04-04 21:36:20 -04:00
Rob Bradford
91ae483ab9 compositor: Use wl_pointer_set_current to cleanup after surface destruction
This API call handles setting the current surface on the wl_pointer and also
maintaining a destroy notification to monitor that surface for destruction.

This is part of the fix for: https://bugzilla.gnome.org/show_bug.cgi?id=696946
2013-04-03 12:05:57 -04:00
Philipp Brüschweiler
e14560e381 compositor: add information about the fbdev backend to --help output 2013-04-01 21:45:00 -04:00
Hardening
a83409cbff RDP compositor take 6
This patch is the 6th version of the FreeRDP based compositor.
Changes from last version:
 * use pixman_image_get_stride() when appropriate
 * always realloc

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2013-04-01 20:50:54 -04:00
Philipp Brüschweiler
57edf7f49e compositor: add WESTON_COMPOSITOR_OFFSCREEN state
This state is used when the user switches the vt. It turns of rendering
and frame events, but doesn't set the DPMS state to off.

As a part of this change, also turn off the idle timer when entering
the SLEEPING or OFFSCREEN states, which fixes
https://bugs.freedesktop.org/show_bug.cgi?id=61910 (rpi backend
untested).
2013-03-29 14:05:27 -04:00
Giulio Camuffo
7fe01b18d8 sdk: be C++ friendly
This renames the weston_surface's private member to configure_private
and externs "C" the headers of the SDK.
2013-03-28 14:03:58 -04:00
Kristian Høgsberg
88817f869f compositor: Remove unused wl_pointer variable
Using move_pointer() in notify_pointer_focus() left the wl_pointer variable
unused.
2013-03-27 23:00:29 -04:00
Peter Maatman
e5b42e4466 Added handler for SIGABRT 2013-03-27 22:57:33 -04:00
Jonas Ådahl
848e2e670e evdev-touchpad: Disable tap FSM by default on touchpads with button pads
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-03-27 15:39:09 -04:00
Kristian Høgsberg
5006596a72 compositor-x11: Fix relative motion reporting for multiple outputs 2013-03-27 15:14:07 -04:00
Rob Bradford
c088e2c011 compositor: Support notifying with absolute position too
With evdev input devices that generate absolute positions we need to provide
an infrastructure in the compositor for supporting those.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=61997
2013-03-27 14:42:28 -04:00
Rafal Mielniczuk
32069c09ea compositor-drm: ensure we run drm-backend using weston-launch
We do this by checking if launcher_sock != -1

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=60926
2013-03-27 13:46:01 -04:00
Giulio Camuffo
1b4b61ace3 shell: set the popup grab button as pressed only if it actually is
This ensures the popup_grab.initial_up field isn't reset to 0
if the popup was not opened because of a mouse press but because
of moving the mouse with a popup already open. Not doing so will
make the first click outside the client area go ignored.
2013-03-27 13:11:06 -04:00
Giulio Camuffo
5085a75dee shell: handle multiple popups
This patch implements a popup stack. When the first popup is opened
the grab is started, and it is added to a list. Further popups will
be added to this list but the grab won't change. When a popup is
closed it is removed from the list and, if it is now empty, the grab
is ended.
A click outside the client area will send the popup_done event to
all the popups in the list, and the grab will end.
2013-03-25 22:36:58 -04:00
Rob Bradford
0f3f97d34a weston-egl: Allow compilation against older EGL stack
Provide a definition of EGL_BUFFER_AGE_EXT so that you can compile against an
EGL stack that may not yet support that extension.
2013-03-22 10:26:04 -04:00
Siddharth Heroor
d6be88b5e2 weston-launch: cleanup - return failures in main with EXIT_FAILURE
Signed-off-by: Siddharth Heroor <heroor@gmail.com>
2013-03-19 14:41:05 -04:00
Philipp Brüschweiler
e74dc19aa1 compositor-rpi: Use correct enum, removes a warning 2013-03-19 14:35:34 -04:00
Philipp Brüschweiler
4b409c387d compositor: remove unused field option_idle_time 2013-03-19 14:31:46 -04:00
Philipp Brüschweiler
7a3ec74cb6 weston-launch: return better value if weston dies because of a signal
Before this commit, weston-launch returned 0 if weston was killed by a
signal. This makes it hard to automatically test weston by using
weston-launch, as there is no way to know why weston was terminated.

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

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

v3: better commit message.
2013-03-19 14:28:23 -04:00
Philipp Brüschweiler
ff253129c5 weston-launch: move function calls out of assert() 2013-03-19 14:28:01 -04:00
Rafal Mielniczuk
fffdcdd654 shell: reset rotation for maximized surface
Surface will preserve its rotation transformation when maximizing, which
will cause inconsistencies (eg. no window shadows drawn)

This patch removes rotation from maximized surface and restore it when
unmaximizing (just like in fullscreen mode)
2013-03-19 12:27:23 -04:00
Rafal Mielniczuk
23c6759b76 shell: block move, rotate, resize in maximized state
To remain consisten with client side window, which blocks moving and
resizing of window in maximized state, we should do so on the compositor
side as well.

(until there is some unmaximize notification from server, which will
allow window to start drawing shadows and revert itself to toplevel
state)
2013-03-19 12:09:52 -04:00
Philipp Brüschweiler
f3e39f9872 pixman-renderer: don't forget to initialize the debug fields
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=61930
2013-03-18 22:25:36 -04:00
Pekka Paalanen
483243fa67 compositor, shell: surface transform inheritance
Implements surface transform inheritance. A 'parent' pointer is added to
weston_surface::geometry, and is automatically used by
weston_surface_update_transform(). When updating the transform, the
parent transform is updated as needed, too.

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

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-03-18 22:20:04 -04:00
Pekka Paalanen
c3ce738653 compositor: introduce weston_surface_geometry_dirty()
Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.

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

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

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-03-18 22:19:57 -04:00
Pekka Paalanen
f1f48cfa35 compositor: remove redundant geometry dirtying
Remove redundant geometry dirtying from surface_commit() to simplify
further changes.

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

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

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

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

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

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

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-03-18 22:19:54 -04:00
Rune K. Svendsen
14b2fe7020 Eat scroll event if a key binding function is executed because of it.
When an axis (scroll) event results in a key binding function
being executed, eat the scroll event so the underlying window
doesn't receive it.
Thanks to Scott Moreau for helping me solve this.
2013-03-18 21:43:17 -04:00
Scott Moreau
976a050f8f Fix memory leaks
Fix a couple leaks caught by valgrind.
2013-03-18 21:34:13 -04:00
Ander Conselvan de Oliveira
1c169ffdec gl-renderer: Use EXT_buffer_age and don't assume double buffering
Now that we have EXT_buffer_age in mesa, we should stop assuming double
buffering and use the buffer age instead.

Note: this will cause system without the extension to repaint the whole
screen every frame.
2013-03-18 21:13:52 -04:00
Ander Conselvan de Oliveira
e1bd5a02a0 compositor: Don't rely on surface->clip to cull overlay obscured damage
Before this change, surface->clip would contain the region of this the
surface that is obscured by opaque containing of other surfaces in any
plane. If a surface was obscured only by a surface in another plane and
the renderer was told to draw that region, the rendering would be
clipped because of that.

This patch changes the clip to be plane specific, so that it contains
only the region of the surface obscured by other surfaces in the same
plane. We also calculate a per plane clip, so that we don't tell the
renderer to draw regions of the primary plane that are obscured by
other planes. This damage remains on the primary plane until the its
clip changes so that they are not obscured anymore.
2013-03-18 21:13:50 -04:00
Ander Conselvan de Oliveira
b605c06e2a gl-renderer: Don't change the region supplied to output repaint
The core uses this region to clear from the primary plane damage the
area that was repainted. If we add the old buffer damage to that, it
may end up clearing more damage from the primary plane than it was
intended.
2013-03-18 21:13:48 -04:00
Ander Conselvan de Oliveira
8ad1982854 compositor: Keep a z-ordered list of planes
This let us clear a plane's opaque region without adding code in the
backend, and will be used in a following commit to change how we track
damage.
2013-03-18 21:13:45 -04:00
John Kåre Alsaker
ef591aa4e9 compositor-drm: Inspect result of gbm_create_device. 2013-03-18 21:10:08 -04:00
Andre Heider
ac1cb0b9d2 src/Makefile.am: Fix git-version.h for out of tree builds
Use --git-dir instead of --work-tree, see
http://marc.info/?l=git&m=120390208721287&w=2

Signed-off-by: Andre Heider <a.heider@gmail.com>
2013-03-18 21:06:27 -04:00
Kristian Høgsberg
e7144fd175 compositor: Only send release event in response to wl_surface.attach
The current semantics would implicitly attach the most recently attached
buffer at commit time and send a release event when the buffer enventually
was released.  The implicit attach is a little too subtle though and this
patch changes the semantics to always only send release events in response
to an attach event.  As a consequence, once a compositor releases a buffer,
it no longer has a reference to it and wl_surfcea.damage is undefined.
Thus, the client side visible change is that damage request must always
be preceeded by a wl_surface.attach request, to ensure there's a valid buffer,
even if that means attaching the same buffer again.
2013-03-05 15:35:47 -05:00
Kristian Høgsberg
2034780cb2 compositor: Fold weston_buffer_post_release into weston_buffer_reference
Nothing else calls weston_buffer_post_release and the ref-counting and
sending the release event is essentially what weston_buffer_reference is
all about.
2013-03-04 12:35:19 -05:00
Kristian Høgsberg
63093a35ea compositor-drm: Determine opaqueness of a surface correctly
We subtract the screen space opaque region from the transformed surface
region.  That's going to fail for when we're scaling up a surface, since
the surface bounding box for the scaled up surface is going to be bigger
than the opaque region.  Instead, subtract the surface-space opaque region
from a 0,0 - width,height region and see if that's empty.
2013-03-04 12:35:07 -05:00
Kristian Høgsberg
068b61c254 compositor: Change notify_motion to take relative motion events 2013-02-28 14:57:01 -05:00
Kristian Høgsberg
e2464fd414 compositor: Split pointer motion code into its own function 2013-02-28 14:57:00 -05:00
Kristian Høgsberg
9bcaaebfee compositor: Make sure surface->transform.inverse is a complete matrix
We never init this, so we need to copy over the position matrix and then
overwrite the translation entries to make sure we have a valid matrix.

Thanks to Pekka for spotting this (twice).
2013-02-28 14:57:00 -05:00
Kristian Høgsberg
c1e6c8a2ed compositor: Make sure surface->transform.matrix,inverse are always valid
First step towards getting rid of the transform.enabled optimization.
2013-02-27 17:01:42 -05:00
Giulio Camuffo
184df50d3e compositor: call configure on surfaces with a null buffer too
This way the shell can know when a surface has been unmapped by
checking the value returned by weston_surface_is_mapped(surface).
The configure handlers have now width and height parameters, so
they do not need anymore to check manually the buffer size.
If a surface's buffer is NULL the width and height passed to the
configure are both 0.
Configure is now only called after an attach. The variable
weston_surface.pending.newly_attached is set to 1 on attach, and
after the configure call is reset to 0.
2013-02-27 15:32:04 -05:00
Satyeshwar Singh
964a342e53 evdev: Wait for SYN event before sending events over to the client
The issue was that touch::down event from the compositor to client apps
would send the previous motion events coordinates and this obviously made
the client do the wrong thing. This happened because we were not waiting
for a SYN event to come from evdev before sending down, motion or up events.

https://bugs.freedesktop.org/show_bug.cgi?id=51909
2013-02-27 15:28:21 -05:00
Pekka Paalanen
6d8fcc75b8 update .gitignores for src/ and man/
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-26 11:20:29 -05:00
Ander Conselvan de Oliveira
2002f88888 compositor-drm: Fix a crash with a fullscreen surface with driver mode
If there was a fullscreen surface using driver mode when a vt switch is
triggered, but something caused it to be gone when switching back (such
as the client being killed), a call to drm_output_switch_mode() is made
to restore the old mode, and that sets the output's current drm_fb to
NULL, so that the new mode is set drm_output_repaint(). This led to a
crash in vt_func(), because it tried to access output->current for
restoring the old mode.

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

https://bugs.freedesktop.org/show_bug.cgi?id=60675
2013-02-26 11:13:37 -05:00
Scott Moreau
8eb6748f15 compositor-drm: Use __func__ instead of hardcoded string 2013-02-25 13:17:47 -05:00
Ander Conselvan de Oliveira
dda9d78ec9 shell: Go straight to sleep if the sceensaver isn't configured
If the screensaver path is not set, nothing would set the compositor
state to sleeping. In that case, outpus DPMS state was never set to
off.
2013-02-22 08:05:41 -05:00
Ander Conselvan de Oliveira
b17537e2c5 shell: Use weston_compositor_sleep() instead of setting DPMS state
This should have been changed when the weston_compositor_sleep() entry
point was added.
2013-02-22 08:05:34 -05:00
Ander Conselvan de Oliveira
a4575634f4 compositor: Rename lock and unlock signals to idle and wake
After the changes introduced in the previous patch, those names are
more appropriate. It is up to the shell to decide when to lock the
screen.
2013-02-21 21:12:45 -05:00
Ander Conselvan de Oliveira
87524b65cb compositor: Move state tracking complexity into shell
Previously, when coming back from idle the compositor would try to
track if the unlock signal needed to be sent, and the shell would
change the compositor state in order to track when to display or
hide the screensaver.

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

The calls to weston_compositor_wake() in the shell where there to allow
it to trigger the fade in only after the lock surface was configured.
Now the shell has full control of the fade and does not needed to
change the compositor state to do that, so those calls were replaced
with shell_fade() calls.
2013-02-21 21:12:45 -05:00
Ander Conselvan de Oliveira
859e885985 shell: Use its own timer for the screensaver timeout
Previously, the shell would change the idle_time of the compositor to
the screensaver timeout and wake the compositor again, so that after
the timeout the compositor would fade to black and then the shell would
receive the lock signal again and would set the dpms state of the
outputs to off.

Instead, use a screensaver-specific timer for that, and call lock
without the back and forth between the shell and core Weston.
2013-02-21 21:12:45 -05:00
Ander Conselvan de Oliveira
19d10ef925 compositor: Move fade animation out of core Weston into shell
Previously, it was impossible to override the fade in/out behavior of
Weston using a different shell, since this was implemented in core
Weston. This also led to complicated interaction between the shell and
the core when displaying lock surfaces and screensavers.

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

On the shell side, the fade was re-implemented in a slightly different
manner. Instead of using a custom frame function, the fade animation
from animation.c is used. The interface for starting the fade was also
changed to take the value of an enum instead of a float alpha value,
in order to improve readability.
2013-02-21 21:12:44 -05:00
Ander Conselvan de Oliveira
29f30fab27 animation: Schedule a repaint only on the outputs the surface is in
The function weston_surface_animation_frame() would schedule a repaint
on all outputs, as weston_surface_schedule_repaint() didn't exist when
it was implemented.
2013-02-21 21:12:44 -05:00
Ander Conselvan de Oliveira
8a91324c13 animation: When fading, round the surface alpha when close to 0 or 1
The spring code stops when the current value is withing 0.0002 of the
target. In that case, round the value to 0.0 or 1.0 to enable the use
of fast paths, such as disabling blending in the GL renderer when an
opaque region is set.
2013-02-21 21:12:44 -05:00
Ander Conselvan de Oliveira
ee41605446 animation: Make fade more controllable
Add parameters to weston_fade_run() for setting the initial and target
values for the fade, as well as a parameter to set the spring constant
used for the animation.

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

This will be used to move the fade animation from core Weston into the
shell. These changes are needed to be able to fade out as well as in,
and to be able to reverse the fade in case of user input.
2013-02-21 21:12:44 -05:00
Ander Conselvan de Oliveira
cbdebc2370 compositor: Split util.c into binding.c and animation.c
The few functions not related to bindings or animations were moved
into compositor.c.
2013-02-21 21:12:44 -05:00
Kristian Høgsberg
142d546c14 compositor: Don't free config_file before we done using it 2013-02-21 21:10:36 -05:00
Kristian Høgsberg
762b166c35 xwm: Only call set_fullscreen if the window is mapped
If we get a fullscreen client message before we map the window, we don't
have a shell surface yet.  Just dont call set_fullscreen yet, and rely on
xserver_map_shell_surface() to fullscreen it when we map it.
2013-02-21 20:18:37 -05:00
Kristian Høgsberg
cb4685bbd1 Pass argc and argv to modules
This lets modules parse options from the command line.
2013-02-20 15:37:49 -05:00
Kristian Høgsberg
4172f668e7 Pass argc pointer to parse_options()
This lets us keep argc up to date as the backend picks out arguments
from the argv array.
2013-02-20 15:27:49 -05:00
Kristian Høgsberg
a1377cf198 Add missing builddir includes for version.h
af4f2aaf19 broke this
2013-02-20 14:47:43 -05:00
Kristian Høgsberg
7cc3d846f4 compositor-x11: Only try to fullscreen if WM has _NET_WM_STATE_FULLSCREEN
If the window manager doesn't support _NET_WM_STATE_FULLSCREEN, the
fullscreen protocol won't work and we end up waiting indefintely for a
confiure event that doesn't come.

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

https://bugs.freedesktop.org/show_bug.cgi?id=61133
2013-02-19 21:19:04 -05:00
Giulio Camuffo
8aa16174e2 shell: Do not hang when mapping a popup twice
When calling shell_map_popup() more than one time on the same shell_surface
the parent transform was getting added more than one time to the transform
list, resulting in an infinite loop when going through the list with
wl_list_for_each in weston_surface_update_transform_enable().
This commit removes the old transform before adding it again.
2013-02-18 16:56:40 -05:00
Rafal Mielniczuk
db790573ad compositor: set data_device keyboard focus in seat_get_keyboard
Because seat_get_keyboard is called after initial
weston_surface_activate, wl_data_device_set_keyboard_focus
fails to send data offer for newly connected client due to
wl_seat.focus_resource being NULL.

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

https://bugs.freedesktop.org/show_bug.cgi?id=60617
2013-02-18 16:52:59 -05:00
Kristian Høgsberg
8764466c6b udev-seat: Simplfy enable/disable interface a bit
We always call enable_udev_monitor and add_devices together and always
disable_udev_monitor and remove_devices together.  Let's just have one
entry point for enable and one for disable.
2013-02-18 16:50:19 -05:00
Kristian Høgsberg
7e597f22d5 compositor-fbdev: Use udev_seat
Let's share the udev input device discovery code.
2013-02-18 16:35:38 -05:00
Kristian Høgsberg
98cfea6f49 compositor-drm: Move udev_seat to its own file
We get to move the input code out of compositor-drm.c and we'll be
able to share it with the fbdev backend.
2013-02-18 16:26:19 -05:00
Kristian Høgsberg
e809103e0f compositor-drm: Rename a few evdev_* functions to udev_seat_*
We used to have a bit of naming trouble when the protocol object was called
wl_input_device and the individual evdev devices were call evdev_device.
And we didn't have a drm_seat.  Now that we've fixed all that, it's clear
that the drm_seat is all about udev discovery and hotplug of evdev devices,
so let's call it udev_seat instead.
2013-02-18 16:26:19 -05:00
Kristian Høgsberg
2f07ef6963 xkb: Don't call exit on failure in weston_compositor_xkb_init()
This will exit without cleaning vt modes and leave the system stuck.

https://bugs.freedesktop.org/show_bug.cgi?id=60817
2013-02-18 15:29:35 -05:00
Kristian Høgsberg
4fd273f400 compositor-x11: Fix pointer type warning 2013-02-18 15:29:35 -05:00