profile/ivi/weston-ivi-shell.git
10 years agoweston-launch: Only drop privileges if running as root
Tomeu Vizoso [Tue, 1 Oct 2013 10:20:29 +0000 (12:20 +0200)]
weston-launch: Only drop privileges if running as root

10 years agocompositor: fix typo in error message
Aaron Faanes [Tue, 1 Oct 2013 03:06:39 +0000 (22:06 -0500)]
compositor: fix typo in error message

10 years agolauncher-util: pull in drm only for compositor-drm
Adrian Negreanu [Fri, 27 Sep 2013 17:58:45 +0000 (20:58 +0300)]
launcher-util: pull in drm only for compositor-drm

Add drm_set_master and drm_drop_master
as wrappers for drm(Set|Drop)Master, when building compositor-drm
or as empty functions otherwise.

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
10 years agoResize the shell when the mode is switched
Hardening [Mon, 23 Sep 2013 22:45:53 +0000 (00:45 +0200)]
Resize the shell when the mode is switched

Resize the panel and the background when we're notified of a mode
switch.

10 years agoconfig: Don't crash if we don't have a config file
Alexandru DAMIAN [Thu, 26 Sep 2013 09:27:16 +0000 (10:27 +0100)]
config: Don't crash if we don't have a config file

Adding a check in weston_config_full_path so that
we don't crash if we started without a config file.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
10 years agocompositor-fbdev: drop dependency on libdrm
Adrian Negreanu [Thu, 26 Sep 2013 16:31:32 +0000 (19:31 +0300)]
compositor-fbdev: drop dependency on libdrm

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
10 years agocompositor: check if seteuid worked
Alexandru DAMIAN [Wed, 25 Sep 2013 13:47:47 +0000 (14:47 +0100)]
compositor: check if seteuid worked

Checking the return value from seteuid in
order to not launch clients with the wrong effective uid.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
10 years agocompositor-drm: Match the EGLConfig native visual ID if it has one
Kristian Høgsberg [Wed, 25 Sep 2013 22:46:42 +0000 (15:46 -0700)]
compositor-drm: Match the EGLConfig native visual ID if it has one

We'll add the GBM format code as the native visual ID for EGLConfigs
when running on GBM.  This patch lets the drm backend pass in the
format code it's using with KMS and make sure we get a confing that
matches.  In the future, mesa will add support for 10 bpc configs
which will match the "at least 8 color bits" requirement.  By also
matching the native visual ID, we avoid rendering XRGB2101010 into a
XRGB8888 KMS framebuffer.

10 years agoevdev: Process touch up events of single-touch devices
Neil Roberts [Tue, 24 Sep 2013 19:05:07 +0000 (20:05 +0100)]
evdev: Process touch up events of single-touch devices

Previously only the touch up key event was used for single-touch
devices and the touch down event was generated on the first motion
event. This was breaking if the touch up and down events were sent
without a motion in-between because the evdev driver wouldn't generate
a touch down event and Weston would lose track of the number of touch
points that are down. This patch changes it to track the up and down
key events as pending events similar to how it does for multi-touch
devices.

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

10 years agoevdev: Only track one pending event
Neil Roberts [Tue, 24 Sep 2013 11:09:03 +0000 (12:09 +0100)]
evdev: Only track one pending event

Instead of having a mask of pending events there is now an enum with a
single value to represent the one pending event. The event gets
flushed explicitly as part of the handling code for each event type
rather than in the outer event reading loop. The pending event is used
so that we can combine multiple motion events into one and to make
sure that we have recieved the latest position before sending a touch
up or down event. This should fix the following problems with the old
approach:

• If you release a finger and press it down again quickly you could
  get the up and down events in the same batch. However the pending
  events were always processed in the order down then up so it would
  end up notifying two down events and then an up. The pending event
  is now always flushed when there is a new up or down event so they
  will always be in the right order.

• When it got a slot event it would immediately change the slot number
  and then set the pending event. Then when it flushed the events it
  would use the new slot number to flush the old pending event so the
  events could have the wrong finger. The pending event is now
  immediately flushed when a slot event is received so it will have
  the right finger.

• If you get more than 32 events in one read then it was resetting the
  pending events before processing the next batch in
  evdev_process_events. If four fingers were pressed down at once then
  it ended up with more than 32 events and the sync message would be
  in the second batch. The pending flag for the last finger was
  getting cleared so it never got emitted. In this patch the pending
  event is no longer reset after reading nor is it explicitly flushed.
  Instead it is flushed when we receive a EV_SYN event or a different
  pending event needs to replace it.

