Commit Graph

2871 Commits

Author SHA1 Message Date
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
Kristian Høgsberg
24639cc0ca Makefile.am: Distribute weston.ini sample
https://bugs.freedesktop.org/show_bug.cgi?id=61388
2013-02-25 13:04:40 -05:00
Quentin Glidic
056e8379a2 Makefile.am: SUBDIRS is automagic
DIST_SUBDIRS should be used for corner cases only, not for conditional
SUBDIRS:

  If `SUBDIRS' is defined conditionally using Automake conditionals,
  Automake will define `DIST_SUBDIRS' automatically from the possible
  values of `SUBDIRS' in all conditions.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-22 08:41:08 -05:00
Quentin Glidic
f14977f854 tests: Use&Fix parallel tests
Also fix automake 1.13 support

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-22 08:35:22 -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
Jan Arne Petersen
d5a97ae053 tests: Fix text-test
Updated to changed text protocol.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-20 15:12:34 -05:00
Kristian Høgsberg
a1377cf198 Add missing builddir includes for version.h
af4f2aaf19 broke this
2013-02-20 14:47:43 -05:00
Pekka Paalanen
6f41b0727c window: fix display_acquire_window_surface()
Make sure that display_acquire_window_surface() creates the Cairo
surface as necessary. Otherwise surface->toysurface can be NULL.

This fixes weston-screensaver fullscreen mode. Demo mode was not
affected as it uses window decorations, and so the Cairo surface is
created. This regression was introduced by:

commit 0c4445ba57
Author: Pekka Paalanen <ppaalanen@gmail.com>
Date:   Wed Feb 13 16:17:23 2013 +0200

    window: create Cairo surfaces on demand for redraw

Reported-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-02-20 14:13:41 -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
Kristian Høgsberg
97a5614563 weston.ini: Use 'modeline' key for modeline example
When specifying a modeline, use the modeline key.  Make the example
weston.ini do that.
2013-02-18 20:10:35 -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
Quentin Glidic
bb41005259 configure.ac: Make xwayland tests depend on xwayland
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-18 16:03:51 -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
Kristian Høgsberg
506238454b compositor-drm: Remember to drop master in drm error handling
Otherwise we'll kill whatever other display sever we're switching back to.
The tricky thing here is that we never explicitly set drm master in the
startup path, we get that implicitly from being the first to open the
drm device.  Even so, we need to drop it before switching VTs.
2013-02-18 15:29:35 -05:00
Kristian Høgsberg
4905efdc99 src/Makefile.am: Use $(libdir) instead of @libdir@
This allows overriding prefix and libdir at make time.  Noticed
by David Herrmann.
2013-02-18 15:29:35 -05:00
Kristian Høgsberg
af4f2aaf19 Install header files and pkg-config file for external modules
This patch installs the three header files that define the compositor
plugin interface as well as a pkg-config file.  This allows
building weston plugins outside the weston tree.  We currently don't make
any guarantees about the plugin API/ABI except that within a stable
branch we won't break it.
2013-02-18 15:29:35 -05:00
Marcin Slusarz
554a0da74a compositor: Use libunwind if available for better backtraces
libunwind has a dwarf parser and automatically queries the dlinfo
for location of dlopened modules.  The resulting backtrace is much
better and includes stack frames in dynamically loaded modules.

krh: Originally submitted for Xorg, adapted for weston:

  http://lists.x.org/archives/xorg-devel/2013-February/035493.html

Note this require libunwind at least 1.1 to get the pkg-config files.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2013-02-18 15:29:17 -05:00
Jan Arne Petersen
1cc9e08d2f text: Split out cursor_position
Add an extra cursor_position, which also allows to change the anchor
(for slections). Change the index type to int to allow setting it before
the beginning of a commited string.

The cursor should not be moved as a direct repsonse to this event but
atomically on the next commit_string event.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:08:01 -05:00
Jan Arne Petersen
964b517c9b text: Rename set_micro_focus request
Rename set_micro_focus to set_cursor_rectangle to make more clear, what
it refers to.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:42 -05:00
Jan Arne Petersen
6138197337 text: Add show/hide_input_panel requests
Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:35 -05:00
Jan Arne Petersen
0eabcaafae text: Add commit request
Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:03 -05:00
Jan Arne Petersen
f255165bd4 text: Remove unused requests/events
Put them back in, when we know what arguments they will have.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:06:48 -05:00
Jan Arne Petersen
ffbb20f730 text: Move input_panel interface to input-method
Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).

Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:05:04 -05:00
Jan Arne Petersen
23ccfb3ef9 shell: Do not hang after setting input_panel twice
Ignore multiple calls with the same surface in input_panel_set_surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:18 -05:00
Jan Arne Petersen
af7b6c9c6d shell: Do not crash when hiding input_panel
Allow an input panel to attach a NULL-buffer for hiding.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:08 -05:00
Jan Arne Petersen
3fb6e71814 editor: Add support for backspace keysym events
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:48 -05:00
Jan Arne Petersen
8746ba0d29 doc: add some more text protocol documentation
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:42 -05:00
Jan Arne Petersen
a75a789fc1 text: fix weston key bindings with input methods
Add a struct weston_keyboard, to handle the input method grab.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:26 -05:00