Commit Graph

1768 Commits

Author SHA1 Message Date
Jason Ekstrand
81038fba86 Only update the surface size if a new buffer is attached
This fixes a regression caused by either 918f2dd4 or da75ee1d.  In
particular, if a client called commit without attaching a buffer and if the
compositor had already released its reference to the buffer, then a size of
0x0 would be set on the surface.  In particular, this affects the wayland
backend because it frequently sends only a frame request in order to cause
a refresh.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-01-13 15:59:08 -08:00
Kristian Høgsberg
c180977e7c text: Set context->model to NULL when we deactivate text input
There's a small window between the input method (eg the on-sreen keyboard)
receiving the deactivate and destroying the context, where the keyboard may
send requests, which we forward to the destroyed input method.  Fix this
by setting the contexts model to NULL right away and then avoid sending
events if context->model is NULL.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69490
2014-01-13 15:06:10 -08:00
Kristian Høgsberg
b0fb25dedc compositor: Init output listeners in weston_view if it's not on any output
If we don't add the listener back to a new output, we have to init the
list links so we can remove them unconditionally.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73415
2014-01-09 22:42:28 -08:00
Kristian Høgsberg
8ca9544e06 input: Re-pair touch screen when monitor is plugged in
https://bugs.freedesktop.org/show_bug.cgi?id=73442
2014-01-09 16:46:33 -08:00
Kristian Høgsberg
a30e29af2e input: Ignore touch up events if num_tp is 0
This can happen if we start out with one or more fingers on the touch
screen, in which case we didn't get the corresponding down event.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73367
2014-01-08 22:29:25 -08:00
Fabien DESSENNE
4b2558708b compositor-drm: consider the best mode of the mode_list as an option
This patch fixes an issue where Weston using the DRM backend, cannot start
the display. This happens in the following context:
- no video mode is set before weston starts (eg no "/dev/fb" set up)
- weston is not configured with any default video mode (nothing from
  weston.ini nor command line)
- the DRM driver provides with a list of supported modes, but none of them
  is marked as PREFERRED (which is not a usual case, but it happens)
In that case, according to the current implementation, the DRM compositor
fails to set a video mode.
This fix lets the DRM compositor selects a video mode (the best one of the
list, which is the first) from the ones provided by the driver.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2014-01-08 22:06:05 -08:00
Rui Matos
73d9395e68 input: Don't leak the initial keymap
weston_xkb_info_create() takes ownership of the xkb_keymap instance so
we should drop our reference or we would leak it later if the keymap
was changed.
2014-01-08 21:40:32 -08:00
Pekka Paalanen
b0420aeb3d protocol: rename wl_surface_scaler to wl_viewport
This seems like a better name, and will not conflict if someone later
extends wl_surface with a request scaler_set (yeah, unlikely).

This code was written by Jonny Lamb, I just diffed his branches and made
a patch for Weston.

Cc: Jonny Lamb <jonny.lamb@collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-01-08 21:33:19 -08:00
Pekka Paalanen
2d91ee171b screenshooter: silence a warning
screenshooter.c: In function ‘recorder_binding’:
screenshooter.c:509:5: warning: ‘listener’ may be used uninitialized in
this function [-Wuninitialized]

This was not really a problem so far, because the variable was
uninitialized only in the case where Weston had no outputs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-01-08 21:27:53 -08:00
Kristian Høgsberg
2fce4808dd input: Remap touch point IDs from multiple touch screens to not overlap
With multiple touch screens on one seat, the touch points IDs from the
different evdev devices may overlap.  We have to remap the IDs we forward
to core weston so that the touch points all have unique IDs within the seat.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73003
2014-01-08 16:21:24 -08:00
Chris Michael
8b37687d3a Properly free drm plane during creation of sprites
If we fail to allocate space for a new drm_sprite, then we should
properly call drmModeFreePlane (not free) to release the drm plane.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-01-02 15:22:59 -08:00
Hardening
fb8546e45f Release pointer and keyboard with the seat
This patch fixes seat releasing during a RDP disconnection.
It does not fully fix https://bugs.freedesktop.org/show_bug.cgi?id=66830,
but makes things better.
2013-12-22 13:49:30 -08:00
Ander Conselvan de Oliveira
18536764b4 compositor: Destroy renderer in weston_compositor_shutdown()
Currently we destroy the renderer before the outputs are destroyed, but
that sometimes leads to an error since a reference to the renderer is
necessary in order to destroy a gl_renderer_output.