The touchpad handling code was trying to use the pending event
mechanism to notify the relative motion events. I'm not sure why it
was doing this because it looks the event would effectively get
emitted as soon as the touchpad_process function is finished anyway
and it wasn't accumulating the values. Instead I've just changed it to
emit the event directly.

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

10 years agoversion.h: Add version check macro
Pier Luigi Fiorini [Mon, 23 Sep 2013 05:26:03 +0000 (07:26 +0200)]
version.h: Add version check macro

Make it easier to check for a Weston version.

10 years agoclients: Include and link against math lib for new multi-resource
Stefan Schmidt [Mon, 23 Sep 2013 10:25:29 +0000 (11:25 +0100)]
clients: Include and link against math lib for new multi-resource

Linking failed with missing ceil() here. Making sure that we include
the header and add the missing -lm.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
10 years agoinput: check that the new focus surface has a valid resource
Giulio Camuffo [Mon, 23 Sep 2013 10:33:39 +0000 (12:33 +0200)]
input: check that the new focus surface has a valid resource

Here too we must make sure the surface has a valid resource, as
there are some (xwayland, surfaces created by the shell) that
don't have it.
Fix a Weston crash when setting a mpv window fullscreen on drm.

10 years agoUpdate .gitignore
Emilio Pozuelo Monfort [Mon, 23 Sep 2013 10:49:02 +0000 (12:49 +0200)]
Update .gitignore

10 years agoweston.ini: update path for the flower client
Emilio Pozuelo Monfort [Mon, 23 Sep 2013 10:49:01 +0000 (12:49 +0200)]
weston.ini: update path for the flower client

10 years agoconfigure.ac: Update version to 1.2.91
Kristian Høgsberg [Sun, 22 Sep 2013 21:16:11 +0000 (14:16 -0700)]
configure.ac: Update version to 1.2.91

10 years agoAdd vaapi-recorder.h to SOURCES to fix distcheck
Kristian Høgsberg [Sun, 22 Sep 2013 21:28:31 +0000 (14:28 -0700)]
Add vaapi-recorder.h to SOURCES to fix distcheck

10 years agoevdev: Flush motion events when the slot changes, not just after sync
Neil Roberts [Fri, 20 Sep 2013 14:03:29 +0000 (15:03 +0100)]
evdev: Flush motion events when the slot changes, not just after sync

If two fingers are released almost simultaneously then evdev can send
the touch up events in one bunch without sending a sync event
in-between. However, the evdev_device struct only keeps track of one
pending touch up event so in this case the second touch up event would
override the first and it would be lost. This patch changes it to also
flush the events whenever the slot changes so that it will flush the
previous touch up event before trying to queue the next one.

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

10 years agocompositor: when unmapping a surface remove it from the compositor's list
Giulio Camuffo [Sat, 21 Sep 2013 16:08:28 +0000 (18:08 +0200)]
compositor: when unmapping a surface remove it from the compositor's list

compositor.surface_list is recreated every redraw with the mapped
surfaces, but if a surface gets unmapped and then in the same frame
weston_compositor_pick_surface() is called we must make sure it
does not pick the unmapped surface, since it traverses the
surface_list to find one.
If after the unmap the surface gets also deleted it's even more
important, as it must not pick a destroyed surface.

10 years agocompositor: Log the full path of the config file we're using
Kristian Høgsberg [Sun, 22 Sep 2013 06:17:35 +0000 (23:17 -0700)]
compositor: Log the full path of the config file we're using

10 years agoconfig-parser: Make weston_config_parse() tkae a file name
Kristian Høgsberg [Sun, 22 Sep 2013 06:02:31 +0000 (23:02 -0700)]
config-parser: Make weston_config_parse() tkae a file name

Take a basename of the config file to parse instead of an fd.

10 years agoshared: Remove no longer used parse_config_file()
Kristian Høgsberg [Sun, 22 Sep 2013 05:36:50 +0000 (22:36 -0700)]
shared: Remove no longer used parse_config_file()

10 years agotablet-shell: Use new weston_config instead of old config parse
Kristian Høgsberg [Sun, 22 Sep 2013 05:35:13 +0000 (22:35 -0700)]
tablet-shell: Use new weston_config instead of old config parse

10 years agowindow.c: Port to use weston_config instead of old parser
Kristian Høgsberg [Sun, 22 Sep 2013 05:26:10 +0000 (22:26 -0700)]
window.c: Port to use weston_config instead of old parser

