platform/upstream/weston.git
11 years agotests: Fix leftover wl_client_add_versioned_object()
Kristian Høgsberg [Wed, 3 Jul 2013 22:13:33 +0000 (18:13 -0400)]
tests: Fix leftover wl_client_add_versioned_object()

The search and replace missed this one.

11 years agoshell: Fix calculation of center point in surface rotation
Louis-Francis Ratté-Boulianne [Wed, 3 Jul 2013 13:58:22 +0000 (15:58 +0200)]
shell: Fix calculation of center point in surface rotation

Make sure the center point of a rotation is not rounded to an
integer. It makes the calculation consistent with others in the
shell. It also ensures surfaces rotated 180 degrees are at the
exact same place.

11 years agoUse wl_resource_create() for creating resources
Jason Ekstrand [Fri, 28 Jun 2013 01:17:02 +0000 (20:17 -0500)]
Use wl_resource_create() for creating resources

This commit sets the version numbers for all added/created objects.  The
wl_compositor.create_surface implementation was altered to create a surface
with the same version as the underlying wl_compositor.  Since no other
"child interfaces" have version greater than 1, they were all hard-coded to
version 1.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agowindow: Request version 3 of wl_compositor
Jason Ekstrand [Thu, 27 Jun 2013 03:20:31 +0000 (22:20 -0500)]
window: Request version 3 of wl_compositor

Originally window.c was requesting version 1 but several clients were
calling version 2 and 3 events including the desktop shell itself.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoAdd a MIN macro
Jason Ekstrand [Thu, 27 Jun 2013 03:20:30 +0000 (22:20 -0500)]
Add a MIN macro

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoxwm: Use empty opaque region for windows with alpha
MoD [Sat, 22 Jun 2013 16:04:21 +0000 (11:04 -0500)]
xwm: Use empty opaque region for windows with alpha

Window contents cannot be assumed to be fully opaque for windows drawn with
a RGBA visual. The optimization of setting a full opaque region is limited to
windows with a color depth != 32.

11 years agowcap-decode: Add 444 YUV Planar output
David Richards [Mon, 1 Jul 2013 01:20:13 +0000 (18:20 -0700)]
wcap-decode: Add 444 YUV Planar output

Done in the most simple way possible, for those who like nice things

11 years agoeditor: Fix segfault when deleting the first character
Daiki Ueno [Fri, 28 Jun 2013 09:59:44 +0000 (18:59 +0900)]
editor: Fix segfault when deleting the first character

11 years agotouchpad: Handle two-finger click as right click for button pads
Kristian Høgsberg [Mon, 1 Jul 2013 16:48:55 +0000 (12:48 -0400)]
touchpad: Handle two-finger click as right click for button pads

11 years agobuild: Make libxkbcommon build-time optional in the compositor
Rob Bradford [Mon, 24 Jun 2013 15:52:45 +0000 (16:52 +0100)]
build: Make libxkbcommon build-time optional in the compositor

v2: Incorporate review feedback from Daniel Stone - improved configure
message about the purpose of this option and reorganisation of #ifdefs.

11 years agoinput: Add support for making libxkbcommon optional
Matt Roper [Mon, 24 Jun 2013 15:52:44 +0000 (16:52 +0100)]
input: Add support for making libxkbcommon optional

In embedded environments, devices that appear as evdev "keyboards" often
have no resemblence to PC-style keyboards.  It is not uncommon for such
environments to have no concept of modifier keys and no need for XKB key
mapping; in these cases libxkbcommon initialization becomes unnecessary
startup overhead.  On some SOC platforms, xkb keymap compilation can
account for as much as 1/3 - 1/2 of the total compositor startup time.

This patch introduces a 'use_xkbcommon' flag in the core compositor
structure that indicates whether the compositor is running in "raw
keyboard" mode.  In raw keyboard mode, the compositor bypasses all
libxkbcommon initialization and processing.  'key' events containing the
integer keycode will continue to be delivered via the wl_keyboard
interface, but no 'keymap' event will be sent to clients.  No modifier
handling or keysym mapping is performed in this mode.

Note that upstream sample apps (e.g., weston-terminal or the
desktop-shell client) will not recognize raw keycodes and will not react
to keypresses when the compositor is operating in raw keyboard mode.
This is expected behavior; key events are still being sent to the
client, the client (and/or its toolkit) just isn't written to handle
keypresses without doing xkb keysym mapping.  Applications written
specifically for such embedded environments would be handling keypresses
via the raw keycode delivered as part of the 'key' event rather than
using xkb keysym mapping.

