Commit Graph

425 Commits

Author SHA1 Message Date
Pekka Paalanen c647ed79de compositor: add surface-shooting API
This is an optional API that will be implemented by the renderers. It
allows to fetch the current contents of a surface, essentially the
buffer contents from a client buffer, converted to an RGBA format.

This is meant as a debugging API. The implementations may be heavy and
cause a stall, so they are not intended to be used often during normal
operations.

Renderers are expected to convert whatever data a surface has to a
single RGBA format.

Changes in v2:
- remove stride and format arguments from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-02-25 14:47:31 +02:00
Pekka Paalanen 25c0ca5715 compositor: turn weston_view boundingbox into masked
weston_view::transform.boundingbox is made to include the layer mask,
which removes the need for masked_boundingbox.

The following were using boundingbox when they should have used
masked_boundingbox:
- drm_output_prepare_overlay_view() uses boundingbox to compute overlay
  position, source and destination coordinates.
- drm_assign_planes() uses boundingbox for view overlap checks.
- is_view_not_visible() uses boundingbox, but nothing will show outside
  the layer mask.
- weston_surface_assign_output() intersects boundingbox with output
  region to choose the primary output for a surface.
- weston_view_assign_output() intersects boundingbox with output region
  to pick the outputs the view is on.

This patch essentially changes all those cases to use the masked
boundingbox.

