Ander Conselvan de Oliveira [Tue, 26 Feb 2013 11:44:58 +0000 (13:44 +0200)]
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
Scott Moreau [Sat, 23 Feb 2013 19:04:56 +0000 (12:04 -0700)]
compositor-drm: Use __func__ instead of hardcoded string
Kristian Høgsberg [Mon, 25 Feb 2013 18:03:15 +0000 (13:03 -0500)]
Makefile.am: Distribute weston.ini sample
https://bugs.freedesktop.org/show_bug.cgi?id=61388
Quentin Glidic [Thu, 21 Feb 2013 18:13:20 +0000 (19:13 +0100)]
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>
Quentin Glidic [Thu, 21 Feb 2013 20:01:23 +0000 (21:01 +0100)]
tests: Use&Fix parallel tests
Also fix automake 1.13 support
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Ander Conselvan de Oliveira [Fri, 22 Feb 2013 12:16:19 +0000 (14:16 +0200)]
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.
Ander Conselvan de Oliveira [Fri, 22 Feb 2013 12:16:18 +0000 (14:16 +0200)]
shell: Use weston_compositor_sleep() instead of setting DPMS state
This should have been changed when the weston_compositor_sleep() entry
point was added.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:23 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:22 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:21 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:20 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:19 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:18 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:17 +0000 (18:35 +0200)]
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.
Ander Conselvan de Oliveira [Thu, 21 Feb 2013 16:35:16 +0000 (18:35 +0200)]
compositor: Split util.c into binding.c and animation.c
The few functions not related to bindings or animations were moved
into compositor.c.
Kristian Høgsberg [Fri, 22 Feb 2013 02:10:36 +0000 (21:10 -0500)]
compositor: Don't free config_file before we done using it
Kristian Høgsberg [Fri, 22 Feb 2013 01:18:37 +0000 (20:18 -0500)]
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.
Kristian Høgsberg [Wed, 20 Feb 2013 20:37:49 +0000 (15:37 -0500)]
Pass argc and argv to modules
This lets modules parse options from the command line.
Kristian Høgsberg [Wed, 20 Feb 2013 20:27:49 +0000 (15:27 -0500)]
Pass argc pointer to parse_options()
This lets us keep argc up to date as the backend picks out arguments
from the argv array.
Jan Arne Petersen [Tue, 19 Feb 2013 18:26:55 +0000 (19:26 +0100)]
tests: Fix text-test
Updated to changed text protocol.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Kristian Høgsberg [Wed, 20 Feb 2013 19:47:43 +0000 (14:47 -0500)]
Add missing builddir includes for version.h
af4f2aaf198522b51cf2afc2f25f9189c2432887 broke this
Pekka Paalanen [Wed, 20 Feb 2013 11:39:17 +0000 (13:39 +0200)]
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
0c4445ba5756e51007606028bce00b2ecb352bd7
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>
Kristian Høgsberg [Wed, 20 Feb 2013 02:19:04 +0000 (21:19 -0500)]
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
Kristian Høgsberg [Tue, 19 Feb 2013 01:10:35 +0000 (20:10 -0500)]
weston.ini: Use 'modeline' key for modeline example
When specifying a modeline, use the modeline key. Make the example
weston.ini do that.
Giulio Camuffo [Mon, 18 Feb 2013 21:26:01 +0000 (22:26 +0100)]
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.
Rafal Mielniczuk [Sun, 17 Feb 2013 14:55:55 +0000 (15:55 +0100)]
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
Kristian Høgsberg [Mon, 18 Feb 2013 21:50:19 +0000 (16:50 -0500)]
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.
Kristian Høgsberg [Mon, 18 Feb 2013 21:35:26 +0000 (16:35 -0500)]
compositor-fbdev: Use udev_seat
Let's share the udev input device discovery code.
Kristian Høgsberg [Mon, 18 Feb 2013 21:15:53 +0000 (16:15 -0500)]
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.
Kristian Høgsberg [Mon, 18 Feb 2013 20:43:29 +0000 (15:43 -0500)]
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.
Quentin Glidic [Mon, 18 Feb 2013 19:38:22 +0000 (20:38 +0100)]
configure.ac: Make xwayland tests depend on xwayland
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Kristian Høgsberg [Sat, 16 Feb 2013 19:29:24 +0000 (14:29 -0500)]
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
Kristian Høgsberg [Mon, 18 Feb 2013 20:04:07 +0000 (15:04 -0500)]
compositor-x11: Fix pointer type warning
Kristian Høgsberg [Mon, 18 Feb 2013 20:02:27 +0000 (15:02 -0500)]
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.
Kristian Høgsberg [Mon, 18 Feb 2013 20:26:28 +0000 (15:26 -0500)]
src/Makefile.am: Use $(libdir) instead of @libdir@
This allows overriding prefix and libdir at make time. Noticed
by David Herrmann.
Kristian Høgsberg [Sat, 16 Feb 2013 01:53:20 +0000 (20:53 -0500)]
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.
Marcin Slusarz [Mon, 18 Feb 2013 18:27:22 +0000 (13:27 -0500)]
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>
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:23 +0000 (15:52 +0100)]
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>
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:22 +0000 (15:52 +0100)]
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>
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:21 +0000 (15:52 +0100)]
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>
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:20 +0000 (15:52 +0100)]
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>
Jan Arne Petersen [Thu, 31 Jan 2013 14:52:19 +0000 (15:52 +0100)]
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>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:55 +0000 (21:26 +0100)]
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>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:54 +0000 (21:26 +0100)]
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>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:53 +0000 (21:26 +0100)]
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>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:52 +0000 (21:26 +0100)]
editor: Add support for backspace keysym events
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:51 +0000 (21:26 +0100)]
doc: add some more text protocol documentation
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:50 +0000 (21:26 +0100)]
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>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:49 +0000 (21:26 +0100)]
simple-im: fix for protocol changes
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:48 +0000 (21:26 +0100)]
keyboard: add support for invoke_action
Set the pre-edit cursor on the clicked index on invoke_action.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:47 +0000 (21:26 +0100)]
editor: add support for invoke_action
Call invoke_action request when a currently composed word is clicked.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:46 +0000 (21:26 +0100)]
text: add support for invoke_action request
Add a request to be called by the client when the word currently being
composed is tapped by the user. Input methods often use this information
to offer more word suggestions to the user.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:45 +0000 (21:26 +0100)]
editor: Add content type example
Set the content type purpose to numeric of the second entry.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:44 +0000 (21:26 +0100)]
keyboard: Add support for a numeric layout
Add support for a numeric key layout, which is used for some numeric
content purpose types.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:43 +0000 (21:26 +0100)]
text: Add content type support to text protocol
Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:42 +0000 (21:26 +0100)]
editor: add support for pre-edit styling
Add pango dependency to the example and use pango for text handling.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:41 +0000 (21:26 +0100)]
keyboard: Add support for pre-edit styling
Adds a button to the keyboard to support different styles of pre-edit
styling.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:40 +0000 (21:26 +0100)]
editor: support commit on reset
Commit pending pre-edit text when focus-out or changing the cursor
location.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:39 +0000 (21:26 +0100)]
text: add serial argument to text protocol
The serial argument will allow to ignore outdated events from before a
reset request.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Wed, 16 Jan 2013 20:26:38 +0000 (21:26 +0100)]
text: add pre-edit styling support to protocol
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Ander Conselvan de Oliveira [Fri, 15 Feb 2013 16:44:19 +0000 (18:44 +0200)]
shell: Set the DPMS state if the screensaver fails to launch or dies
The lock hook in desktop-shell only changes the DPMS state the second
time it is called, because during the first time it launches the
screensaver and wakes the compositor again when the screensaver surface
is configured. However, if the screensaver fails to launch, the output
is left in an enabled state, even thought there's no content being
displayed on the screen.
Fix this by disabling the outputs when the screensaver dies if the
shell is still locked.
https://bugs.freedesktop.org/show_bug.cgi?id=60084
Kristian Høgsberg [Fri, 15 Feb 2013 02:14:11 +0000 (21:14 -0500)]
compositor-x11: Wait for configure_notify for fullscreen
Some window managers (kwin at least) don't give us our final fullscreen
size before map_notify. Currently we stop waiting for configire_notify
once we get mapped and in case of kwin that means we don't receive our
fullscreen size configure_notify. With this patch, if we don't get a
configure_notify before map_notify, we just wait for the first one after
map_notify and hope that's our size.
https://bugs.freedesktop.org/show_bug.cgi?id=60608
Kristian Høgsberg [Fri, 15 Feb 2013 03:01:58 +0000 (22:01 -0500)]
xwm: Don't leak pending.input region
It's not really a leak, since the region is always a rectangle, but let's
play by the rules.
Kristian Høgsberg [Fri, 15 Feb 2013 03:01:04 +0000 (22:01 -0500)]
xwm: Fix silly region math
We were setting up the opaque region to be the window size and then
intersecting with the opaque rectange that's always contained in the window
rectangle. Just initialize to the opaque rectangle.
Kristian Høgsberg [Fri, 15 Feb 2013 02:56:32 +0000 (21:56 -0500)]
xwm: Fix input region regression from commit changes
This must be the last regression from the surface commit changes. We
need to set the pending.input region, otherwise the region will be
overwritten on commit.
https://bugs.freedesktop.org/show_bug.cgi?id=60610
Jan Arne Petersen [Mon, 11 Feb 2013 14:10:11 +0000 (15:10 +0100)]
shell: Fix bug when input panel is shown twice
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Kristian Høgsberg [Fri, 15 Feb 2013 02:31:44 +0000 (21:31 -0500)]
shell: Add back ability to rotate unresponsive surfaces
When a surface in deemed unresponsive and we trigger the busy cursor, it's
no longer possible to rotate the surface. This is clearly unacceptable.
This patch adds handling of right clicks to the busy grab so that we can
continue to rotate a surface even if the client is sleeping.
https://bugs.freedesktop.org/show_bug.cgi?id=60609
Kristian Høgsberg [Thu, 14 Feb 2013 21:31:42 +0000 (16:31 -0500)]
window.c: Don't allow moving a maximized window
Ideally the shell would send an unmaximize event to the client when
we try to move a maximized window, but for now, let's just prevent
moving maximized windows.
https://bugs.freedesktop.org/show_bug.cgi?id=56296
Rob Bradford [Tue, 12 Feb 2013 11:53:47 +0000 (11:53 +0000)]
shell: Bypass fullscreen scaling if surface width and height match output
If our surface has width and height set to the same dimensions as the output
then we can bypassing the scale factor calculation and addition of the
transformation.
The use case that led to this optimisation is the playback of video using
gstreamer-vaapi with the "scale" method. The video is the same dimensions as
the output (1080p.)
Martin Andersson [Tue, 12 Feb 2013 23:11:12 +0000 (00:11 +0100)]
weston-launcher: Add missing newline in error message
Pekka Paalanen [Wed, 13 Feb 2013 14:17:23 +0000 (16:17 +0200)]
window: create Cairo surfaces on demand for redraw
This introduces the function widget_cairo_create().
Instead of directly referencing surface->cairo_surface, use the function
widget_cairo_create(), which will create the cairo_surface as necessary,
and just returns a Cairo drawing context. Also fix window_get_surface()
similarly.
Now we can go through idle_redraw() without always creating Cairo
surfaces and committing them. This will be useful with sub-surfaces,
where repainting one sub-surface does not need to force the repaint of
all surfaces of a window.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:22 +0000 (16:17 +0200)]
window: let menu and tooltip redraw use widget size
Menu and tooltip redraw functions were using the surface size directly.
For consistency, make them use the widget size instead, it is the same.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:21 +0000 (16:17 +0200)]
window: remove the transparent flag as unused
This flag was always true, and never false.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:20 +0000 (16:17 +0200)]
window: move cairo_surface into struct surface
Widgets should be rendering to a cairo_surface for a particular
wl_surface, just like buffers are per surface.
window_flush() has a change in behaviour: it will now send
wl_shell_surface.set_toplevel also without a cairo_surface to be
attached. This shouldn't change anything in practice.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:19 +0000 (16:17 +0200)]
window: add surface pointer to widget
So that given a widget, we can access the surface specific data, like
buffers, and input and opaque regions.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:18 +0000 (16:17 +0200)]
window: move input and opaque regions into struct surface
They are per wl_surface state.
The frame widget is always on the main surface, since it can be created
only for the window. That is why frame_resize_handler() can simply
assume that the surface is the main_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:17 +0000 (16:17 +0200)]
window: move 'widget' member into struct surface
Repaint and resizing widget recursions must start from the root widget
of each (sub-)surface, so that buffers and regions get initialized
correctly. Make it easier by moving the widget field from struct window
to struct surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:16 +0000 (16:17 +0200)]
window: assimilate window_get_resize_dx_dy() into the call site
Not used elsewhere, just cleanup.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:15 +0000 (16:17 +0200)]
window: move buffer type and transform into struct surface
These are surface specifics, since buffers are surface specific.
SURFACE_HINT_RESIZE is moved together to the other SURFACE_* flags, so
that surface_create_surface() would not need two flags arguments.
struct toysurface::prepare vfunc checks for SURFACE_HINT_RESIZE, and
egl_window_surface_create() and shm_surface_create() check for the
non-HINT flags.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:14 +0000 (16:17 +0200)]
window: move toysurface and allocation to struct surface
Fields 'allocation' and 'server_allocation' are surface specific. Fields
'saved_allocation', 'min_allocation', and 'pending_allocation' are
window specific, and will not be moved.
Field 'toysurface' is naturally surface specific, since it provides the
backing storage for the wl_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:13 +0000 (16:17 +0200)]
window: create new struct surface with wl_surface
Struct window has many fields that are directly related to the
wl_surface, more than to the window as a whole. When we start composing
a window from several wl_surfaces, these fields need to be per
wl_surface, not per window.
Start separating such fields from struct window into struct surface by
moving the wl_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 13 Feb 2013 14:17:12 +0000 (16:17 +0200)]
window: destroy the 2nd shm buffer, if both released
Handle the case when we the compositor somehow migrates from requiring
double buffering into working on single buffering, so we release the
extra shm buffer.
Currently, I do not think this can happen in practice, but in the future
it may happen with sub-surfaces.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 14 Feb 2013 10:18:00 +0000 (12:18 +0200)]
window: check the initial wl_display_dispatch()
Check for errors in the first wl_display_dispatch() call. Otherwise
doing something silly like
$ WAYLAND_SOCKET=999 ./clickdot
will segfault.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 14 Feb 2013 09:49:12 +0000 (11:49 +0200)]
window: improve EGL-related error messages
Make them explicitly mention EGL, otherwise one can easily think that
"failed to initialize display" refers to Wayland display.
Also explicitly mention falling back to wl_shm. I tested this with a
LD_PRELOAD trick that overrides eglBindAPI and makes it fail.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Thu, 14 Feb 2013 17:09:41 +0000 (12:09 -0500)]
configure.ac: Add version to bug URL as well
Scott Moreau [Wed, 13 Feb 2013 21:29:35 +0000 (14:29 -0700)]
configure.ac: Change bugs.freedesktop.org product to Wayland
Update the bug link. Thanks to Rune K. Svendsen for spotting this.
https://bugs.freedesktop.org/show_bug.cgi?id=60818
Ander Conselvan de Oliveira [Wed, 13 Feb 2013 14:06:37 +0000 (16:06 +0200)]
compositor: Init fade surface color properly
When fading in, if a repaint was triggered after a call to
weston_compositor_fade() but before the first call to fade_frame(),
the fade surface wouldn't be drawn because its alpha channel wasn't
initialized properly.
Kristian Høgsberg [Wed, 13 Feb 2013 18:40:58 +0000 (13:40 -0500)]
screenshot: Print warning if we're not launched from weston
weston-screenshooter is a helper binary that weston launches to write the
screenshot to disk. If somebody tries to launch it by hand, print a
warning and mention the screenshot keybinding.
Kristian Høgsberg [Wed, 13 Feb 2013 01:07:05 +0000 (20:07 -0500)]
xwm: Support _NET_WM_STATE_FULLSCREEN
We can now handle fullscreen X windows. X clients request to go fullscreen
buy sending a _NET_WM_STATE client message to the root window. When that
happens we call into the shell interface and asks the shell to make the
surface fullscreen. The shell will then resize the window, which causes
the X wm to configure the X window appropriately.
Make sure we ignore configure requests from fullscreened clients and send out
the synthetic configure notify as required in that case.
Finally, inspect _NET_WM_STATE before mapping so we can handle initial
fullscreen correctly.
Scott Moreau [Mon, 11 Feb 2013 11:45:38 +0000 (04:45 -0700)]
Use __func__ in log message instead of hard coded function name
Pekka Paalanen [Fri, 8 Feb 2013 15:01:27 +0000 (17:01 +0200)]
tests: add test for buffer release event
Tests especially, that attach-attach-commit does not result in a release
of the first buffer.
Also tests, that the old buffer is released when a new buffer has been
attached, committed, and displayed (frame callback).
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 8 Feb 2013 15:01:26 +0000 (17:01 +0200)]
tests: export create_shm_buffer() helper
Lets the tests create additional buffers easily.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 8 Feb 2013 15:01:25 +0000 (17:01 +0200)]
tests: add frame callback waiting helpers
To avoid duplicating the code for setting and waiting for a frame
callback, add helpers for it.
Convert move_client() to use the new helpers.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Fri, 8 Feb 2013 12:57:00 +0000 (14:57 +0200)]
tests: Add XWayland test
By default enabled but one can disable it by passing --disable-xwayland-test
to the configure script. Also, the weston-tests-env script is trying to load
xwayland.so in either case, but it behaves resilient in the absence of that
meaning all the other tests are still going to be kicked for running.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Konno, Joe [Wed, 30 Jan 2013 15:38:57 +0000 (07:38 -0800)]
configure: prevent premature HAVE_GLU check
When cairo-gl and mesa-glu are present on the system, autoconf successfully
recognizes both. However, I was wondering why weston-screensaver was not
building since autoconf reported all dependencies were met.
Move the mesa-glu PKG_CHECK before the conditional. Additionally, remove
redundant check for enable_egl, as it is implied when GLU is 'yes.'
Signed-off-by: Joe Konno <joe.konno@intel.com>
U. Artie Eoff [Tue, 29 Jan 2013 23:30:09 +0000 (15:30 -0800)]
tests: fix assignment typo, should be comparison
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Philip Withnall [Sat, 2 Feb 2013 12:02:32 +0000 (12:02 +0000)]
fbdev: Add an fbdev compositor backend using pixman and evdev
Add a frame buffer backend using pixman to render to fbdev.
This has been tested against nouveaufb but nothing else. Much of the code
came straight from the rpi backend (and copyright has been attributed
accordingly).
The behaviour of this backend on less modern frame buffers has yet to be
tested.
The refresh rate is calculated from the frame buffer's metadata. Every frame
is finished in synchrony with the refresh rate.
Frame buffer devices are currently specified on the command line (or using
the default of /dev/fb0); udev could be used in future to enumerate them.
pixman is used for compositing, and a suitable pixman format is built from
the frame buffer's metadata. This doesn't support the full range of
frame buffer formats, but does support varying BPPs of RGBA and ARGB. That
should be enough for now.
The following are not currently supported:
• FOURCC
• Non-packed formats (interleaved, planes, etc.)
• Non-true-colour formats (monochrome, greyscale, etc.)
• Big-endian formats (with component MSBs on the right)
• Non-RGBA and non-ARGB formats
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
Kristian Høgsberg [Sat, 2 Feb 2013 15:32:25 +0000 (10:32 -0500)]
configure.ac: Bump git master version to 1.0.90
We use 1.0.90 as the version number for the git master code. This way it's
always newer than any stable version.
Scott Moreau [Wed, 29 Aug 2012 21:15:58 +0000 (15:15 -0600)]
Add --version option
Kristian Høgsberg [Tue, 29 Jan 2013 21:56:15 +0000 (16:56 -0500)]
compositor-drm: Use matrix type to test for drm plane compatibility
The drm planes (sprites) only support translation and scaling. Now that
we have matrix.type, we can just look there to see if the transform is
compatible with kms.