Whether to use xkbcommon is a global option that applies to all
compositor keyboard devices on the system; it is an all-or-nothing flag.
This patch simply adds conditional checks on whether xkbcommon is to be
used or not.

v3 don't send zero as the file descriptor - instead send the result of
opening /dev/null

v2 by Rob Bradford <rob@linux.intel.com>: the original version of the
patch used a "raw_keycodes" flag instead of the "use_xkbcommon" used in
this patch.

v1: Reviewed-by: Singh, Satyeshwar <satyeshwar.singh@intel.com>
v1: Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>

11 years agotoytoolkit: Allow operation without a keymap
Matt Roper [Mon, 24 Jun 2013 15:52:43 +0000 (16:52 +0100)]
toytoolkit: Allow operation without a keymap

In preparation for upcoming changes, we want to make sure that apps
written with the toy toolkit continue to operate properly if no XKB
keymap is received.  If there's no XKB keymap, then we shouldn't
try to figure out keyboard modifier states (since we probably don't
even have equivalents of PC-style modifiers).

Reviewed-by: Singh, Satyeshwar <satyeshwar.singh@intel.com>
Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
11 years agoman: Add documentation for output seat confining
Rob Bradford [Tue, 25 Jun 2013 17:56:43 +0000 (18:56 +0100)]
man: Add documentation for output seat confining

v2: Add some explanation about the default seat

11 years agocompositor-drm: Enable seat constraining when configured in weston.ini
Rob Bradford [Tue, 25 Jun 2013 17:56:42 +0000 (18:56 +0100)]
compositor-drm: Enable seat constraining when configured in weston.ini

This change tweaks weston_pointer_clamp to take into consideration if a
seat is constrained to a particular output by only considering the
pointer position valid if it is within the output we a constrained to.
This function is also used for the initial warping of the pointer when a
constraint is first established.

The other two changes are the application of the constraint when either
a new device added or a new output created and therefore outputs and
input devices can be brought up in either order.

v2: the code in create_output_for_connector has been spun off into a
new function setup_output_seat_constraint (Ander). The inappropriate
warping behaviour has been resolved by using weston_pointer_clamp
(Pekka).

11 years agoxwayland: modify Makefile.am to clean up BUILD_SOURCES
Alex Wu [Thu, 27 Jun 2013 00:45:07 +0000 (08:45 +0800)]
xwayland: modify Makefile.am to clean up BUILD_SOURCES

11 years agoinput: Add weston_pointer_clamp function to ensure pointer visible
Rob Bradford [Tue, 25 Jun 2013 17:56:41 +0000 (18:56 +0100)]
input: Add weston_pointer_clamp function to ensure pointer visible

This refactors the code out from clip_pointer_motion into a function of
its own which can then be used elsewhere to clamp the pointer
coordinates to the range of the outputs.

This change also makes the caller of clip_pointer_motion use this new
function.

11 years agoudev-seat: Refactor out seat lookup and possible creation
Rob Bradford [Tue, 25 Jun 2013 17:56:40 +0000 (18:56 +0100)]
udev-seat: Refactor out seat lookup and possible creation

This change spills the code for looking up a seat by name and then
potentially creating it if it doesn't exist into a new function called
udev_seat_get_named.

This change allows us to reuse this code when looking up the seat
when parsing seat constraints per output.

11 years agotests: Fix direct access to resource->data in weston-test
Kristian Høgsberg [Tue, 25 Jun 2013 20:18:35 +0000 (16:18 -0400)]
tests: Fix direct access to resource->data in weston-test

11 years agonested: Fix direct access to resource->data
Kristian Høgsberg [Tue, 25 Jun 2013 20:15:27 +0000 (16:15 -0400)]
nested: Fix direct access to resource->data

11 years agogl-renderer: Split gl_renderer_attach() into smaller functions
Ander Conselvan de Oliveira [Fri, 7 Jun 2013 13:52:46 +0000 (16:52 +0300)]
gl-renderer: Split gl_renderer_attach() into smaller functions