10 years agoterminal: Port to new weston_config parse
Kristian Høgsberg [Sun, 22 Sep 2013 05:23:08 +0000 (22:23 -0700)]
terminal: Port to new weston_config parse

10 years agocompositor: Unlink unmapped surface instead of rebuilding surface list
Kristian Høgsberg [Sun, 22 Sep 2013 04:26:05 +0000 (21:26 -0700)]
compositor: Unlink unmapped surface instead of rebuilding surface list

When unmap and destroy a surface we need to make sure we don't pick it
before we rebuild the new surface list.  Currently we ensure this
by rebuilding the surface list when destroying a surface, but just
removing the surface should be enough.

10 years agoxwm: remove the destroy listener from the old surface signal
Giulio Camuffo [Fri, 20 Sep 2013 14:16:06 +0000 (16:16 +0200)]
xwm: remove the destroy listener from the old surface signal

10 years agoAdd a test client to test multiple pointer/keyboard resources
Neil Roberts [Thu, 19 Sep 2013 16:32:01 +0000 (17:32 +0100)]
Add a test client to test multiple pointer/keyboard resources

This adds a hacked version of simple-shm which can create multiple
pointer and keyboard resources. The resources are created with the
command line options -p and -k. Both take an integer argument which
specifies the time in seconds after the program is started when the
resource should be created. It can also take a second time with a
colon separator to specify when the resource should be released.

For example:

 weston-multi-resource -p5 -p7 -k9 -p12:14

That would create a pointer after 5 seconds, a second pointer 2
seconds later, a keyboard 2 seconds after that, a third pointer after
a further 3 seconds and finally after 2 more seconds it would release
that final pointer resource.

This can be used along with WAYLAND_DEBUG to check that it gets the
right events for example if the pointer is created while the client's
surface already has focus and so on.

10 years agoinput: Emit events on all resources for a client
Neil Roberts [Thu, 19 Sep 2013 16:32:00 +0000 (17:32 +0100)]
input: Emit events on all resources for a client

The Wayland protocol permits a client to request the pointer, keyboard
and touch multiple times from the seat global. This is very useful in a
component like Clutter-GTK where we are combining two libraries that use
Wayland together.

This change migrates the weston input handling code to emit the
events for all the resources for the client by using the newly added
wl_resource_for_each macro to iterate over the resources that are
associated with the focused surface's client.

We maintain a list of focused resources on the pointer and keyboard
which is updated when the focus changes. However since we can have
resources created after the focus has already been set we must add the
resources to the right list and also update any state.

Additionally when setting the pointer focus it will now send the
keyboard modifiers regardless of whether the focused client has a
pointer resource. This is important because otherwise if the client
gets the pointer later than you getting the keyboard then the
modifiers might not be up-to-date.

Co-author: Neil Roberts <neil@linux.intel.com>

10 years agoNotify clients on mode_switch()
Hardening [Wed, 18 Sep 2013 21:56:36 +0000 (23:56 +0200)]
Notify clients on mode_switch()

This patch implements the notification of clients during mode_switch.
As discussed on IRC, clients are notified of mode_switch only when the
"native" mode is changed and activated. That means that if the native
mode is changed and the compositor had activated a temporary mode for
a fullscreen surface, the clients will be notified only when the native
mode is restored.
The scaling factor is treated the same way as modes.

10 years agoRename current, origin, scale, origin_scale
Hardening [Wed, 18 Sep 2013 21:56:35 +0000 (23:56 +0200)]
Rename current, origin, scale, origin_scale

This patch renames that fields to have consistent names.

10 years agoxwm: set the right cursor when hovering on the decoration borders
Giulio Camuffo [Wed, 18 Sep 2013 13:20:04 +0000 (15:20 +0200)]
xwm: set the right cursor when hovering on the decoration borders

use the alternative cursor names used also in window.c, since the
names it used previously are not guaranteed to exist in all themes.

10 years agoxwm: set the window's shsurf pointer to NULL on unmap handling
Giulio Camuffo [Tue, 17 Sep 2013 14:43:45 +0000 (16:43 +0200)]
xwm: set the window's shsurf pointer to NULL on unmap handling

the unmap event will be followed by the deletion of the weston_surface,
so the shell_surface will also be deleted by the shell. Having removed
the surface_destroy_listener, the surface_destroy callback doesn't
get called, so reset the value of shsurf here.