Since destroying the renderer is common among all backends, just move
that call into weston_compositor_shutdown() immediately after the
outputs being destroyed.
2013-12-22 13:45:29 -08:00
Lubomir Rintel
ddc2b1ec32 pixman: Destroy pixman images when underlying buffer is destroyed
While the pixman image might be attached, the underlying buffer might be
already gone under certain circumstances. This is easily reproduced by
attempting to resize gnome-terminal on a fbdev backend.

$ WAYLAND_DEBUG=1 strace -emunmap weston --backend=fbdev-backend.so
...
[1524826.942] wl_shm@7.create_pool(new id wl_shm_pool@23, fd 40, 1563540)
[1524827.315] wl_shm_pool@23.create_buffer(new id wl_buffer@24, 0, 759, 515, 3036, 0)
...
[1524829.488] wl_surface@14.attach(wl_buffer@24, 0, 0)
[1524829.766] wl_surface@14.set_buffer_scale(1)
[1524829.904] wl_surface@14.damage(0, 0, 759, 515)
[1524830.248] wl_surface@14.frame(new id wl_callback@25)
[1524830.450] wl_surface@14.commit()
...
[1524846.706] wl_shm@7.create_pool(new id wl_shm_pool@26, fd 40, 1545000)
[1524847.215] wl_shm_pool@26.create_buffer(new id wl_buffer@27, 0, 750, 515, 3000, 0)
[1524847.735] wl_buffer@24.destroy()
[1524847.953]  -> wl_display@1.delete_id(24)
[1524848.144] wl_shm_pool@23.destroy()
munmap(0xb5b2e000, 1563540)             = 0
[1524849.021]  -> wl_display@1.delete_id(23)
[1524849.425] wl_surface@14.attach(wl_buffer@27, 0, 0)
[1524849.730] wl_surface@14.set_buffer_scale(1)
[1524849.821] wl_surface@14.damage(0, 0, 750, 515)
<No commit yet, so drawing is attempted from older buffer that used to be
 attached to the surface, which happens to come from a destroyed pool,
 resulting it an invalid read from address 0xb5b2e000>

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2013-12-22 13:40:11 -08:00
Ander Conselvan de Oliveira
24dff2b704 compositor: Clean up view output move and destroy listeners
Remove those listeners when the output is destroyed, otherwise they'll
point to invalid data that may lead to corruption when assigning a new
output for the view.

--
This is possibly related to bug 72845. I didn't have enough equipment
to try and reproduce it.

https://bugs.freedesktop.org/show_bug.cgi?id=72845
2013-12-19 21:52:09 -08:00
Ander Conselvan de Oliveira
d4ea71eada compositor-x11: Set the name field on weston_outputs
That way log messages referencing the output are more informative.
2013-12-19 21:51:14 -08:00
Ander Conselvan de Oliveira
41b829c025 screenshooter: Choose output to record from based on keyboard focus
Record from the output of the surface that has keyboard focus for the
seat used to activate the recorder key binding. If there is no focused
surface, record from the first one.

Also, use the weston_transformed_region() to transform the damage
region of the output into the coordinates expected by read_pixels().

https://bugs.freedesktop.org/show_bug.cgi?id=71401
2013-12-19 21:49:18 -08:00
Kristian Høgsberg
df42a80ea2 compositor: Initialize output listener links
Make sure the links are initialized so we can safely remove the listeners
in weston_view_unmap().

https://bugs.freedesktop.org/show_bug.cgi?id=72808
2013-12-17 14:58:19 -08:00
Ander Conselvan de Oliveira
e22f3bb5da screenshooter: Record one extra frame when recording stops
If the compositor hasn't been rendering for a while when the recording
stops, the time difference between the last rendered frame and that
moment won't be in the encoded video. Fix that by forcing one extra
frame to be recorded when the user presses the recorder key binding.