11 years agogl-renderer: Fix initial upload of SHM buffer as texture
Ander Conselvan de Oliveira [Fri, 7 Jun 2013 13:52:45 +0000 (16:52 +0300)]
gl-renderer: Fix initial upload of SHM buffer as texture

The fix to not call glTexImage2D() on every attach does not properly
set the texture damage region appropriately when the surface has a
buffer transform with 90 or 270 degrees rotation, since it would simply
multiply the buffer dimensions by the buffer scale, but in this case
width and height are inverted.

A possible fix for this would be to add the properly transformed region
to the texture damage region. However, there is a conversion back to
buffer coordinates when doing the actual upload and the entire buffer
needs to be uploaded anyway. So we just set a flag signalling that and
handle that special case in gl_renderer_flush_damage().

11 years agogl-renderer: Track the buffer type in gl_surface_state
Ander Conselvan de Oliveira [Fri, 7 Jun 2013 13:52:44 +0000 (16:52 +0300)]
gl-renderer: Track the buffer type in gl_surface_state

Checking for gs->num_images for determining the previous buffer type
when attaching is not reliable. The number of images is never cleared
in the SHM path, so after a switch from an EGL buffer to SHM, every
following attach of an SHM buffer will happen with gs->num_images > 0,
and the code will assume the previous buffer was an EGL one.

Fix this by adding a buffer_type field to gl_surface_state.

11 years agocompositor: Remove a few legacy uses of wl_object
Kristian Høgsberg [Tue, 25 Jun 2013 19:34:59 +0000 (15:34 -0400)]
compositor: Remove a few legacy uses of wl_object

11 years agocompositor: Fix a couple of left-over wl_resource direct access
Kristian Høgsberg [Tue, 25 Jun 2013 19:34:33 +0000 (15:34 -0400)]
compositor: Fix a couple of left-over wl_resource direct access

11 years agogl-renderer: Use eglQueryWaylandBufferWL for getting width and height
Kristian Høgsberg [Tue, 25 Jun 2013 19:15:31 +0000 (15:15 -0400)]
gl-renderer: Use eglQueryWaylandBufferWL for getting width and height

This gets rid of the last remaining use of struct wl_buffer.

12 years agoprotocol: Add missing xml files to EXTRA_DIST
Kristian Høgsberg [Tue, 25 Jun 2013 16:05:10 +0000 (12:05 -0400)]
protocol: Add missing xml files to EXTRA_DIST

Reported by Sven Joachim <svenjoac@gmx.de>

12 years agosrc/.gitignore: add spring-tool to .gitignore
Nathan Reboud [Mon, 24 Jun 2013 15:09:21 +0000 (17:09 +0200)]
src/.gitignore: add spring-tool to .gitignore

11 years agodata-device: Remove redundant and confusing assignment
Kristian Høgsberg [Tue, 25 Jun 2013 15:28:18 +0000 (11:28 -0400)]
data-device: Remove redundant and confusing assignment

We were assigning drag from the resource user data, which was wrong
(resource data is the weston_seat) and confusing since drag is later
assigned newly malloc()ed memory.

11 years agodata-device: Don't leak wl_data_source in destructor
Kristian Høgsberg [Tue, 25 Jun 2013 15:26:31 +0000 (11:26 -0400)]
data-device: Don't leak wl_data_source in destructor

We used to refcount the data source, but switched to using a destroy signal
instead.  When we switched we forgot to free the source insted of
unreffing it.

11 years agocompositor: Fix remaining double free()s
Kristian Høgsberg [Tue, 25 Jun 2013 15:19:31 +0000 (11:19 -0400)]
compositor: Fix remaining double free()s

Previous commit didn't catch all double free()s, hopefully this one does.

11 years agocompositor: Remove double free()s in resource destructors
Kristian Høgsberg [Tue, 25 Jun 2013 14:29:30 +0000 (10:29 -0400)]
compositor: Remove double free()s in resource destructors

With the change to move free()ing of the wl_resource into wayland-server, we now have
a few cases where we double free the resource in the destructor.  This patch
removes those.

11 years agonested: Port away from old wl_resource API
Kristian Høgsberg [Mon, 24 Jun 2013 20:35:54 +0000 (16:35 -0400)]
nested: Port away from old wl_resource API

11 years agoAdd a weston_buffer structure to replace wl_buffer
Jason Ekstrand [Fri, 21 Jun 2013 01:38:23 +0000 (20:38 -0500)]
Add a weston_buffer structure to replace wl_buffer