10 years agoRestoring alpha after the shell effects.
Axel Davy [Tue, 17 Sep 2013 12:55:55 +0000 (14:55 +0200)]
Restoring alpha after the shell effects.

After the fade or zoom effects, alpha could not have been 1.0, preventing
not redrawing behind opaque windows.

This patch add a reset function in weston_surface_animation to reset
some variables the effects affect.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
10 years agoinput: Fix trailing whitspaces and indent.
Stefan Schmidt [Tue, 17 Sep 2013 09:54:09 +0000 (10:54 +0100)]
input: Fix trailing whitspaces and indent.

Just some cosmetics to conform to the wayland coding style.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
10 years agolauncher: Move rest of tty object into struct weston_launcher
Kristian Høgsberg [Thu, 19 Sep 2013 06:00:17 +0000 (23:00 -0700)]
launcher: Move rest of tty object into struct weston_launcher

The struct weston_launcher object will now either handle tty and vt switching
details in-process (when running weston directly as root) or talk to
the weston-launch process.

10 years agoweston-launch: Use fstat to make sure we stat the right fd
Kristian Høgsberg [Thu, 19 Sep 2013 05:14:09 +0000 (22:14 -0700)]
weston-launch: Use fstat to make sure we stat the right fd

Instead of the racy stat+open, open first and then use fstat.  We want to
make sure we're stating the fd we'll be sending to weston and nothing else.

10 years agolauncher: Handle tty setup and teardown in launcher
Kristian Høgsberg [Wed, 18 Sep 2013 05:43:22 +0000 (22:43 -0700)]
launcher: Handle tty setup and teardown in launcher

10 years agolauncher: Handle drm set/drop master and vt switch signals in launcher
Kristian Høgsberg [Wed, 18 Sep 2013 05:15:37 +0000 (22:15 -0700)]
launcher: Handle drm set/drop master and vt switch signals in launcher

10 years agocompositor: Generalize VT switching as a session_signal
Kristian Høgsberg [Tue, 17 Sep 2013 23:02:57 +0000 (16:02 -0700)]
compositor: Generalize VT switching as a session_signal

Instead of a callback from the tty module, we now have a compositor level
signal that fires when our session is activated or deactivated.

10 years agolauncher: Collect launcher state in new struct weston_launcher
Kristian Høgsberg [Tue, 17 Sep 2013 21:41:03 +0000 (14:41 -0700)]
launcher: Collect launcher state in new struct weston_launcher

We're going to add a bit more launcher state, so start out by creating
a new struct weston_launcher we can track it in.

10 years agoweston-launch: Use SOCK_SEQPACKET for the launcher socket
Kristian Høgsberg [Wed, 18 Sep 2013 18:01:48 +0000 (11:01 -0700)]
weston-launch: Use SOCK_SEQPACKET for the launcher socket

This lets us detect hang-up when weston-launch dies and clean up properly.

10 years agoweston-launch: Pass the right CLOEXEC flag to fcntl
Kristian Høgsberg [Wed, 18 Sep 2013 18:00:56 +0000 (11:00 -0700)]
weston-launch: Pass the right CLOEXEC flag to fcntl

Passing O_CLOEXEC to fcntl is wrong, we need to pass FD_CLOEXEC.

10 years agocompositor: Open drm device through launcher
Kristian Høgsberg [Tue, 17 Sep 2013 21:03:42 +0000 (14:03 -0700)]
compositor: Open drm device through launcher

10 years agoAdded tests for the vertex clipping code.
Sam Spilsbury [Fri, 13 Sep 2013 02:01:22 +0000 (10:01 +0800)]
Added tests for the vertex clipping code.

This tests (via the table-driven testing method) that the correct
number of vertices and also the correct vertices themselves
are generated for an clip box and polygon of up to eight vertices.

Also add a libshared-test.la so that we don't have to build weston-test-runner
all the time

10 years agoSplit vertex clipping code out into vertex-clipping.c
Sam Spilsbury [Fri, 13 Sep 2013 02:01:21 +0000 (10:01 +0800)]
Split vertex clipping code out into vertex-clipping.c

10 years agoMinor improvement of weston-terminal resizing
José Bollo [Fri, 13 Sep 2013 09:28:51 +0000 (11:28 +0200)]
Minor improvement of weston-terminal resizing

10 years agoAdd support for table-driven testing.
Sam Spilsbury [Fri, 13 Sep 2013 02:01:20 +0000 (10:01 +0800)]
Add support for table-driven testing.

