Commit Graph

3109 Commits

Author SHA1 Message Date
Kristian Høgsberg
c1ae40222c tests: Rename xwayland_test to xwayland-test
Consitency.
2013-07-04 02:32:04 -04:00
Kristian Høgsberg
00db2ee5ff xwayland: Don't crash when we get configure notify for destroyed frame windows
We can get a destroy notify for the frame window after we've removed it
from the hash table.  This turns into a NULL pointer deref when we look up
the window and try to use it for debugging printout.

Fixes the failing xwayland test case.
2013-07-04 02:31:53 -04:00
Kristian Høgsberg
6780073d78 shell: Always go through end_busy_cursor when ending the busy cursor grab 2013-07-04 01:12:17 -04:00
Kristian Høgsberg
da751b8f9a input: Don't cache pointer grab interface between calls to focus and motion
The focus callback for the current grab can change the grab, so we have
to make sure we call the motion callback for the currently active grab.

https://bugs.freedesktop.org/show_bug.cgi?id=65961
2013-07-04 01:00:16 -04:00
Kristian Høgsberg
c9974a0796 shell: Dont set grab cursor if desktop-shell client died
If we don't have a desktop-shell helper client, don't try to send events
to it.

https://bugs.freedesktop.org/show_bug.cgi?id=65961
2013-07-03 19:26:04 -04:00
Rob Bradford
dfe310512b shell: Allow ending of popup grabs from within the starting of the grab
Calling weston_pointer_start_grab can lead to a code path (in this case
when the shell surface is unresponsive) that can try and remove the
popup grab to setup a shell grab.

Ending the popup grab requires removing the surface from the grab's
surfaces list - however the grab had not yet been fully setup so the
grabbed surface was not yet in this list.

With this change we ensure we add the surface to the list before setting
up the pointer grab.

https://bugs.freedesktop.org/show_bug.cgi?id=66167
2013-07-03 19:06:25 -04:00
Quentin Glidic
6e2c12496b shared: Export configuration functions
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-07-03 18:28:59 -04:00
Kristian Høgsberg
442a5faa84 tests: Fix leftover wl_client_add_versioned_object()
The search and replace missed this one.
2013-07-03 18:13:33 -04:00
Louis-Francis Ratté-Boulianne
9a4f10f6bc 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.
2013-07-03 17:09:03 -04:00
Jason Ekstrand
a85118c1b8 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>
2013-07-03 14:52:06 -04:00
Jason Ekstrand
d27cb096ad 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>
2013-07-03 14:52:06 -04:00
Jason Ekstrand
f568fd5c35 Add a MIN macro
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-07-03 14:52:05 -04:00
MoD
384a11aeac 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.
2013-07-02 18:17:09 -04:00
David Richards
7e5b57e7b8 wcap-decode: Add 444 YUV Planar output
Done in the most simple way possible, for those who like nice things
2013-07-02 18:06:20 -04:00
Daiki Ueno
b08b3296b8 editor: Fix segfault when deleting the first character 2013-07-02 00:02:56 -04:00
Kristian Høgsberg
3bdaa3e249 touchpad: Handle two-finger click as right click for button pads 2013-07-01 12:48:55 -04:00
Rob Bradford
382ff46ffb 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.
2013-06-28 19:56:41 -04:00
Matt Roper
01a9273bd2 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>
2013-06-28 19:55:29 -04:00
Matt Roper
e61561fd9c 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>
2013-06-28 19:54:53 -04:00
Rob Bradford
14494625b5 man: Add documentation for output seat confining
v2: Add some explanation about the default seat
2013-06-28 13:36:17 -04:00
Rob Bradford
66bd9f5baf 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).
2013-06-28 13:36:14 -04:00
Alex Wu
4451aa5d95 xwayland: modify Makefile.am to clean up BUILD_SOURCES 2013-06-28 12:55:19 -04:00
Rob Bradford
806d8c0b78 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.
2013-06-25 16:28:04 -04:00
Rob Bradford
1d697d7adf 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.
2013-06-25 16:27:22 -04:00
Kristian Høgsberg
8f7f483668 tests: Fix direct access to resource->data in weston-test 2013-06-25 16:18:35 -04:00
Kristian Høgsberg
1d7d8f0e95 nested: Fix direct access to resource->data 2013-06-25 16:15:27 -04:00
Ander Conselvan de Oliveira
047e9b97b3 gl-renderer: Split gl_renderer_attach() into smaller functions 2013-06-25 16:13:45 -04:00
Ander Conselvan de Oliveira
6be5f439d5 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().
2013-06-25 16:08:17 -04:00
Ander Conselvan de Oliveira
a9bf16157e 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.
2013-06-25 16:05:12 -04:00
Kristian Høgsberg
4c6ddf102c compositor: Remove a few legacy uses of wl_object 2013-06-25 15:34:59 -04:00
Kristian Høgsberg
c2d7042b9d compositor: Fix a couple of left-over wl_resource direct access 2013-06-25 15:34:33 -04:00
Kristian Høgsberg
166aeaa411 gl-renderer: Use eglQueryWaylandBufferWL for getting width and height
This gets rid of the last remaining use of struct wl_buffer.
2013-06-25 15:15:31 -04:00
Kristian Høgsberg
31b4a0dcc0 protocol: Add missing xml files to EXTRA_DIST
Reported by Sven Joachim <svenjoac@gmx.de>
2012-02-26 22:29:18 -05:00
Nathan Reboud
e81f9547bb src/.gitignore: add spring-tool to .gitignore 2012-02-26 22:29:12 -05:00
Kristian Høgsberg
e2173b5f36 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.
2013-06-25 11:28:18 -04:00
Kristian Høgsberg
489b279be9 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.
2013-06-25 11:26:31 -04:00
Kristian Høgsberg
f00460771e compositor: Fix remaining double free()s
Previous commit didn't catch all double free()s, hopefully this one does.
2013-06-25 11:19:31 -04:00
Kristian Høgsberg
6c8d778646 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.
2013-06-25 10:29:30 -04:00
Kristian Høgsberg
88dab17b0e nested: Port away from old wl_resource API 2013-06-24 22:53:38 -04:00
Jason Ekstrand
6bd6294f4a 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>
2013-06-21 23:22:30 -04:00
Jason Ekstrand
8a4a9eb2e4 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>
2013-06-20 23:54:29 -04:00
Giulio Camuffo
1fd4b01d10 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.
2013-06-20 15:22:35 -04:00
Giulio Camuffo
c0b9487937 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
2013-06-20 15:22:35 -04:00
Quentin Glidic
8418c298af shell: Free temporary strings
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-06-20 15:22:35 -04:00
Kristian Høgsberg
9ae2f111d4 log: Only use one string buffer
This also fixes a mismatch between date_string and sizeof string in
the strftime call.
2013-06-19 09:08:07 -04:00
Kristian Høgsberg
a58290b38b xwayland: Use _exit() when exec() fails
Similar to 3b64d6 but for when we fork the X server.
2013-06-18 01:03:17 -04:00
Kristian Høgsberg
082d58c88d 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.
2013-06-18 01:00:27 -04:00
Kristian Høgsberg
1a81abb1dd 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
2013-06-17 15:46:07 -04:00
Kristian Høgsberg
1cfd406f9d shell: Tweak spring animation for zoom animation type 2013-06-17 11:08:11 -04:00
Kristian Høgsberg
8eb0f4f830 shell: Fix warning and indentation in shell_surface_configure() 2013-06-17 10:33:22 -04:00