Commit Graph

3823 Commits

Author SHA1 Message Date
Kristian Høgsberg
ea520d510c build: Rename option and conditional for installing demo clients
Previously the option was --enable-demo-clients and the conditional was
ENABLE_DEMO_CLIENTS.  They control whether or not we install the demo clients
(ie all other clients than weston-terminal and weston-info).  Rename the
option and the conditional to better reflect this.
2014-01-01 13:52:20 -08:00
Kristian Høgsberg
ead5242e07 shell: Fix up previous broken commit 2014-01-01 13:51:52 -08:00
Kristian Høgsberg
d55db69c94 Revert "shell: Change stacking order calculation for popup surfaces"
Popup windows are relative to a plain wl_surface, so that custom surfaces
can have popups.  This used for the desktop-shell panel for example.  Also,
popups should be immediately on top of their parent surface, as they
typically represent an extension of an UI element in the parent surface
such as a combo box or menu.

This reverts commit da704d97fa.

Conflicts:
	desktop-shell/shell.c

https://bugs.freedesktop.org/show_bug.cgi?id=72547
2014-01-01 12:26:14 -08:00
Kristian Høgsberg
c152ee11e3 window.c: Don't put buttons on frames for custom windows
Custom windows don't have a wl_shell_surface and can't do anything in
response to these button (except crash).  This only affects the unlock
dialog.

https://bugs.freedesktop.org/show_bug.cgi?id=72542
2013-12-31 15:35:51 -08:00
Kristian Høgsberg
a1df7acb78 shell: Set state_changed when we make a surface transient
If we don't mark the state as changed, we don't copy over next_state to
state and we fail to treat the surface as a transient.  In particular,
we give it a random intial position instead of mapping it at the given
parent relative position.

https://bugs.freedesktop.org/show_bug.cgi?id=72532
2013-12-31 15:01:09 -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
312ea4ca42 shell: Handle the desktop shell client destroy signal
Set the internal pointer for the client to NULL. This fixes a
segmentation fault at shutdown, where the shell would hang up before
and cause libwayland to call wl_client_destroy(). When the shell was
destroyed later, another call to wl_client_destroy() would cause the
crash.

https://bugs.freedesktop.org/show_bug.cgi?id=72550
2013-12-22 13:45:36 -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
Kristian Høgsberg
c2010b3af0 nested: Add EGL_WL_create_wayland_buffer_from_image compat defines
Make it possible to compile this example with EGL implementations without
this extension.
2013-12-17 10:40:01 -08:00
Kristian Høgsberg
fccb57d24d configure.ac: Bump version to 1.3.91 for alpha release 2013-12-16 23:32:53 -08:00
Kristian Høgsberg
98463743ca Makefile.am: Clean generated weston.ini on make clean 2013-12-16 23:12:46 -08:00
Jonny Lamb
92d90f225d clients: add scaler test app
This client tests the wl_scaler and wl_surface_scaler protocol
extensions by cropping and then scaling a surface to ensure it is
rendered correctly. More details in comments in the code.
2013-12-16 22:55:47 -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
Pekka Paalanen
f565d80ff5 protocol: crop & scale RFC v3
Add cropping and scaling to wl_surface.

Add a global factory interface wl_scaler, which creates
wl_scaler_surface objects tied to a given wl_surface. The
wl_scaler_surface object can be used to set a cropping and scaling
transformation to change how a wl_buffer maps to wl_surface contents.

Changes in v2:

Take into account buffer_transform and buffer_scale, and try to explain
more clearly how the coordinate transformations work and what their
order is. Add, that crop and scale state is double-buffered. Explain
missing dst_x, dst_y.  Clarify that undefined content still is some
content, but NULL buffer implies no content nor size.

Changes in v3:

Disallow zero values for dst_width and dst_height.

Open issues:

Should this be a separate interface like here, or just a wl_surface
request?

If we keep this as a separate interface, rename wl_surface_scaler to
wl_viewport.
2013-12-16 22:35:56 -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
Ander Conselvan de Oliveira
fc63fddcee shell: Reset fullscreen and maximized state on output unplug
When a view is moved to another output because its current output was
unplugged, remove the fullscreen and maximized state.
2013-12-16 17:23:08 -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
80c798bdf0 Update .gitignore
Ignore the new stacking demo...
2013-12-09 12:19:40 -08:00
Jasper St. Pierre
cf389f5917 Update .gitignore 2013-12-09 12:15:41 -08:00
Jasper St. Pierre
8f180d44f5 shell: Fix set_transient_for with a NULL parent 2013-12-09 11:34:09 -08:00
Kristian Høgsberg
8d344a0548 shell: Make sure the shell implementation and protocol versions match 2013-12-08 22:27:11 -08:00
Kristian Høgsberg
1e65840b61 simple-egl: Add option to allow not syncing to compositor repaint cycle
It's the GO FASTER option.
2013-12-07 22:26:23 -08:00
Kristian Høgsberg
deb322237b simple-egl: Print fps for the spinning triangle
This is not a benchmark.
2013-12-07 22:26:23 -08:00