https://bugs.freedesktop.org/show_bug.cgi?id=71142
2013-12-17 10:59:06 -08:00
Jonny Lamb
fa1b3055b2 pixman-renderer: implement surface scaling and cropping
The pixman renderer doesn't use the weston_surface_to_buffer*
functions to alter coordinates depending on buffer transformation,
buffer scaling, and surface scaler (wl_surface_scaler).
pixman_transform_scale() is used instead to perform said
transformations without having to modify each coordinate.
2013-12-16 22:43:27 -08:00
Jonny Lamb
7413076f82 compositor: transform surface coordinates if a surface scaler is used
Implements wl_surface_scaler.set by setting desired
src_{x,y,width,height} and dst_{width,height} values in the
weston_buffer_viewport struct, then altering coordinates in
weston_surface_to_buffer* functions if there is a scaler set for said
surface.
2013-12-16 22:38:07 -08:00
Jonny Lamb
8ae3590325 compositor: add stub scaler resources
This registers the wl_scaler global object and lets clients create
wl_surface_scaler objects for surfaces. wl_surface_scaler.set is not
implemented so this doesn't really do anything useful yet.
2013-12-16 22:36:11 -08:00
Jason Ekstrand
5c11a3340b Add a weston_surface_set_size function
Surfaces that are created by clients get their size automatically updated
by the attach/commit.  Surfaces created directly by shells (such as black
surfaces) sometimes need to be manually resized.  This function allows you
to do that while being somewhat less messy than messing with the internals
of weston_surface manually.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-12-16 17:23:09 -08:00
Zhang, Xiong Y
31236932a1 desktop-shell: Invalidate saved position when output is destroyed
If the saved position for a fullscreen or maximized output view is in an
output that has been unplugged, the coordinates don't make sense
anymore. In that case, invalidate them and use the initial position
algorithm when changing them back to the basic state.

Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16 17:23:08 -08:00
Ander Conselvan de Oliveira
54e90c7e1e compositor: Make pointers visible when an output is unplugged
Previously, if a pointer was inside an output that was unplugged, it
could potentialy end up outside any valid output forever. With this
patch, the pointer is moved to the "closest" output to the pointer.
2013-12-16 17:23:08 -08:00
Ander Conselvan de Oliveira
e1e2352dcc compositor: Don't repaint outputs being destroyed
Set a flag when an output is being destroyed and use that to avoid
repainting. This allows functions that schedule an output repaint to
be called when the output is being destroyed without causing the
compositor to crash.
2013-12-16 17:23:01 -08:00
Zhang, Xiong Y
010d0b1695 compositor: Ensure views are visible if their output was unplugged
Use the output destroy signal to move the views in the event the output
was unplugged.

Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16 16:46:22 -08:00
Zhang, Xiong Y
f301241d1a compositor: Move views when outputs are moved
Previously, when an output was moved due to another output being
unplugged, the views on the first output would remain in the same
position.

This patch adds an output_move signal that the views listen too in
order to repostion themselves in the event of an unplug.

Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16 16:23:11 -08:00
Ander Conselvan de Oliveira
62a9075a6b compositor-headless, compositor-rdp: Don't call weston_output_move()
The call to weston_output_move() when creating the output is
unnecessary. That is already called by wesotn_output_init().
2013-12-16 16:21:10 -08:00
Zhang, Xiong Y
a4b54c0b79 compositor: Move the logic of moving outputs into the core
Instead of having the backends move the remaining outputs when one is
destroyed, let the core compositor deal with that.

Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16 16:20:51 -08:00
Ander Conselvan de Oliveira
f749fc3782 compositor: Remove output from list in weston_output_destroy()
When destroying ouputs, they would sometimes be removed before the call
to weston_output_destory() and sometimes after, depending on the
backend. Now the output is remove withing that function so the behavior
is standard across all backends.
2013-12-16 16:19:46 -08:00
Ander Conselvan de Oliveira
f54fa4db2b compositor-x11: Only destroy one output when the close button is pressed
Instead of terminating the compositor, destroy the output whose close
button was clicked and move the other outputs, as is done in the drm
backend.
2013-12-16 16:19:23 -08:00
Kristian Høgsberg
d0cb10a36b evdev: Drop joystick rejection heurstics
We now no longer add joysticks at all.  They show up as absolute motion
devices without has_button, so we don't add them as a pointer.  We may add
a keyboard for the keyboard-style keys, but that's fine.  With the previous
commit, we no longer generate spurious absolute pointer motion for the abs
axes.