This commit adds a weston_buffer structure to replace wl_buffer.  This way
we can hold onto buffers by just their resource.  In order to do this, the
every renderer.attach function has to fill in the weston_buffer.width and
weston_buffer.height fields.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agodata-device: Change resources in wl_data_offer and wl_data_source to pointers.
Jason Ekstrand [Fri, 14 Jun 2013 15:07:55 +0000 (10:07 -0500)]
data-device: Change resources in wl_data_offer and wl_data_source to pointers.

Because of its links to selection.c and xwayland, a destroy_signal field
was also added to wl_data_source.  Before selection.c and xwayland were
manually initializing the resource.destroy_signal field so that it could be
used without a valid resource.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoinput: check if the focus surface has a valid resource
Giulio Camuffo [Thu, 20 Jun 2013 16:13:07 +0000 (18:13 +0200)]
input: check if the focus surface has a valid resource

the resource can be NULL in some cases, like when the focus is
taken by the black_surface used in shell.c as fullscreen background.

11 years agocompositor-drm: select the highest possible mode frequency
Giulio Camuffo [Wed, 19 Jun 2013 13:19:19 +0000 (15:19 +0200)]
compositor-drm: select the highest possible mode frequency

the mode list is ordered so that the lower frequencies come
before the higher ones, so traverse the list from the end
to the beginning

11 years agoshell: Free temporary strings
Quentin Glidic [Tue, 18 Jun 2013 07:11:03 +0000 (09:11 +0200)]
shell: Free temporary strings

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
11 years agolog: Only use one string buffer
Kristian Høgsberg [Wed, 19 Jun 2013 13:07:28 +0000 (09:07 -0400)]
log: Only use one string buffer

This also fixes a mismatch between date_string and sizeof string in
the strftime call.

11 years agoxwayland: Use _exit() when exec() fails
Kristian Høgsberg [Tue, 18 Jun 2013 05:03:02 +0000 (01:03 -0400)]
xwayland: Use _exit() when exec() fails

Similar to 3b64d6 but for when we fork the X server.

11 years agoxwayland: Silence X wm debug logging
Kristian Høgsberg [Tue, 18 Jun 2013 05:00:27 +0000 (01:00 -0400)]
xwayland: Silence X wm debug logging

Much to verbose for default logging.  Use a wm_log() wrapper that we can
toggle on/off as needed.  Maybe we're ready for log domains now.

11 years agoweston-launch: Don't exit on SIGTERM
Kristian Høgsberg [Mon, 17 Jun 2013 19:23:20 +0000 (15:23 -0400)]
weston-launch: Don't exit on SIGTERM

Instead, forward signal to weston and wait for weston to clean up nicely.
Weston relies on weston-launch being around to shut down correctly,
so don't exit until we get the SIGCHLD from weston.  This make
killall weston-launch work properly.

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

11 years agoshell: Tweak spring animation for zoom animation type
Kristian Høgsberg [Mon, 17 Jun 2013 15:08:11 +0000 (11:08 -0400)]
shell: Tweak spring animation for zoom animation type

11 years agoshell: Fix warning and indentation in shell_surface_configure()
Kristian Høgsberg [Mon, 17 Jun 2013 14:33:14 +0000 (10:33 -0400)]
shell: Fix warning and indentation in shell_surface_configure()

11 years agoinput-panel: Bounce the input panel slide
Kristian Høgsberg [Mon, 17 Jun 2013 14:31:58 +0000 (10:31 -0400)]
input-panel: Bounce the input panel slide

A little bit over the top, but fun.  We may want to make a weston.ini key
for this eventually.

11 years agospring: Tweak the window fade-in spring to not overshoot
Kristian Høgsberg [Mon, 17 Jun 2013 14:10:28 +0000 (10:10 -0400)]
spring: Tweak the window fade-in spring to not overshoot

The fade animation overshoots and rings for a bit dipping back into
slightly transparent.  Bug 61675 was right.

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

11 years agospring: Make min/max part of spring parameters
Kristian Høgsberg [Mon, 17 Jun 2013 13:23:14 +0000 (09:23 -0400)]
spring: Make min/max part of spring parameters

Don't hard code the 0.0 - 1.0 spring envelope.