The new TEST_P macro takes a function name and a "data" argument to
point to an arbitrary array of known size of test data. This allows
multiple tests to be run with different datasets. The array is stored
as a void * but advanced by a known size on each iteration.

The data for each invocation of the test is provided as a "data" argument,
it is the responsibility of the test to cast it to something sensible.

Also fixed single-test running to only run the tests specified

10 years agoRemove AM_LDFLAGS usage
Sam Spilsbury [Fri, 13 Sep 2013 02:01:19 +0000 (10:01 +0800)]
Remove AM_LDFLAGS usage

We are not building everything here as a module, only the test modules.

10 years agoclients: remove superfluous call
Peter Hutterer [Fri, 13 Sep 2013 01:59:00 +0000 (11:59 +1000)]
clients: remove superfluous call

10 years agoclients: de-duplicate demo clients list
Peter Hutterer [Fri, 13 Sep 2013 01:58:59 +0000 (11:58 +1000)]
clients: de-duplicate demo clients list

10 years agoxwm: set the shell_surface's title
Giulio Camuffo [Wed, 11 Sep 2013 16:20:47 +0000 (18:20 +0200)]
xwm: set the shell_surface's title

add a new function pointer to the weston_shell_interface struct that
shells will set accordingly.

10 years agoxwm: place transient windows at the right position
Giulio Camuffo [Wed, 11 Sep 2013 15:49:13 +0000 (17:49 +0200)]
xwm: place transient windows at the right position

10 years agotests: list available tests if an invalid test name is given
Peter Hutterer [Wed, 11 Sep 2013 06:08:47 +0000 (16:08 +1000)]
tests: list available tests if an invalid test name is given

10 years agotests: support -h/--help for the tests
Peter Hutterer [Wed, 11 Sep 2013 06:08:30 +0000 (16:08 +1000)]
tests: support -h/--help for the tests

Including listing the tests available in that binary

10 years agotests: include config.h in weston-test-runner
Peter Hutterer [Wed, 11 Sep 2013 06:08:04 +0000 (16:08 +1000)]
tests: include config.h in weston-test-runner

10 years agotests: use variable for test name in weston-tests-env
Peter Hutterer [Wed, 11 Sep 2013 05:58:08 +0000 (15:58 +1000)]
tests: use variable for test name in weston-tests-env

