Commit Graph

1333 Commits

Author SHA1 Message Date
Kristian Høgsberg
cee407e0c0 evdev: Don't add output offset in evdev_process_absolute_motion()
We do that in weston_output_transform_coordinate() now.
2013-07-26 10:40:32 -07:00
Kristian Høgsberg
87d38418a1 compositor-x11: Use assert(0) instead of return NULL for non-reachable code 2013-07-25 16:42:30 -07:00
Kristian Høgsberg
46118f8197 clipboard: Fix fd leak
We never closed the reading end of the pipe after copying data to the
clipboard.
2013-07-25 16:21:41 -07:00
Kristian Høgsberg
5e76a49d9c Rename wl_data_offer to weston_data_offer
Another left-over from when we moved the input structs.
2013-07-25 16:09:37 -07:00
Kristian Høgsberg
0e17de1c0b udev: Use WL_OUTPUT udev attribute for pairing touchscreens to outputs 2013-07-25 15:58:14 -07:00
Kristian Høgsberg
f2807701d9 weston-launch: Switch to regular poll
epoll doesn't provide any convenince here and is just awkward to use.
2013-07-25 15:58:00 -07:00
Kristian Høgsberg
636156d5f6 weston-launch: Don't start new session unless -u is given 2013-07-25 15:57:01 -07:00
Kristian Høgsberg
ab4999492c weston-launch: Drop sleep_fork option 2013-07-25 15:56:58 -07:00
Kristian Høgsberg
ca70f2fc68 weston-launch: Move child setup and exec to its own function 2013-07-25 15:56:49 -07:00
Kristian Høgsberg
7ff3bdb5f7 Rename wl_data_source to weston_data_source
Missed this rename when we moved the input structs over from wayland.
2013-07-25 15:54:20 -07:00
Kristian Høgsberg
862814b2e6 clipboard: Handle OOM in clipboard_source_create() 2013-07-25 15:54:20 -07:00
Kristian Høgsberg
3c95e70496 compositor: Move weston-launch socket lookup to drm backend
This is the only backend that uses the launcher, so let's set it
up there.
2013-07-25 09:51:46 -07:00
Kristian Høgsberg
9e5d7d17a7 shell: Remove redundant weston_pointer field from shell_grab
This is already in weston_grab.
2013-07-25 09:50:34 -07:00
Kristian Høgsberg
97e806f138 evdev: Use weston_output_transform_coordinate for evdev touch screens 2013-07-25 09:50:28 -07:00
Kristian Høgsberg
98c774f1c0 compositor: Move device coordinate transform helper to compositor.c
This function transform input coordinates from output space to
compositor space and is useful for X input as well as touch screen input.
2013-07-25 09:50:15 -07:00
Kristian Høgsberg
18684d442e weston-launch: Ignore sighup
When our session terminates all processes get a SIGHUP.  We need to ignore
that in weston-launch and stay around to help weston shut down properly.

https://bugs.freedesktop.org/show_bug.cgi?id=63004
2013-07-22 16:34:41 -07:00
Rob Bradford
bdeb5d224d shell: Respect output transformation for input panel surface
Rather than using the dimensions in the mode we can use the recently
added output width and height members which are updated to reflect any
output rotation.

https://bugs.freedesktop.org/show_bug.cgi?id=66798
2013-07-12 23:56:18 -04:00
Rob Bradford
e1ad1d2498 tablet-shell: Avoid infinite loop when unlocking
weston_compositor_wake will fire the signal that the unlock handler is
setup as the listener for. Instead lets change the state to HOME which
unlocks.
2013-07-09 17:11:31 -04:00
Rob Bradford
6cf9b01e88 tablet-shell: Fix copy and paste error in unlock handler
The signal handler was using the wrong member to find the containing
structure of the unlock listener.

https://bugs.freedesktop.org/show_bug.cgi?id=57637
2013-07-09 17:10:34 -04:00
Kristian Høgsberg
919cddb0ab Convert to wl_global_create/destroy() 2013-07-09 02:02:11 -04:00
Kristian Høgsberg
aaadc774a7 input: Remove wl_seat global when a seat is destroyed
The input code was relying on compositor destruction to clean up the
global, but that doesn't work when the global comes and goes dynamically.

https://bugs.freedesktop.org/show_bug.cgi?id=65913
2013-07-08 16:20:31 -04:00
Kristian Høgsberg
fa514b496e xwayland: Don't allow resizing to 0x0 or less
X windows have to be at least 1x1 pixels.

https://bugs.freedesktop.org/show_bug.cgi?id=63510
2013-07-08 15:00:25 -04:00
Kristian Høgsberg
07d48a306e weston-launch: Fix the typo for real this time
Thanks to MonkeyofDoom for point this out.  I'm still adjusting to the
fact that there's no 'd' in privilege, but I'll get over it.
2013-07-08 14:34:53 -04:00
Kristian Høgsberg
9dadfb5352 compositor: Eliminate marshalling warning for leave events
Don't NULL the resource pointer before calling weston_surface_destroy().
We use to have more of a distinction between compositor created surfaces
and client surfaces, and weston_surface_destroy couldn't be used for
client surfaces.  Now it all goes through weston_surface_destroy() and
we can remove the assert and the NULL-ing of resource, which caused the
marshalling warning.
2013-07-08 13:49:36 -04:00
Giulio Camuffo
708b8af018 input: check if the resource is valid in seat_get_pointer
seat->pointer->focus->resource can be NULL, if the surface was
created with weston_surface_create.
2013-07-08 13:22:08 -04:00
Hardening
c077a8435d Document RDP compositor options
Help was missing for the RDP compositor, this patch gives details
about available options.
2013-07-08 13:16:36 -04:00
Hardening
fe107f368a Fix compilation with FreeRDP master
context_size has been renamed to ContextSize, this patch fixes it
2013-07-08 13:16:30 -04:00
Kristian Høgsberg
7e80f1b656 weston-launch: Fix an error message typo 2013-07-08 12:56:28 -04:00
Quentin Glidic
735302ea2d weston-launch: Set all groups for user
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>

https://bugs.freedesktop.org/show_bug.cgi?id=65933
2013-07-08 12:56:24 -04:00
Rob Bradford
27b1793857 compositor: rebuild the global list if we've removed a surface from it
The list of surfaces used by weston_compositor_pick_surface() is
maintained in list of surfaces stored on the compositor. This list is
generated from the surfaces across all the layers using
weston_compositor_build_surface_list.

When destroying a surface the surface is "unmapped" with
weston_surface_unmap which removes it from the layer list. However since
the compositor surface list was only being rebuilt when the output was
repainted a call to weston_compositor_pick_surface before the next
output repaint would use an outdated surface list containing surfaces
that have been partially destroyed.

https://bugs.freedesktop.org/show_bug.cgi?id=65986
https://bugs.freedesktop.org/show_bug.cgi?id=66173
https://bugs.freedesktop.org/show_bug.cgi?id=66198
2013-07-06 00:31:54 -04:00
Ander Conselvan de Oliveira
3c36bf3486 compositor: Remove a plane from the compositor list when releasing it
Weston would crash when hot plugging/unplugging outputs using the DRM
backend due to a corrupted plane list.

https://bugs.freedesktop.org/show_bug.cgi?id=66530
https://bugs.freedesktop.org/show_bug.cgi?id=66529
2013-07-05 16:41:42 -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
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
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
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
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
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