11 years agospring: Make clip behavior configurable
Kristian Høgsberg [Mon, 17 Jun 2013 13:15:22 +0000 (09:15 -0400)]
spring: Make clip behavior configurable

When the spring goes outside the envelope, we have a few options for
bringing it back: either just let it overshoot, bounce off the limit or
just clamp it.  Instead of controlling that with #ifdef, let's make it
a part of the spring state.

11 years agospring: End spring simulatio faster
Kristian Høgsberg [Mon, 17 Jun 2013 12:59:20 +0000 (08:59 -0400)]
spring: End spring simulatio faster

The spring animation runs for a long time after it has visually settled
down, because we're requiring too much stability.

11 years agoAdd spring-tool, a small utility to plot spring behavior
Kristian Høgsberg [Mon, 17 Jun 2013 12:48:57 +0000 (08:48 -0400)]
Add spring-tool, a small utility to plot spring behavior

The weston_spring is a very flexible and powerful mecanhism for driving
animations.  However, it can be a little difficult to tame, but this
little helper can plot the response of the spring to a set of initial
parameters and makes it easy to tune and tweak the spring behavior.

11 years agosubsurfaces: Use wl_resource_get accessors for subsurfaces
Jason Ekstrand [Fri, 14 Jun 2013 15:08:02 +0000 (10:08 -0500)]
subsurfaces: Use wl_resource_get accessors for subsurfaces

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agooutput: Use wl_resource_get accessors for weston_output resources
Jason Ekstrand [Fri, 14 Jun 2013 15:08:01 +0000 (10:08 -0500)]
output: Use wl_resource_get accessors for weston_output resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoinput: Use wl_resource_get accessor functions for resources
Jason Ekstrand [Fri, 14 Jun 2013 15:08:00 +0000 (10:08 -0500)]
input: Use wl_resource_get accessor functions for resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agotext-backend: Change resources to wl_resource pointers
Jason Ekstrand [Fri, 14 Jun 2013 15:07:59 +0000 (10:07 -0500)]
text-backend: Change resources to wl_resource pointers

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoinput_panel_surface: Change resource to a wl_resource pointer
Jason Ekstrand [Fri, 14 Jun 2013 15:07:58 +0000 (10:07 -0500)]
input_panel_surface: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agocallback: Change resource to a wl_resource pointer
Jason Ekstrand [Fri, 14 Jun 2013 15:07:57 +0000 (10:07 -0500)]
callback: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoregion: Change resource to a wl_resource pointer
Jason Ekstrand [Fri, 14 Jun 2013 15:07:56 +0000 (10:07 -0500)]
region: Change resource to a wl_resource pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoshell: Convert resources to pointers
Jason Ekstrand [Fri, 14 Jun 2013 15:07:54 +0000 (10:07 -0500)]
shell: Convert resources to pointers

This commit converts shell_surface.resource to a pointers and updates
shell.c to use wl_resource_get accessors for shell_surface, desktop_shell,
screensaver, and workspace_manager related resources.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoUse wl_resource_get_user_data for weston_surface resources
Jason Ekstrand [Fri, 14 Jun 2013 15:07:53 +0000 (10:07 -0500)]
Use wl_resource_get_user_data for weston_surface resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agocompositor-drm: free plane resources using drm function.
Samuel Iglesias Gonsalvez [Thu, 13 Jun 2013 08:03:33 +0000 (10:03 +0200)]
compositor-drm: free plane resources using drm function.

Free plane resources using drmModeFreePlaneResources()

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
11 years agoxwayland: Forward global position to X
Tiago Vignatti [Wed, 12 Jun 2013 18:43:21 +0000 (15:43 -0300)]
xwayland: Forward global position to X

xeyes works as expected now. subwindows are popped also as expected. This
patch should fix the following:

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

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoxwm: Check result of xcb_get_atom_name_reply
MoD [Wed, 12 Jun 2013 00:59:42 +0000 (19:59 -0500)]
xwm: Check result of xcb_get_atom_name_reply

When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.

11 years agoxwm: Define SEND_EVENT_MASK and EVENT_TYPE macros to clarify xcb event type checks
MoD [Wed, 12 Jun 2013 00:58:55 +0000 (19:58 -0500)]
xwm: Define SEND_EVENT_MASK and EVENT_TYPE macros to clarify xcb event type checks