https://bugs.freedesktop.org/show_bug.cgi?id=71687
2013-12-16 16:15:47 -08:00
Kristian Høgsberg
cd2f46f3d2 evdev: Reject absolute motion if we're not a pointer or a touch device
Some joysticks have certain buttons that acts keyboard keys.  As such,
we'll reconize them as keyboards but not pointers.  In that case, don't
send pointer motion events when we get absolute joystick events.
2013-12-16 15:51:22 -08:00
Kristian Høgsberg
c67fd1cf0e evdev: Drop obsolete accelerometer reject rule
This rule triggers for devices with an ABS_X/Y evaluators and no
keyboard or multitouch events.  There is no way we would ever add such
a device as a pointer, keyboard or touch device anyway.  A pointer
device requires has_button (in which case the !has_key condtion would
fail); a keyboard device would also mean !has_key is false and a touch
screen device implies that !device->is_mt is false.
2013-12-16 15:44:26 -08:00
Kristian Høgsberg
de5f82c90d evdev: Remove EVDEV_TOUCH and with it evdev_device->caps
We now keep all the configuration intermediate results inside
evdev_configure_device() and the result is device->seat_caps.
2013-12-16 15:42:51 -08:00
Kristian Høgsberg
3d793c9053 evdev: Use a has_keyboard flag instead of EVDEV_KEYBOARD bit 2013-12-16 15:42:38 -08:00
Kristian Høgsberg
77b0d23c00 evdev: Replace EVDEV_BUTTON with local has_button flag 2013-12-16 15:11:31 -08:00
Kristian Høgsberg
b7c58de8f6 evdev: Replace EVDEV_MOTION_ABS with local has_abs flag 2013-12-16 15:11:30 -08:00
Kristian Høgsberg
8d31a3ae56 evdev: Use has_abs only for ABS_X and ABS_Y, introduce has_mt for MT events
We split up has_abs into plain ABS_X/Y and MT events, but this shouldn't
introduce any logic changes.
2013-12-16 15:11:30 -08:00
Kristian Høgsberg
015e73dc33 evdev: Drop EVDEV_MOTION_REL flag
This is only used inside evdev_configure_device() and we now use a local
has_rel flag instead.
2013-12-16 15:11:30 -08:00
Kristian Høgsberg
d24a64ea30 evdev: Combine evdev_handle_device() and evdev_configure_device()
We split the device probing and idenfication somewhat arbitrarily between
these two functions.  This commit combines them into one.  Return of -1
indicates error, 0 success, but succesful probing can return a device
with device->caps == 0, which means we don't handle the device.
2013-12-16 15:11:30 -08:00
Giulio Camuffo
1aaf3e42e2 sdk: make C++11 plugins build again
compositor.h must not define a 'static_assert' macro, since that
conflicts with the new 'static_assert' in the standard and breaks
the build.
2013-12-09 16:20:48 -08:00
Jasper St. Pierre
cf389f5917 Update .gitignore 2013-12-09 12:15:41 -08:00
Kristian Høgsberg
8d344a0548 shell: Make sure the shell implementation and protocol versions match 2013-12-08 22:27:11 -08:00
Giulio Camuffo
65a07f8aef input: make sure the devices get the resource destruction signal
The device may not have a resource for the client yet, but install
the listeners nevertheless.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=65726
2013-12-06 11:19:38 -08:00
Kristian Høgsberg
a98c2e17fd compositor-x11: Damage output when we receive expose events for the window
The gl renderer typically repaints everything since we don't have
EGL_buffer_age under X, but the pixman renderer carefully only repaints
damaged regions.  So to actually repaint anything with the pixman
renderer, we need to damage the output.