Slightly more readable and makes it easier to switch to use $2 for something
in the future (if that's ever needed).

10 years agotests: always build tests
Peter Hutterer [Wed, 11 Sep 2013 05:58:07 +0000 (15:58 +1000)]
tests: always build tests

check_PROGRAMS and friends are only built during make check. Which is a
great way of introducing compiler errors in tests. Always build them, TESTS
defines what's being run during make check.

10 years agoshell: Use wl_resource_for_each() for sending out workspace status
Kristian Høgsberg [Wed, 11 Sep 2013 19:00:47 +0000 (12:00 -0700)]
shell: Use wl_resource_for_each() for sending out workspace status

10 years agoinput: Use new wl_resource_for_each for sending updated seat caps
Rob Bradford [Fri, 6 Sep 2013 16:48:19 +0000 (17:48 +0100)]
input: Use new wl_resource_for_each for sending updated seat caps

10 years agovaapi-recorder: Don't leak drm fd
Ander Conselvan de Oliveira [Fri, 6 Sep 2013 14:49:38 +0000 (17:49 +0300)]
vaapi-recorder: Don't leak drm fd

Make vaapi_recorder take onwership of the fd and close it at destroy
time.

10 years agovaapi-recorder: Encode frames in a separate thread
Ander Conselvan de Oliveira [Fri, 6 Sep 2013 14:49:37 +0000 (17:49 +0300)]
vaapi-recorder: Encode frames in a separate thread

Previously, vaapi_recorder_frame() would wait until the encoded
contents for a frame is written to the output file descriptor. This
delayed the repainting of the next frame, and affected frame rate
when capturing with high resolutions. Instead, wait only if there is
and attempted to encode two frames at the same time.

Increases framerate from 30 to 60 fps when capturing at 1920x1200 on
my SandryBridge system, although there are periodic slowdowns due to
disk writes.

10 years agoadd libhybris support
Adrian Negreanu [Fri, 6 Sep 2013 12:16:09 +0000 (15:16 +0300)]
add libhybris support

it uses the Android fbdev HAL[1] (through libhybris[2])
and the libhybris implementation of wayland-egl.

Configure flags:
 cairo:
   --enable-glesv2=yes  --enable-egl=yes
 weston:
   --with-cairo-glesv2 --enable-fbdev-compositor
 hybris:
   --enable-wayland --enable-arch=x86
   --with-android-headers=<android-headers> --enable-alinker=jb

The android headers are extracted from an AOSP tree,
using hybris/utils/extract-headers.sh

[1]:
https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/fb.h

[2]: https://github.com/libhybris/libhybris

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
10 years agoterminal: Stop complaining about OSC escape code 7
Kristian Høgsberg [Wed, 11 Sep 2013 18:52:56 +0000 (11:52 -0700)]
terminal: Stop complaining about OSC escape code 7

This is the current working directory of the shell as an URI.  We
don't use that for anythign at the moment, but let's not complain
about it at least.

10 years agocompositor-x11: Copying xkb_info when creating a seat causes problems
Andrew Wedgbury [Fri, 6 Sep 2013 08:29:12 +0000 (08:29 +0000)]
compositor-x11: Copying xkb_info when creating a seat causes problems

Sorry, I missed updating use of xkb_info in compositor-x11.c.
I've updated the patch.

10 years agofbdev: Support of TrueColor and Directcolor of video hardware
Marc Chalain [Tue, 3 Sep 2013 14:47:43 +0000 (16:47 +0200)]
fbdev: Support of TrueColor and Directcolor of video hardware

backend check the type of the framebuffer and accept DirectColor and TrueColor
I use a "switch case" to implement other cases in the future.

10 years agogl_renderer: Use EGL_WAYLAND_Y_INVERTED_WL to query wl_buffer's orientation
Stanislav Vorobiov [Thu, 29 Aug 2013 07:36:44 +0000 (11:36 +0400)]
gl_renderer: Use EGL_WAYLAND_Y_INVERTED_WL to query wl_buffer's orientation

10 years agoCopying xkb_info when creating a seat causes problems
Andrew Wedgbury [Thu, 5 Sep 2013 13:31:40 +0000 (13:31 +0000)]
Copying xkb_info when creating a seat causes problems

Hi Kristian,

Here's a new patch for ref counting weston_xkb_info, as suggested.
So a seat created with a NULL keymap will now point to the global xkb_info.

10 years agoinput: Initialize data source to NULL
Kristian Høgsberg [Wed, 11 Sep 2013 16:45:03 +0000 (09:45 -0700)]
input: Initialize data source to NULL

This way we do the right thing, when we get a NULL wl_resource for self-dnd.

10 years agocompositor: Return 0 on success
Kristian Høgsberg [Wed, 11 Sep 2013 16:42:26 +0000 (09:42 -0700)]
compositor: Return 0 on success

Add missing return statement.

10 years agodnd: Support dropping as text/plain;charset=utf-8
Kristian Høgsberg [Mon, 9 Sep 2013 22:03:27 +0000 (15:03 -0700)]
dnd: Support dropping as text/plain;charset=utf-8

10 years agoxwm: Fix fd leak in weston_wm_send_data()
Kristian Høgsberg [Thu, 5 Sep 2013 05:32:50 +0000 (22:32 -0700)]
xwm: Fix fd leak in weston_wm_send_data()

The call to source->send(source, mime_type, p[1]); dups the fd, and we have
to close p[1] to not leak it.

10 years agoxwm: Try a non-blocking write before setting up an fd watch for property data
Kristian Høgsberg [Thu, 5 Sep 2013 05:12:28 +0000 (22:12 -0700)]
xwm: Try a non-blocking write before setting up an fd watch for property data

Typically we can write it immediately without blocking, so save the overhead
of setting up an fd watch and writing the data in a callback.  For the
case where the immediate write doesn't write all data, we fallback and
set up the fd watch as usual.

This patch also consolidates setting up the async write a bit.

10 years agoxwm: Add support for bridging Xdnd to wayaland DnD
Kristian Høgsberg [Thu, 5 Sep 2013 04:12:26 +0000 (21:12 -0700)]
xwm: Add support for bridging Xdnd to wayaland DnD

10 years agoxwm: Only handle selection notify events for CLIPBOARD in selection code
Kristian Høgsberg [Thu, 5 Sep 2013 04:09:24 +0000 (21:09 -0700)]
xwm: Only handle selection notify events for CLIPBOARD in selection code

10 years agoxwm: Fix fd leak in selection code
Kristian Høgsberg [Thu, 5 Sep 2013 03:48:46 +0000 (20:48 -0700)]
xwm: Fix fd leak in selection code

The file descriptors we receive in the wayland protocol callbacks are
already O_CLOEXEC, so don't dup them to set O_CLOEXEC.`

10 years agocompositor: Split dnd setup up into weston_seat_start_drag()
Kristian Høgsberg [Thu, 5 Sep 2013 03:44:26 +0000 (20:44 -0700)]
compositor: Split dnd setup up into weston_seat_start_drag()

This makes the drag-and-drop code available to in-weston data sources,
similar to how we can set a selection data source internally.  The
wl_data_device.start_drag entry point now calls this function after
validating protocol arguments.

10 years agoterminal: Accept utf-8 text drop
Kristian Høgsberg [Thu, 5 Sep 2013 03:41:06 +0000 (20:41 -0700)]
terminal: Accept utf-8 text drop

10 years agodnd: Only accept dnd with the application/x-wayland-dnd-flower mime-type
Kristian Høgsberg [Thu, 5 Sep 2013 02:36:49 +0000 (19:36 -0700)]
dnd: Only accept dnd with the application/x-wayland-dnd-flower mime-type

Currently, the dnd sample client accepts all mime-types and assumes they
are the custom flower mime-type.  Only accept if the offer has the right
mime-type.

10 years agoconfigure.ac: Only enable enable_simple_egl_clients if enable_egl is yes
Kristian Høgsberg [Wed, 4 Sep 2013 05:59:17 +0000 (22:59 -0700)]
configure.ac: Only enable enable_simple_egl_clients if enable_egl is yes

This simplifies a few checks and makes sure we only build the
subsurfaces client if EGL is enabled.

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

10 years agokeyboard: Add rudimentary touch support to keyboard.
Brian J Lovin [Tue, 27 Aug 2013 17:49:42 +0000 (10:49 -0700)]
keyboard: Add rudimentary touch support to keyboard.

At this time there is no way to have a key be activated when
touch_up is called, so all this patch does is activate they
key on touch_down.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
10 years agoconfigure.ac: Only build libva recorder if we found libva
Kristian Høgsberg [Wed, 4 Sep 2013 05:46:02 +0000 (22:46 -0700)]
configure.ac: Only build libva recorder if we found libva

The automatic detection failed to disable the build if it didn't
find libva.

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

10 years agocompositor-drm: Pass the wl_resource to gbm_bo_import()
Kristian Høgsberg [Wed, 4 Sep 2013 05:27:08 +0000 (22:27 -0700)]
compositor-drm: Pass the wl_resource to gbm_bo_import()

Another silent regression from the wl_resource opaquify effort.  This was
causing our pageflip-to-client-buffer and sprites optimizations to
not kick in.

10 years agoxwm: Unmap frame window when client window is unmapped
Kristian Høgsberg [Tue, 3 Sep 2013 23:38:51 +0000 (16:38 -0700)]
xwm: Unmap frame window when client window is unmapped

We used to destroy the frame window and reparent the client window to
wm_window.  That means that we lose the destroy_notify event when the
client window is destroyed later, since we don't select for
substructure_notify on wm_window.

Instead of destroying and reparenting, just unmap the frame window.

10 years agoxwm: Split creation of frame window out into its own function
Kristian Høgsberg [Tue, 3 Sep 2013 23:19:18 +0000 (16:19 -0700)]
xwm: Split creation of frame window out into its own function

10 years agoxwm: Set window->surface to NULL when surface goes away
Kristian Høgsberg [Tue, 3 Sep 2013 23:15:42 +0000 (16:15 -0700)]
xwm: Set window->surface to NULL when surface goes away

Otherwise we may end up trying to remove the destroy listener if we
get the surface_destroy callback before the unmap_notify.

10 years agoxwm: Detect WM_NORMAL_HINTS fullscreen attempts
Kristian Høgsberg [Sat, 31 Aug 2013 07:12:25 +0000 (00:12 -0700)]
xwm: Detect WM_NORMAL_HINTS fullscreen attempts

10 years agoxwm: Detect legacy fullscreen modes
Kristian Høgsberg [Sat, 31 Aug 2013 07:08:27 +0000 (00:08 -0700)]
xwm: Detect legacy fullscreen modes

10 years agoxwm: Update size when override redirect windows change size
Kristian Høgsberg [Sat, 31 Aug 2013 07:00:57 +0000 (00:00 -0700)]
xwm: Update size when override redirect windows change size

10 years agoconfigure: Require wayland-server 1.2.90
Kristian Høgsberg [Fri, 30 Aug 2013 22:00:01 +0000 (15:00 -0700)]
configure: Require wayland-server 1.2.90

Make sure we look for a recent enough version of wayland-server for
the new wl_seat release requests.

10 years agowindow: Use new wl_pointer/keyboard_release request
Rob Bradford [Tue, 13 Aug 2013 19:11:03 +0000 (20:11 +0100)]
window: Use new wl_pointer/keyboard_release request

Since we bump the version we ask for from the compositor it is also
necessary to implement the new "name" event in the seat listener.

10 years agocompositor: Implement release request for input interfaces
Kristian Høgsberg [Tue, 13 Aug 2013 19:11:02 +0000 (20:11 +0100)]
compositor: Implement release request for input interfaces

v2 (Rob Bradford): Update the version numbering for this change

10 years agoconfigure.ac: Auto-enable vaapi recorder, but allow overrides
Kristian Høgsberg [Fri, 30 Aug 2013 21:28:22 +0000 (14:28 -0700)]
configure.ac: Auto-enable vaapi recorder, but allow overrides

If libva is available and recent, we'll enable the vaapi recorder feature,
but it can also be forced on or off by --enable/disable-vaapi-recorder.

10 years agocompositor-drm: Add hardware accelerated capture of screen using libva
Ander Conselvan de Oliveira [Fri, 23 Aug 2013 14:15:48 +0000 (17:15 +0300)]
compositor-drm: Add hardware accelerated capture of screen using libva

This patch adds a feature to the DRM backend that uses libva for
encoding the screen contents in H.264. Screen recording can be
activated by pressing mod-shift-space q. A file named capture.h264
will be created in the current directory, which can be muxed into
an MP4 file with gstreamer using

gst-launch filesrc location=capture.h264 ! h264parse ! mp4mux ! \
           filesink location=file.mp4

This is limitted to the DRM compositor in order to avoid a copy when
submitting the front buffer to libva. The code in vaapi-recorder.c
takes a dma_buf fd referencing it, does a colorspace conversion using
the video post processing pipeline and then uses that as input to the
encoder.

I'm sending this now so I get comments, but this is not ready for
prime time yet. I have a somewhat consistent GPU hang when using
i915 with SandyBridge. Sometimes a page flip never completes. If you
want to try this anyway and your system get stuck, you might need to
run the following:

  # echo 1 > /sys/kernel/debug/dri/0/i915_wedged

After that, alt-sysrq [rv] should work.

Once that's fixed it would also be good to make the parameters used by
the encoder more flexible. For now the QP parameter is hardcoded to 0
and we have only I and P frames (no B frames), which causes the
resulting files to be very large.

10 years agoautotools: Fix AC_PATH_PROG call
Quentin Glidic [Sat, 24 Aug 2013 18:36:10 +0000 (20:36 +0200)]
autotools: Fix AC_PATH_PROG call

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
10 years ago.gitignore: Reflect recent client binary rename
Bryce W. Harrington [Fri, 23 Aug 2013 19:57:04 +0000 (19:57 +0000)]
.gitignore: Reflect recent client binary rename

Commit 77ab1721 renamed the client binaries; this change updates
.gitignore to follow this change.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agowindow.c: Fix SIGSEGV in pointer_handle_motion
Paul Winwood [Thu, 29 Aug 2013 09:52:54 +0000 (10:52 +0100)]
window.c: Fix SIGSEGV in pointer_handle_motion

Move null pointer check and assignments before first window dereference.

10 years agoevdev: Don't parse config file again, use compositor->config
Kristian Høgsberg [Thu, 29 Aug 2013 20:49:35 +0000 (13:49 -0700)]
evdev: Don't parse config file again, use compositor->config

10 years agoshell: Make sure we have seat->pointer and seat->touch before dereferencing
Kristian Høgsberg [Thu, 29 Aug 2013 06:16:20 +0000 (23:16 -0700)]
shell: Make sure we have seat->pointer and seat->touch before dereferencing

Either of these may not be available when we handle wl_shell_surface.move,
and we need to not crash when that's the case.

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

10 years agogl-renderer: Use GL_UNSIGNED_SHORT for index array type
Kristian Høgsberg [Thu, 29 Aug 2013 06:05:29 +0000 (23:05 -0700)]
gl-renderer: Use GL_UNSIGNED_SHORT for index array type

GL_UNSIGNED_INT is only supported when GL_OES_element_index_uint is
available (mesa implements that extension).  We don't need 32-bit
indices, so just use GL_UNSIGNED_SHORT.