11 years agoChange weston_surface.resource to a wl_resource pointer.
Jason Ekstrand [Fri, 7 Jun 2013 03:34:41 +0000 (22:34 -0500)]
Change weston_surface.resource to a wl_resource pointer.

This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series.  I am sending this one out ahead of the rest for review.

Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully.  Could someone please test with XWayland and let
me know if this causes problems?

Because a surface may be created from XWayland, the resource may not always
exist.  Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.

11 years agotext: Fix misleading error message
Eduardo Lima (Etrunko) [Fri, 10 May 2013 20:50:36 +0000 (17:50 -0300)]
text: Fix misleading error message

This should be "input_method" and not "desktop_shell"

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
11 years agoAvoid unnecessarily re-allocating texture buffer when the size hasn't changed.
Sinclair Yeh [Thu, 6 Jun 2013 23:41:30 +0000 (16:41 -0700)]
Avoid unnecessarily re-allocating texture buffer when the size hasn't changed.

v4:
Incorporated krh and anderco's comments.  Now adding newly allocated
buffer's dimensions to texture_damage

v3:
* Removed unnecessary parentheses
* Added check for switching from EGL image to SHM buffer
* Moved shader assignment out of IF condition

v2:
Fixed the wrong comparison

v1:
Depending on specific DRI driver implementation, glTexImage2D() with data
set to NULL may or may not re-allocate the texture buffer each time it is
called.  Unintended consequences happen if later glTexSubImage2D() is called
to only update a sub-region of the texture buffer.

I've explored moving glTexImage2D() from gl_renderer_attach() and simply
mark the texture dirty, but the current implemention seems cleaner because
I won't have to worry about calling ensure_textures() and re-assigning
gs->shader unnecessarily.

12 years agoshared: build fix for config-parser test
Pekka Paalanen [Wed, 5 Jun 2013 13:25:11 +0000 (16:25 +0300)]
shared: build fix for config-parser test

One more wayland-util.h not found issue, triggered by having libwayland
installed to a custom prefix.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
11 years agoconfigure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
Daniel Stone [Wed, 22 May 2013 15:03:19 +0000 (18:03 +0300)]
configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS

AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
[pq: rebased and converted more files]

11 years agoudev-seat: Use udev rules to support multiple seats
Rob Bradford [Fri, 31 May 2013 17:09:59 +0000 (18:09 +0100)]
udev-seat: Use udev rules to support multiple seats

By labelling devices with ENV{WL_SEAT} in udev rules the devices will be
pulled into multiple weston seats.

As a result you can get multiple independent seats under the DRM and
fbdev backends.

11 years agoudev-seat: Separate the seat out to its own structure
Rob Bradford [Fri, 31 May 2013 17:09:58 +0000 (18:09 +0100)]
udev-seat: Separate the seat out to its own structure

Thie will allow us to instantiate multiple seats.

11 years agocompositor-fbdev: Rename seat variable to seat_id to clarify purpose
Rob Bradford [Fri, 31 May 2013 17:09:57 +0000 (18:09 +0100)]
compositor-fbdev: Rename seat variable to seat_id to clarify purpose

11 years agocompositor-fbdev: Remove unused fbdev_seat code
Rob Bradford [Fri, 31 May 2013 17:09:56 +0000 (18:09 +0100)]
compositor-fbdev: Remove unused fbdev_seat code

The fbdev compositor uses the commons seat handling code with the drm
compositor.

11 years agoudev-seat: Make the udev_input structure an embedded structure
Rob Bradford [Fri, 31 May 2013 17:09:55 +0000 (18:09 +0100)]
udev-seat: Make the udev_input structure an embedded structure

And as a result of this stop iterating through the compositor seat list
(of one item) and instead access the udev_input structure directly.

This enables a refactoring to pull out the weston_seat into a separate
structure permitting multiple seats.

11 years agoudev-seat: Rename udev_seat to udev_input
Rob Bradford [Fri, 31 May 2013 17:09:54 +0000 (18:09 +0100)]
udev-seat: Rename udev_seat to udev_input

This is a pure rename of the structure, functions and local variables in
preparation of the separation of the seat from the other udev input
handling.

11 years agocompositor-drm: Rename seat variable to seat_id to clarify it's purpose
Rob Bradford [Fri, 31 May 2013 17:09:53 +0000 (18:09 +0100)]
compositor-drm: Rename seat variable to seat_id to clarify it's purpose

This change is a straight refactor that has no functional change.