https://bugs.freedesktop.org/show_bug.cgi?id=72351
2013-12-05 12:30:39 -08:00
Pekka Paalanen
477333285e rpi: launcher must init before udev-seat
udev-seat will call weston_launcher_open(), so we better init launcher
first. Fixes a segfault.

Cc: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04 11:38:40 -08:00
Pekka Paalanen
53b41c7890 rpi: seat quick fix
Fix the default seat name, so that we can find the input devices by
default.

This is just a quick fix. Further enhancement would be to make the
default seat on rpi taken from a command line option like the other
backends do. Furthermore, udev_input_init() should accept NULL as seat
to use the default seat, avoiding us hardcoding "seat0" all over.

Cc: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04 11:38:26 -08:00
Pekka Paalanen
bc91e5120c rpi: compile in the common udev code
In a recent commit 37d38d932c, "rpi: Use
common udev_input for input device handling", the rpi-backend was made
to use the common udev code.

It just forgot to actually build the common udev code into the
rpi-backend.

Cc: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04 11:38:08 -08:00
Pekka Paalanen
e47d0d986c gl: fix fallback definition of EGL_DEFAULT_DISPLAY
Compiling fbdev backend on RaspberryPi caused the following warning:

compositor-fbdev.c: In function 'fbdev_compositor_create':
compositor-fbdev.c:929:6: warning: passing argument 2 of
'gl_renderer->create' makes integer from pointer without a cast [enabled
by default]
compositor-fbdev.c:929:6: note: expected 'EGLNativeDisplayType' but
argument is of type 'void *'

Fix the definition of EGL_DEFAULT_DISPLAY to match the definition in
EGL/egl.h (of Mesa).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04 11:37:57 -08:00
Kristian Høgsberg
19d1e6b185 desktop-shell: Move to new desktop-shell subdirectory 2013-12-04 10:20:02 -08:00
Kristian Høgsberg
2ba10df300 Move xwayland up one directory level 2013-12-04 10:20:02 -08:00
Kristian Høgsberg
873b515aee tablet-shell: Remove
The tablet-shell is unmaintained and unused.  It is currently
dead-weight and a burden when we make changes to weston.  Let's
drop it for now, we can pull it out of git if we find a need for it later.
2013-12-04 10:18:29 -08:00
Dima Ryazanov
cae1f0ff2d Check if the frame exists before reading its size
This fixes crashes caused by popup windows that don't have override_redirect
(e.g., menus in VLC and KDE apps).

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
2013-12-03 16:13:08 -08:00
Dima Ryazanov
b03b87fe63 Check for frame being NULL before setting/unsetting flags
Fixes a crash in Firefox when clicking an "install plugin" popup.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
2013-12-03 16:12:54 -08:00
Dima Ryazanov
e5a3208373 Set the view to NULL when unmapping an X11 window
Fixes a crash caused by accessing a deleted view in weston_wm_window_schedule_repaint. It can be easily reproduced by switching between menus in Firefox.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
2013-12-03 15:54:44 -08:00
Jonas Ådahl
767d891c35 data-device: Fix surface configure function type
The commit "Remove the weston_view.geometry.width/height fields" changed
the type of the surface configure callback function, but did not change
the callbacks in data-device.c. This commit fixes the type of the
functions left needed to be changed.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-03 15:16:21 -08:00
David Herrmann
aedc7732eb logind: delay wakeup until DRM-device is resumed
The logind API was designed to allow any kind of devices and any number of
devices. It has no idea of "main DRM device" or similar. However, the
weston DRM backend was designed with a single DRM device as master.
Therefore, we wake it up unconditionally on session-wakeup. But this may
fail with logind as a session may be awake, but not all devices have been
resumed, yet.

Therefore, we change the weston-logind backend to deal with this case
correctly. Instead of waking up the compositor on session-wakeup, we wait
for the main DRM device to wake up. Once we get the event, we notify the
compositor.

