Add a wl_seat argument to the activate and deactivate requests of
text_method.
On activation a text_model gets assigned to the input_method of the
wl_seat specified in the activate request.
In cases where we know the surface bounding box doesn't change in the
next frame, we can limit redraws to only the outputs the surface is
currently on. We could do even better by forcing the transform
update so we know where the surface will be in the next frame, but
this is a much simpler first step.
When the entire output is transformed or we're capturing the output
for screenshot or video, disable all output specific overlays
(drm planes, hw cursors etc) and move all surfaces into the primary
plane.
When we analyze and accumulate damage prior to repainting, we need to
accumulate damage per plane, so that whatever damage a surface
contributes is accumulated in the plane that it's assigned to. Before,
we would always accumulate damge in the primary plane, which caused
repaints in the primary plane whenever a surface in a sprite or
framebuffer was damaged. Eliminating this repaint is a big win for
cases where we pageflip to a client surface or use a sprite overlay.
This also prepares for fixing the missing cursor updates, since we
now track damage to the cursor surface in a dedicated sprite plane.
In the wl_seat conversion, struct wl_touch got fields for the focused
surface and the client resource for the input device being focused.
However, the conversion was incomplete: the old fields
weston_seat::touch_focus* we still used by the event dispatching code,
but the new code never set them. Therefore no touch events were ever
sent.
From weston_seat, remove the fields touch_focus, touch_focus_listener,
touch_focus_resource, and touch_focus_resource_listener. They are
replaced by the corresponding fields and listeners from struct
wl_touch.
While doing this, fix touch_set_focus().
If touch_set_focus() was called first with surface A, and then with
surface B, without being called with NULL in between, it would corrupt
the destroy_signal list. It was equivalent of calling wl_signal_add()
for different signal sources with the same listener without removing in
between.
Now, touch_set_focus() first removes focus and listeners, and then
attempts to assign focus if requested. If the target client has not
subscribed for touch events, the touch focus will now be NULL.
Before this patch, the touch focus was left to the previous surface.
NOTE: this patch depends on the patch "server: add lose_touch_focus()"
for Wayland.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When we hit a segv, it's often the case that we might crash again in
the attempt to clean up. Instead we introduce a minimal restore callback
in the backend abstraction, that shuts down as simply as possible. Then
we can call that from the segv handler, and then to aid debugging, we
raise SIGTRAP in the segv handler. This lets us run gdb on weston from
a different vt, and if we tell gdb
(gdb) handle SIGSEGV nostop
gdb won't stop when the segv happens but let weston clean up and switch vt,
and then stop when SIGTRAP is raised.
It's also possible to just let gdb catch the segv, and then use sysrq+k
followed by manual vt switch to get back.
Simplify RGB shader code and split off common code that could be reused.
This is preparatory work for YUV shaders.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Make weston_surface::texture and ::surface an array, while keeping
[0] for RGB surfaces.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
weston_compositor_init is always called late because most
implementations can't initialise GL until fairly late in the game.
Split it into a base version with the same name, followed by
weston_compositor_init_gl which can be called later on.
This simplifies compositor-wayland, which no longer needs a separate
global handler just for wl_seat.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
notify_modifiers will now synchronise Weston's internal state with the
XKB state, and send a modifier event if necessary. This eliminates the
need for update_modifier_state to have a return value at all.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
If update_state is true, then notify_key will continue to call
xkb_key_update_state to update the local state mask, as before this
commit. Otherwise, it will rely on the compositor to manually update
the state itself, for nested compositors.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
X11 has a set of eight modifiers which we want to represent. Cache
their indices when we create a weston_xkb_info, so we can use this from
compositor-x11 to keep the state synchronised exactly between the host X
server and a nested Weston instance.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
When the focus changes, wl_keyboard_set_focus (and, as an added bonus,
wl_pointer_set_focus) will now send wl_keyboard::modifier events for us
if we store the modifier state in the right place, so we don't have to
worry about that anymore.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This is the point where we have just finished rendering the new scene
but before we swap it to the front buffer. At this point, the
output->previous_damage region exactly corresponds to what was just
renders, as compared to previous frame.
We start tracking which hardware plane a surface is displayed on, which
lets us avoid generating damage when a hardware overlay/cursor is moved
around.
EGLDisplay is helpfully typedeffed as void *, which means that you won't
get conflicting-pointer-type warnings if you accidentally confuse it
with weston_compositor::wl_display. Rename it to make it more clear
which display you're dealing with, and also rename compositor-wayland's
parent.display member to parent.wl_display.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
We use the selection signal to get a callback when somebody sets a
selection (including the X server proxy) and then copy the contents
of the first mime type. If the selection is cleared (when the client
dies), we set a new selection with that contents.
These keymap events communicate the keymap from the compositor to the
clients via fd passing, rather than having the clients separately
compile a map.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>