Therefore there are no cases which would need the boundingbox without
the layer mask, and we can convert boundingbox into masked and remove
the left-over member.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[v2: don't move the decl of 'mask' in weston_view_update_transform]
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
2015-02-24 09:45:55 +02:00
Pekka Paalanen 8844bf2ab0 compositor: turn weston_view::transform.opaque into masked
Turns out there were no users of weston_view::transform.opaque,
everything was already using transform.masked_opaque. Therefore
repurpose transform.opaque as masked_opaque, and remove masked_opaque
member.

Now this opaque region in global coordinates is clipped by the layer
mask, if set. There are no cases where you would need the opaque region
without the effect of layer mask.

Also add a note in compositor.h, that changing view's layer counts as
changing geometry, which requires calling weston_view_geometry_dirty()
to let all derived state update.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
2015-02-24 09:44:37 +02:00
Pekka Paalanen 2d6e551a0b compositor: add a doc note for weston_view::parent_view
It is used by sub-surfaces only, for fetching the root view's
weston_layer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
2015-02-24 09:44:20 +02:00
Pekka Paalanen 51723d50b5 compositor: document weston_view_damage_below()
Explains what weston_view::clip is.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2015-02-18 09:49:44 +02:00
Giulio Camuffo 6b4b24155f xwm: support maximizing xwayland windows
This patch adds the maximize button to the window frame for the windows
which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell
via a new method in weston_shell_interface.
Additionally, it also listens for the wm hints coming from the client,
but it doesn't support maximizing a window only vertically or horizontally.
The window will be maximized only when both directions are maximized.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-02 16:00:10 -08:00
Pekka Paalanen bf0e031e4a compositor, drm: set per-surface Presentation feedback flags
PRESENTATION_FEEDBACK_KIND_ZERO_COPY is a flag that needs to be set for
each surface separately. Some surfaces may be zero-copy (as defined by
Presentation feedback) while some are not.

A complication with Weston is that a surface may have multiple views on
screen. All copies (views) of the surface are required to be zero-copy
for the ZERO_COPY flag to be set.

Backends set per-view feedback flags during the assing_planes hook, and
then Weston core collects the flags from all views of a surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-01-20 17:13:20 -08:00
Pekka Paalanen 363aa7bc76 compositor: set presentation.presented flags
Change weston_output_finish_frame() signature so that backends are
required to set the flags, that will be reported on the Presentation
'presented' event. This is meant for output-wide feedback flags. Flags
that vary per wl_surface are subject for the following patch.

All start_repaint_loop functions use the special private flag
PRESENTATION_FEEDBACK_INVALID to mark, that this call of
weston_output_finish_frame() cannot trigger the 'presented' event. If it
does, we now hit an assert, and should then investigate why a fake update
triggered Presentation feedback.

DRM:

Page flip is always vsync'd, and always gets the completion timestamp
from the kernel which should correspond well to hardware. Completion is
triggered by the kernel/hardware.

Vblank handler is only used with the broken planes path, therefore do
not report VSYNC, because we cannot guarantee all the planes updated at
the same time. We cannot set the INVALID, because it would abort the
compositor if the broken planes path was ever used.  This is a hack that
will get fixed with nuclear pageflip support in the future.

fbdev:

No vsync, update done by copy, no completion event from hardware, and
completion time is totally fake.

headless:

No real output to update.

RDP:

Guessing that maybe no vsync, fake time, and copy make sense (pixels
sent over network). Also no event that the pixels have been shown?

RPI:

Presumably Dispmanx updates are vsync'd. We get a completion event from
the driver, but need to read the clock ourselves, so the completion time
is somewhat unreliable. Zero-copy flag not implemented though it would
be theoretically possible with EGL clients (zero-copy is a per-surface
flag anyway, so in this patch).

Wayland:

No information how the host compositor is doing updates, so make a safe
guess without assuming vsync or hardware completion event. While we do
get some timestamp from the host compositor, it is not the completion
time. Would need to hook to the Presentation extension of the host
compositor to get more accurate flags.

X11:

No idea about vsync, completion event, or copying. Also the timestamp is
a fake.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-01-20 17:13:05 -08:00
Pekka Paalanen b502654b9f compositor: Implement JSON-timeline logging
Logging is activated and deactivated with the debug key binding 't'.
When activated, it creates a new log file, where it records the events.
The log file contains events and detailed object information entries in
JSON format, and is meant to be parsed in sequence from beginning to the
end.

The emitted events are mostly related to the output repaint cycle, like
when repaint begins, is submitted to GPU, and when it completes on a
vblank. This is recorded per-output. Also some per-surface events are
recorded, including when surface damage is flushed.

To reduce the log size, events refer to objects like outputs and
surfaces by id numbers. Detailed object information is emitted only as
needed: on the first object occurrence, and afterwards only if
weston_timeline_object::force_refresh asks for it.

The detailed information for surfaces includes the string returned by
weston_surface::get_label. Therefore it is important to set
weston_timeline_object::force_refresh = 1 whenever the string would
change, so that the new details get recorded.

A rudimentary parser and SVG generator can be found at:
https://github.com/ppaalanen/wesgr

The timeline logs can answer questions including:
- How does the compositor repaint cycle work timing-wise?
- When was the vblank deadline missed?
- What is the latency from surface commit to showing the new content on
  screen?
- How long does it take to process the scenegraph?

v2: weston_surface::get_description renamed to get_label.
v3: reafctor a bit into fprint_quoted_string().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-12-08 15:02:56 +02:00
Pekka Paalanen 8274d901f1 compositor: add weston_surface_set_label_func()
When printing out logs from Weston's actions, mainly for debugging, it
can be very difficult to identify the different surfaces.  Inspecting
the configure function pointer is not useful, as the configure functions
may live in modules.

Add vfunc get_label to weston_surface, which will produce a short,
human-readable description of the surface, which allows identifying it
better, rather than just looking at the surface size, for instance.

Set the label function from most parts of Weston, to identify cursors and
drag icons, and panels, backgrounds, screensavers and lock surfaces, and
the desktop shell's application surfaces.

v2: renamed 'description' to 'label', so we get
	weston_surface_set_label_func().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-12-08 14:20:20 +02:00
Derek Foreman 64a3df086e backends: refactor transform string parsing
Most of the backends do their own parsing of transform strings, so let's
put that all in the same place (compositor.c/h)

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-19 16:46:56 +02:00
Pekka Paalanen 86b5396d89 Revert "input: don't send to clients key events eaten by bindings"
This reverts commit 5c11fc6fb7.

According to two input specialists, this was the wrong way:
http://lists.freedesktop.org/archives/wayland-devel/2014-November/018287.html

Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-19 13:45:38 +02:00
Frederic Plourde c336f06e70 compositor: Return a user-defined exit code
Currently, once we've reached our main's wl_display_run(), we always
return ret=EXIT_SUCCESS when weston terminates through wl_display_terminate.

This patch makes it possible to specify another return value by setting
prior to terminating Weston. This is useful for automated tests that want
to report test failures to the overlying testing infrastructure.

Signed-off-by: Frederic Plourde <frederic.plourde@collabora.co.uk>
[Pekka: fixed some tabs.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-18 15:55:42 +02:00
Giulio Camuffo 5c11fc6fb7 input: don't send to clients key events eaten by bindings
weston key bindings are supposed to eat the key events, and not pass it
on to clients, and indeed the wl_keyboard.key event is not sent. But
we must also not put the key in the keys array to pass to client with
the wl_keyboard.enter event, or else we may send the 'eaten' one too.
In the case of a key binding hiding a surface having the keyboard focus,
the shell may decide to give the focus to another surface, but that will
happen before the key is released, so the new focus surface will receive
the code of the bound key in the wl_keyboard.enter array.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-11 15:07:12 +02:00
Derek Foreman 0fd6d4ec53 compositor: make keep_buffer a bool
The comments already call it bool, so let's just make it one

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-11 09:32:02 +02:00
Derek Foreman 6ae7bc982f compositor: Refactor weston_output_mode_switch()
This breaks weston_output_mode_switch() into 3 functions:
weston_output_mode_set_native()
weston_output_mode_switch_to_temporary()
weston_output_mode_switch_to_native()

Differences from previous behaviour:
SET_NATIVE didn't set current_scale (now it does)
SET_TEMPORARY could set mode and scale independently - now it can't.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-05 13:15:13 +02:00
Derek Foreman 280e7dd918 cosmetic: replace boolean function return values with bool
For functions that test if something is true/valid and return a 1
or 0, it makes sense to switch to bool.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-04 12:45:49 +02:00
Pekka Paalanen 50b6747903 compositor: send error for surface role resets
With the more accurate definition of wl_surface roles in Wayland,
enforce the restriction: a role is always set permanently, and
attempting to change it is a protocol error.

This patch is based on Jasper's patch:
http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html

The difference in this patch compared to his are:

- send role errors on the interface whose request triggers it, not on
  wl_surface

- an interface could have several requests assigning different roles,
  cannot use wl_interface as the unique key; use an arbitary string
  instead

- ensure in window-manager.c that create_shell_surface() ->
  create_common_surface() is never called with surface->configure set,
  to avoid compositor abort

- use wl_resource_post_no_memory() where appropriate instead of
  hand-rolling it with wl_resource_post_error()

Ideally we would not add weston_surface::role_name field, but use
weston_surface::configure. At the moment this is not possible though,
because at least shell.c uses several different roles with the same
configure function. Drag'n'drop uses two configure functions for the
same role. The configure hook is also reset in several places,
which is not good for role tracking.

This patch overlooks the wl_surface roles assigned in privileged
extensions: screensaver, panel, background, lock, input panel.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08 13:16:30 +03:00
Pekka Paalanen 641307ca21 compositor-drm: deliver frame seq for feedback
Add 'msc' field to weston_output to maintain the refresh counter, and
use it in presentation_feedback.presented.

Make compositor-drm update the per-output refresh counter with the
values reported by DRM. If the DRM reported value jumps backwards,
assume it wrapped around once.

Other backends do not update weston_output::msc, and there
presentation_feedback will always deliver refresh counter as zero.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30 13:02:20 +03:00
Pekka Paalanen 133e439674 compositor: implement presentation_feedback
Implement the presentation.feedback request, and the
presentation_feedback protocol interface. Feedback information is
delivered to clients as the backend reports it, except the refresh
counter (MSC) which is always reported as zero.

Changes in v4:

* add 'flags' argument to 'presented' event without implementation

Changes in v5:

* remove the 'destroy' method implementation for feedback objects
  [Pekka Paalanen: do not leak struct feedback.]

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30 13:02:06 +03:00
Pekka Paalanen b5eedade36 compositor: set and use the presentation clock everywhere
Add presentation clock setters that verify the given clock actually
works. Offer an automatic choice of a software fallback clock, when a
backend has to always use clock_gettime() to approximate the
presentation time.

The DRM backend already queried the DRM about the clock id, just let the
DRM backend set the presentation clock from that.

For all other backends which do not get a timestamp from the driver,
call the software clock setter to choose a suitable clock.

Report the chosen clock via presentation.clock_id event to clients.

In finish_frame(), upgrade the argument from uint32_t milliseconds to
struct timespec which can accurately hold the presentation clock values.
This will be needed when weston_output_finish_frame() starts to send out
presentation_feedback.presented events.

While at it, replace gettimeofday() calls with clock_gettime() using the
chosen presentation clock, so we manufacture presentation timestamps
from the presentation clock when the gfx drivers cannot give us a proper
timestamp.

Rpi patch is more verbose due to not having the compositor pointer
available in rpi_flippipe_update_complete(). Explicitly carry the clock
id with flippipe so it is available in the thread.

Changes in v4:

* rpi debug build fix

v4 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30 11:37:02 +03:00
Derek Foreman d1be3128d0 cosmetic: Move WL_EXPORT out of header files
Most of the code only puts WL_EXPORT in .c files.  Remove the few
instances in header files.

If it's missing form the associated .c, put it there instead.
2014-09-22 10:16:38 +03:00
Giulio Camuffo 041a981a4e compositor: remove unused signal
The move_signal in weston_output isn't used, and not even initialized,
so anything trying to listen to it will crash on wl_signal_add().
Instead of it, the 'output_moved_signal' in weston_compositor is
used, so remove it.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-09 11:55:34 +03:00
Giulio Camuffo 6ef444d094 compositor: add a way to change the keyboard locks
This adds a function weston_keyboard_set_locks() which can be used to
change the state of the num lock and the caps locks, changing the leds too.
Only the evdev and libinput backends supports this, since it doesn't make
sense for embedded sessions.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-03 15:31:04 +03:00
Pekka Paalanen 9c1ac7b220 compositor: add weston_client_start()
weston_client_start() is a new wrapper around weston_client_launch(),
that does the process tracking on its own, and logs the process exit
status.

When users of weston_client_start() want to know when the process exits,
they should hook into the wl_client destroy signal. This works for cases
where the client is not expected to disconnect without exiting.

As wl_client destructor and the sigchld handler run in arbitary order,
it is usually difficult for users to maintain both struct weston_process
and a struct wl_client pointer. You would need to wait for both
destructor and handler to have run, before attempting to respawn the
client.

This new function relieves the caller from the burden of maintaining the
struct weston_process, assuming the caller is only interested in client
disconnects.

Cc: Boyan Ding <stu_dby@126.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2014-08-28 10:15:10 +03:00
Jonny Lamb 66a41a06e7 compositor: fetch repeat info from weston.ini 2014-08-15 15:39:47 +03:00
Giulio Camuffo 95ec0f95aa compositor: add a masking mechanism to weston_layer
this adds a mechanism to mask the views belonging to a layer
to an arbitrary rect, in the global space. The parts that don't fit
in that rect will be clipped away.
Supported by the gl and pixman renderer only for now.
2014-07-23 12:34:33 -07:00
Giulio Camuffo 412e6a59eb compositor: keep track of the weston_layer a weston_view is in
This introduces a new struct, weston_layer_entry, which is now used
in place of wl_list to keep the link for the layer list in weston_view
and the head of the list in weston_layer.
weston_layer_entry also has a weston_layer*, which points to the layer
the view is in or, in the case the entry it's the head of the list, to
the layer itself.
2014-07-23 12:34:33 -07:00
Jasper St. Pierre ccf48fb4f9 shell: Replace set_margin with set_window_geometry
Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.

What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.

In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.
2014-07-17 13:59:01 -07:00
Jason Ekstrand 7b98207667 Create a weston_surface_state structure for storing pending surface state and move the surface commit logic into weston_surface_commit_state
This new structure is used for both weston_surface.pending and
weston_subsurface.cached.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-07 09:12:57 -07:00
Jason Ekstrand e9d40e3ff5 Move weston_subsurface to after weston_surface
It makes more sense there.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-07 09:11:54 -07:00
George Kiagiadakis 8f9e87ff47 compositor: update the surface size when there is a size change without a buffer attach
This fixes at least the case where you want to do wl_viewport.set_destination
to resize the surface but without attaching new content in it.
2014-06-19 10:04:18 -07:00
Jasper St. Pierre ac985be8ce compositor: Remove the edges parameter from send_configure
send_configure was originally modelled after
wl_shell_surface::send_configure, which takes these arguments. However,
the X WM and xdg_surface::configure variants don't use these arguments.

We already store the resize edges for a surface while it's being
resized, so just use the saved state in the wl_shell_surface variant.
2014-04-30 20:53:15 -07:00
Jasper St. Pierre d67b52a501 compositor: Fix the documentation for surface->configure
It's called on commit, not on attach. Additionally, correct the
interface name to be wl_surface, not surface.
2014-04-30 20:48:55 -07:00
Kristian Høgsberg e5c1ae9368 xwayland: Set decoration margin for xwayland windows 2014-04-30 16:28:41 -07:00
Jonas Ådahl 1679f232e5 libinput: Forward frame events to clients
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77353

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-04-21 16:03:28 -07:00
Kristian Høgsberg f03a04afac compositor: Add create_surface_signal
This signal is emitted when a client creates a surface, not for internal
surfaces.
2014-04-06 22:22:04 -07:00
Jason Ekstrand 9fc7151991 Add possible capabilities CURSOR_PLANE and ARBITRARY_MODE
The CURSOR_PLANE capability indicates that the backend has a concept of a
cursor plane and can handle a cursor without compositing.  This is currently
only advertised by the DRM backend.

The ARBITRARY_MODE flag specifies that the backend is capable of switching to
virtually any resolution.  This is currently only advertised in the RDP
backend.  While it's a bit buggy right now, it should be capable of this.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:25:27 -07:00
Jason Ekstrand a4ab5422e9 Add a signal for when a seat updates its capabilities
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:24:42 -07:00
Giulio Camuffo e9022e79c8 compositor: add an exported function to take a screenshot of an output
This allows other screenshooter protocols to use the same code to copy
the screen to a buffer.
2014-04-02 11:27:42 -07:00
Pekka Paalanen 0b4c535d73 protocol,compositor: split wl_viewport setters
Bump wl_scaler and wl_viewport versions to 2. Add new requests
wl_viewport.set_source and .set_destination, which are meant to replace
wl_viewport.set request.

Now a client can set and unset just one of source rectangle and
destination size. Define the semantics when one of these is unset.

Implement these semantics changes in compositor and pixman renderer.
GL-renderer does not need changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:40 -07:00
Pekka Paalanen f0cad4844c compositor: replace weston_buffer_viewport::viewport_set
Remove the explicit boolean variable, and use illegal width to denote
"not set".

Split the boolean into two, so we can later start having buffer.src_*
and surface.* set or not set independently. This may become useful when
the wl_viewport interface is changed to allow modifying them separately.

At the moment, both buffer.src_width and surface.width conditions are
always in sync.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:40 -07:00
Pekka Paalanen 952b6c8004 compositor: reorganize struct weston_buffer_viewport
Queueing in the Presentation extension requires splitting the viewport
state into buffer state and surface state. To conveniently allow
assigning only one, the other, or both, reorganize the
weston_buffer_viewport structure.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:40 -07:00
Kristian Høgsberg db1fccb3d8 input: Send leave and enter pair when the surface moves under the cursor
The client needs to know that the pointer is at a different position in
its surface.  We can't send motion as that corresponds to the pointer
actually moving.  Leaving the surface and entering at the new position
is a better semantic match and doesn't correspond to pointer motion
or user input.

https://bugs.freedesktop.org/show_bug.cgi?id=71927
2014-02-18 13:47:41 -08:00
Kristian Høgsberg e11ef64534 compositor: Drop core ping_handler callout
This was always a little iffy.  At least it could have been a signal,
but we now have focus signal, so lets just use that.  We lose
the ability to detect unresponsive clients at key event time, but we
could add that back by adding a key_signal.
2014-02-11 16:35:22 -08:00
Ander Conselvan de Oliveira c94d6229dc compositor: Move view repositioning logic into shell
Remove the listener for output destroy from weston_view and instead
iterate views owned by the shell in its own output destroy listener.

This simplifies the code a bit since keeping the view listening for the
destroy on the right output was a bit complicated. This also removes the
function pointer output_destroyed from weston_view. The only user for it
was desktop shell, but now this is all handled in shell.c.
2014-02-05 17:36:00 -08:00
Ander Conselvan de Oliveira a8a9baf873 compositor: Remove weston_output::move_signal
Since that signal is per output, it is necessary to track in which
output a view is in so that the signal is handled properly.

Instead, add a compositor wide output moved signal, that is handled by
the shell. The shell iterates over the layers it owns to move views
appropriately.
2014-02-05 17:32:35 -08:00
Ander Conselvan de Oliveira f84327aef2 input: Remove exported function weston_pointer_verify()
Instead, add a compositor signal that an output has been destroyed and
handle that case locally in input.c.
2014-02-01 01:36:05 -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
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