For sleep, we reverse this logic. On *any* of the following events we
tell the compositor to go to sleep:
 - Session gets inactive
 - DRM device gets inactive
 - DRM device is removed
This guarantees, that weston is only active if *both*, the session and the
main DRM device are awake/active.

Note that we could actually rely solely on the DRM-device Pause/Resume
events from logind and drop all the Active-Prop-Changed handling. logind
guarantees proper ordering of both. However, in case we ever change weston
to support multiple GPUs, we need the per-device notification. Thus, keep
the code. This also makes weston more fail-safe in case logind fails to
send the PauseDevice event (for whatever reason..).
2013-12-03 12:57:01 -08:00
Rafael Antognolli
ea997ac696 xdg-shell: Add key bindings for setting maximized and fullscreen. 2013-12-03 12:57:01 -08:00
Rafael Antognolli
65f98d8c2f xdg-shell: xdg_surface_set_output should only affect fullscreen. 2013-12-03 12:57:01 -08:00
Rafael Antognolli
3c4e3f7cc7 xdg-shell: Add surface size to configure.
Also emit configure on unset_maximized and unset_fullscreen.
2013-12-03 12:57:01 -08:00
Rafael Antognolli
e2a3455642 xdg-shell: Implement xdg-shell interface.
The whole xdg-shell interface is implement, except from the "focused_set"
and "focused_unset" events.
2013-12-03 12:57:01 -08:00
Rafael Antognolli
4b99a40bcb shell: Move shell_surface_set_parent to wl_shell calls.
The parent update on set_maximized and set_fullscreen is a behavior of
wl_shell.

That does not happen on xdg-shell, so it can't be in the set_fullscreen
and set_maximized common code, but rather in the wl_shell_surface
interfaces.
2013-12-03 11:35:25 -08:00
Rafael Antognolli
ed207b4bd5 shell: Remove SHELL_SURFACE_TRANSIENT. 2013-12-03 11:35:25 -08:00
Rafael Antognolli
03b16597e0 shell: Remove SHELL_SURFACE_FULLSCREEN and SHELL_SURFACE_MAXIMIZED.
These surface types don't exist anymore inside weston desktop shell
implementation. They are just exposed as wl_shell surface types, but
internally the implementation is done with surface states.

The previous behavior (setting a surface type unsets another one) still
happens when using wl_shell. This change is mainly done as a refactory
to allow xdg-shell to use the same code.
2013-12-03 11:35:25 -08:00
Jonas Ådahl
91fed5419c input: Reset keyboard state when releasing last seat keyboard
Don't rely on the input driver to properly send button-up events for
every pressed key.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-03 08:39:55 -08:00
Jonas Ådahl
7395ea05c7 input: Move the xkb fields from weston_seat to weston_keyboard
XKB integration is a keyboard feature and should as such be kept track
of in the keyboard struct.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-03 08:38:25 -08:00
Jason Ekstrand
918f2dd4cf Remove the weston_view.geometry.width/height fields
This has a couple of additional implications for the internal weston API:
 1) weston_view_configure no longer exists.  Use weston_view_set_position
    instead.
 2) The weston_surface.configure callback no longer takes a width and
    height.  If you need these, surface.width/height are set before
    configure is called.  If you need to know when the width/height
    changes, you must track that yourself.
2013-12-02 22:17:58 -08:00
Emilio Pozuelo Monfort
8a81b83900 Make the default desktop shell client configurable
The default can be set by passing WESTON_SHELL_CLIENT as an argument
to configure, similarly to WESTON_NATIVE_BACKEND.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-12-02 15:44:49 -08:00
Jonas Ådahl
3e12e63f03 input: Reset pointer state when last pointer device was removed
Reset pointer button count in case the driver did not emit appropriate
number of number button released events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-02 15:24:36 -08:00
Jonas Ådahl
cbfa7f7b22 input: Reset touch state when last touch device was removed
Reset the touch point count in case the driver did not emit appropriate
number of touch up events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-02 15:24:22 -08:00
Jonas Ådahl
9484b695b9 input: Keep track of number of touch points inside touch struct
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-02 15:24:05 -08:00
Jonas Ådahl
37d38d932c rpi: Use common udev_input for input device handling
The purpose of this patch is to move away from separating evdev
functionality from udev functionality in order to rely on a separate
library to do this for us.