11 years agoweston-info: Report the seat name provided by the compositor
Rob Bradford [Fri, 31 May 2013 17:09:52 +0000 (18:09 +0100)]
weston-info: Report the seat name provided by the compositor

11 years agoinput: Send the seat name if the client advertises verson 2 of wl_seat
Rob Bradford [Fri, 31 May 2013 17:09:51 +0000 (18:09 +0100)]
input: Send the seat name if the client advertises verson 2 of wl_seat

11 years agoinput: Add a seat name parameter to weston_seat_init
Rob Bradford [Fri, 31 May 2013 17:09:50 +0000 (18:09 +0100)]
input: Add a seat name parameter to weston_seat_init

11 years agocompositor-drm: Force DPMS state to ON after drmModeSetCrtc()
Ander Conselvan de Oliveira [Tue, 4 Jun 2013 13:24:05 +0000 (16:24 +0300)]
compositor-drm: Force DPMS state to ON after drmModeSetCrtc()

The kernel is supposed to set this when drmModeSetCrtc() is called but
at least the i915 driver wouldn't do that in all cases. A fix for this
should be released with kernel 3.10, but we work around the issue in
older kernels by always forcing DPMS to ON when doing a mode set.

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

11 years agocompositor-drm: Cache the DPMS property on drm_output
Ander Conselvan de Oliveira [Tue, 4 Jun 2013 13:24:04 +0000 (16:24 +0300)]
compositor-drm: Cache the DPMS property on drm_output

This avoids one drmModeGetConnector() call every time the DPMS mode is
set. That call can take hundreds of milliseconds due to DDC.

11 years agoclients/nested: Fix compilation
Armin K [Tue, 4 Jun 2013 11:05:22 +0000 (13:05 +0200)]
clients/nested: Fix compilation

11 years agoadd fullscreen to .gitignore
U. Artie Eoff [Tue, 4 Jun 2013 17:10:56 +0000 (10:10 -0700)]
add fullscreen to .gitignore

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agoshared: fix build of libshared-cairo
Pekka Paalanen [Tue, 4 Jun 2013 15:47:39 +0000 (18:47 +0300)]
shared: fix build of libshared-cairo

Another case of missing wayland-util.h, as we didn't pass any libwayland
CFLAGS. This is triggerable on a system, where libwayland is installed
in a custom prefix, and pixman, cairo, libpng, and webp are either
not installed or are installed in the standard path.

COMPOSITOR_CFLAGS contains more than just the libwayland CFLAGS, though.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
11 years agobuild: Add declaration checks to check for required syscall flags
Rob Bradford [Tue, 4 Jun 2013 12:23:01 +0000 (13:23 +0100)]
build: Add declaration checks to check for required syscall flags

The required flags are relatively new and some older enterprise
distributions do not feature them.

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

11 years agoclients: Nested compositor example
Kristian Høgsberg [Fri, 12 Apr 2013 01:47:41 +0000 (21:47 -0400)]
clients: Nested compositor example

A wayland compositor doesn't provide a mechanism for buffer sharing between
clients.  Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations.  Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.

This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension.  The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.

In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c.  As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor.  The nested compositor doesn't even create a
listening socket.

The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.

11 years agoeditor: Do not commit/preedit after invalid delete
Jan Arne Petersen [Thu, 30 May 2013 11:57:05 +0000 (13:57 +0200)]
editor: Do not commit/preedit after invalid delete

Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Improve checks on delete add asserts
Jan Arne Petersen [Thu, 30 May 2013 11:57:04 +0000 (13:57 +0200)]
editor: Improve checks on delete add asserts

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Properly adjust cursor on delete
Jan Arne Petersen [Thu, 30 May 2013 11:57:03 +0000 (13:57 +0200)]
editor: Properly adjust cursor on delete

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Support deleting text in preedit_string
Jan Arne Petersen [Thu, 30 May 2013 11:57:02 +0000 (13:57 +0200)]
editor: Support deleting text in preedit_string

Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Fix text selection
Jan Arne Petersen [Thu, 30 May 2013 11:57:01 +0000 (13:57 +0200)]
editor: Fix text selection

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoDon't fail if colord or libunwind are not present
Armin K [Thu, 30 May 2013 13:16:40 +0000 (15:16 +0200)]
Don't fail if colord or libunwind are not present