This patch is only compile tested and I have no idea how much it breaks.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-02 15:23:48 -08:00
Philip Withnall
da704d97fa shell: Change stacking order calculation for popup surfaces
Always put them as the top-most layer in the layer list of their parent.
This ensures that, for example, the popup menu produced by
right-clicking on a surface (which is not currently at the top of the
stacking order in the current workspace) is displayed at the top of the
stacking order.
2013-12-02 11:44:51 -08:00
Philip Withnall
2c3849be91 shell: Fix a potential NULL pointer dereference
get_shell_surface() may return NULL. Found by scan-build.
2013-12-02 11:44:51 -08:00
Philip Withnall
648a4dd3ec shell: Store parent–child links between shsurfs for window stacking
This ensures transient surfaces are included in the layer of their
parent, even if the parent later changes layers. It achieves this by
recursively changing the layers of all children of a surface when that
surface’s layer is changed. The recursion is unbounded unless transient
surfaces are restricted to not being children of other popup or transient
surfaces.

This fixes a bug whereby a surface which is transient for a fullscreen
surface could end up being stacked below it.

https://bugs.freedesktop.org/show_bug.cgi?id=69443
2013-12-02 11:44:51 -08:00
Philip Withnall
ed8f1a9e4b shell: Factor out common code to create fullscreen black surfaces 2013-12-02 11:44:51 -08:00
Philip Withnall
83ffd9d17b shell: Remove weston_view_restack()
It’s tied too deeply into the shell’s window stacking and ordering code
to legitimately be split out into compositor.c. Inline it in the shell,
and refactor some code around it a little, tidying up the stacking
behaviour for fullscreen surfaces.
2013-12-02 11:44:51 -08:00
Philip Withnall
e1d75ae73f shell: Update a shsurf’s layer when its surface type changes 2013-12-02 11:44:51 -08:00
Philip Withnall
07926d90d1 shell: Factor out code to set the layer for a shsurf
This will be used more extensively in the next few commits, where shsurf
layering is handled more explicitly when changing the type of a surface.

This commit introduces the minor functional change that map() will now
always add the new surface to a layer list, as
shell_surface_calculate_layer_link() always returns a non-NULL link
element. This affects fullscreen and ‘none’ surfaces (which are now added
to the fullscreen and current workspace’s layer list, respectively).
2013-12-02 11:44:50 -08:00
Philip Withnall
b995e1d053 shell: Don’t change popups’ window types until the next configure event
This standardises their behaviour with that of the other window types,
where the type change is only committed on configure.
2013-12-02 11:44:50 -08:00
Philip Withnall
dc4332f1ff shell: Factor out code to set a shsurf’s parent
This is in preparation for unifying how surface layering works. It
introduces the small functional change that fullscreen, maximized and
top-level surfaces now explicitly have no parent surface. Only popup and
transient surfaces have a non-NULL parent.
2013-12-02 11:44:50 -08:00
Philip Withnall
f85fe84ec3 shell: Tidy up unset_fullscreen()
No functional changes, merely some presentational cleanup.
2013-12-02 11:44:50 -08:00
Philip Withnall
659163d25c shell: Refactor workspace code to operate on shsurfs rather than views
This is needed for the work to refactor window stacking and ordering, as
window order operates on shsurfs, not views.
2013-12-02 11:44:50 -08:00
Philip Withnall
352e7ed527 shell: Factor out common code to set a shsurf’s output 2013-12-02 11:44:50 -08:00
Philip Withnall
4a86a0a57b shell: Add missing cases to switch statements for animations and fading
This fixes two GCC warnings when compiling with -Wswitch-enum
-Wswitch-default, and makes it clearer that those cases have been
thought about explicitly when writing the code, rather than just being
forgotten.
2013-12-02 11:44:49 -08:00
Philip Withnall
0f640e219c shell: Add missing cases to switch statements for surface types
This fixes a load of GCC warnings when compiling with -Wswitch-enum
-Wswitch-default, and makes it clearer that those cases have been
thought about explicitly when writing the code, rather than just being
forgotten.
2013-12-02 11:44:49 -08:00
Philip Withnall
becb77e211 shell: Reorganise set/unset methods for fullscreen/maximize/popup/transient
Move them to be next to each other, and standardise the naming scheme so
they’re more greppable. This should make maintenance easier.
2013-12-02 11:44:49 -08:00
Xiong Zhang
becf5a342f src/shell.c: set black_surface->width and height
full screen black_surface doesn't have associated wl_buffer, so
black_surface->width and height can't get value through
weston_surface_commit(). then weston_surface_damage(black_surface)
will be wrong in shell_stack_fullscreen(), the result is that we
can't see a full screen view whe APP window's size isn't equal to
output's size like running weston-gears

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-12-02 11:44:49 -08:00
Tomeu Vizoso
e4f7b92204 rpi: Support opaque regions
This is needed for XWayland surfaces with alpha channel, as X will be
sending crap in there that should be discarded.

This is currently done with a copy in the compositor, while we wait for
support in the VideoCore side.
2013-12-02 11:36:29 -08:00
Pekka Paalanen
da75ee1de0 compositor: merge surface size from buffer size funcs
Replace the two functions getting the intended surface dimensions from
the surface's buffer and buffer transformation parameters by a single
function that just set the surface size according to all the buffer
state.

The old functions were always called in pairs, and always assigned to
the surface dimension variables.

This function also deals with a NULL buffer by setting the dimensions to
zero, just like the callers used to do.

The new function has no users outside this source file, so do not export
it. This basically unexports the old functions.
2013-11-28 14:14:10 -08:00
Pekka Paalanen
ba34165ce2 compositor: do not recompute size on pointer_set_cursor
This removes the calls to weston_surface_buffer_width/height() from
input.c, which are the last external calls to them.

Instead, use the cached values from weston_surface::width,height. These
have already been set by weston_surface_commit(), because that is the
only way a weston_surface can get a buffer.
2013-11-28 14:14:08 -08:00
Pekka Paalanen
1fd9c0f81a compositor: gather buffer_transform and _scale into a struct
Gather the variables affecting the coordinate transformations between
buffer and local coordinates into a new struct weston_buffer_viewport.

This will be more useful later, when the crop & scale extension is
implemented.
2013-11-28 14:14:05 -08:00
Axel Davy
40ee921fff Do not set output->current_mode in compositor.c
The field is already set - correctly - in the backend switch_mode.
setting output->current_mode to mode in compositor.c leads to bugs,
since mode can be freed by the shell.
For example, the shell allocates it on the stack for
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2013-11-27 22:56:43 -08:00
MoD
1b55a5918c compositor-x11: Allow r5g6b5 visuals for X11 backend SHM
The support is already present in the pixman renderer, so we can just
check and use it.
2013-11-27 22:49:31 -08:00
Ander Conselvan de Oliveira
41a50ea71c gl-renderer: Fix support for Y_XUXV buffers
Due to a copy and paste error, the pointer to the vertex shader source
was NULL and the program failed to link.
2013-11-27 22:49:31 -08:00
Tomeu Vizoso
0f0a6ffc2e Remove dependency on <GLES2/gl2.h> by replacing GLfloat with float 2013-11-27 22:49:31 -08:00
Emilio Pozuelo Monfort
eed9344430 exposay: properly go away when the modifier is pressed
We no longer receive an exposay_binding() call while exposay
is in-flight as we have grabbed the keyboard, so we need to
listen on the modifiers callback for the modifier press and
release.
2013-11-27 22:49:31 -08:00
Emilio Pozuelo Monfort
1539ea2f74 input: don't run modifier bindings when the kbd is grabbed
We don't want bindings to be run while the keyboard is grabbed.
Otherwise the binding handler may grab the keyboard too, making
the old grab go away without even being cancelled.
2013-11-27 22:49:31 -08:00