This patch adds auto detection for presence of
the colord and libunwind packages.

11 years agoweston.pc: Added libexecdir and pkglibexecdir variables
Eduardo Lima (Etrunko) [Mon, 3 Jun 2013 15:24:09 +0000 (12:24 -0300)]
weston.pc: Added libexecdir and pkglibexecdir variables

These can be used by external clients to check the installation path

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
11 years agoudev-seat: Fail input setup only if no devices are found
Rob Bradford [Mon, 3 Jun 2013 17:46:13 +0000 (18:46 +0100)]
udev-seat: Fail input setup only if no devices are found

Rather than failing if we cannot open any single device fail the input
setup if there are no input devices added.

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

11 years agoHandle mouse wheel
Hardening [Mon, 3 Jun 2013 20:55:47 +0000 (22:55 +0200)]
Handle mouse wheel

The RDP compositor was ignoring mouse wheel events, this patch adds
support for it.

11 years agouse _exit instead of exit if client fails to exec
U. Artie Eoff [Mon, 3 Jun 2013 23:22:31 +0000 (16:22 -0700)]
use _exit instead of exit if client fails to exec

exit() calls atexit() handlers and C++ destructors (e.g. a C++
weston module) which could destroy state that the main process
depends on (e.g. ioctl's, tmpfiles, sockets, etc...).  If an exec
fails, call _exit() instead of exit().

v2: prefer _exit over _Exit

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agoscreenshooter: Scale damage by output scale in screen recorder
Alexander Larsson [Wed, 29 May 2013 10:01:34 +0000 (12:01 +0200)]
screenshooter: Scale damage by output scale in screen recorder

The damage region is in compositor coords, we need to scale it by
the output scale when using the damage to read output buffer data.

11 years agopixman-renderer: Fix read_pixels for screen recorder
Alexander Larsson [Wed, 29 May 2013 10:01:33 +0000 (12:01 +0200)]
pixman-renderer: Fix read_pixels for screen recorder

The old code had an off-by-one error on the y coordinate
where it says height - (cur_y - y). And it does the vflipping of
the *destination* buffer, whereas what is really needed is to
vflip the whole source buffer. This only affects when you read
out part of the image, such as when using the screen recoder.

Also, instead of doing the flipping manually we just let pixman
handle it.

11 years agoscreenshoter: Make recorder handle PIXMAN_x8r8g8b8
Alexander Larsson [Wed, 29 May 2013 10:01:32 +0000 (12:01 +0200)]
screenshoter: Make recorder handle PIXMAN_x8r8g8b8

This is what the pixman renderer reports for the read format.

11 years agoshell: Position DRIVER fullscreen surfaces at origin
Alexander Larsson [Tue, 28 May 2013 14:23:32 +0000 (16:23 +0200)]
shell: Position DRIVER fullscreen surfaces at origin

When a window is fullscreened with DRIVER method and we succeeded
in changing mode we need to actually move the surface to the
origin of the output, or it won't be used for scanout.

11 years agoshell: Center window in fullscreen if needed
Alexander Larsson [Tue, 28 May 2013 14:23:40 +0000 (16:23 +0200)]
shell: Center window in fullscreen if needed

If modeset fails With DRIVER method, and always with FILL method
we want to center the window.

11 years agoshell: Always go to original mode when focused window not fullscreen
Alexander Larsson [Tue, 28 May 2013 14:23:39 +0000 (16:23 +0200)]
shell: Always go to original mode when focused window not fullscreen

Right now we only switch mode on activating a fullscreened window.
This has several problems:

* Once you're in fullscreen its hard to switch to a non-fullscreened
  window with alt-tab as you stay in the small resolution.
* If you switch from a fullscreened window to a non-fullscreened
  window and the fullscreened window is destroyed we will not
  restore the original mode (since the window is not
  shell_surface_is_top_fullscreen()
* Its hard to reach a different output on the right with the mouse
  when the mode is smaller that the original, as there is a "gap"
  between the two outputs. So, if you alt-tab to another window
  you can not always reach it.

This is somewhat of a sledge hammer, as it means you can't e.g.
focus a non-fullscreen on one output and have a window fullscreened
on another output. However, trying to restore only the outputs
the new window is on is problematic:

* It may later change output
* We want to see all windows anyway during alt-tab
* Can't reach the other windows with the mouse anyway

So, this seems like an ok solution.