Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).
Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add a request to be called by the client when the word currently being
composed is tapped by the user. Input methods often use this information
to offer more word suggestions to the user.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
The lock hook in desktop-shell only changes the DPMS state the second
time it is called, because during the first time it launches the
screensaver and wakes the compositor again when the screensaver surface
is configured. However, if the screensaver fails to launch, the output
is left in an enabled state, even thought there's no content being
displayed on the screen.
Fix this by disabling the outputs when the screensaver dies if the
shell is still locked.
https://bugs.freedesktop.org/show_bug.cgi?id=60084
Some window managers (kwin at least) don't give us our final fullscreen
size before map_notify. Currently we stop waiting for configire_notify
once we get mapped and in case of kwin that means we don't receive our
fullscreen size configure_notify. With this patch, if we don't get a
configure_notify before map_notify, we just wait for the first one after
map_notify and hope that's our size.
https://bugs.freedesktop.org/show_bug.cgi?id=60608
We were setting up the opaque region to be the window size and then
intersecting with the opaque rectange that's always contained in the window
rectangle. Just initialize to the opaque rectangle.
This must be the last regression from the surface commit changes. We
need to set the pending.input region, otherwise the region will be
overwritten on commit.
https://bugs.freedesktop.org/show_bug.cgi?id=60610
When a surface in deemed unresponsive and we trigger the busy cursor, it's
no longer possible to rotate the surface. This is clearly unacceptable.
This patch adds handling of right clicks to the busy grab so that we can
continue to rotate a surface even if the client is sleeping.
https://bugs.freedesktop.org/show_bug.cgi?id=60609
Ideally the shell would send an unmaximize event to the client when
we try to move a maximized window, but for now, let's just prevent
moving maximized windows.
https://bugs.freedesktop.org/show_bug.cgi?id=56296
If our surface has width and height set to the same dimensions as the output
then we can bypassing the scale factor calculation and addition of the
transformation.
The use case that led to this optimisation is the playback of video using
gstreamer-vaapi with the "scale" method. The video is the same dimensions as
the output (1080p.)
This introduces the function widget_cairo_create().
Instead of directly referencing surface->cairo_surface, use the function
widget_cairo_create(), which will create the cairo_surface as necessary,
and just returns a Cairo drawing context. Also fix window_get_surface()
similarly.
Now we can go through idle_redraw() without always creating Cairo
surfaces and committing them. This will be useful with sub-surfaces,
where repainting one sub-surface does not need to force the repaint of
all surfaces of a window.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Menu and tooltip redraw functions were using the surface size directly.
For consistency, make them use the widget size instead, it is the same.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Widgets should be rendering to a cairo_surface for a particular
wl_surface, just like buffers are per surface.
window_flush() has a change in behaviour: it will now send
wl_shell_surface.set_toplevel also without a cairo_surface to be
attached. This shouldn't change anything in practice.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
So that given a widget, we can access the surface specific data, like
buffers, and input and opaque regions.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
They are per wl_surface state.
The frame widget is always on the main surface, since it can be created
only for the window. That is why frame_resize_handler() can simply
assume that the surface is the main_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Repaint and resizing widget recursions must start from the root widget
of each (sub-)surface, so that buffers and regions get initialized
correctly. Make it easier by moving the widget field from struct window
to struct surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
These are surface specifics, since buffers are surface specific.
SURFACE_HINT_RESIZE is moved together to the other SURFACE_* flags, so
that surface_create_surface() would not need two flags arguments.
struct toysurface::prepare vfunc checks for SURFACE_HINT_RESIZE, and
egl_window_surface_create() and shm_surface_create() check for the
non-HINT flags.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Fields 'allocation' and 'server_allocation' are surface specific. Fields
'saved_allocation', 'min_allocation', and 'pending_allocation' are
window specific, and will not be moved.
Field 'toysurface' is naturally surface specific, since it provides the
backing storage for the wl_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Struct window has many fields that are directly related to the
wl_surface, more than to the window as a whole. When we start composing
a window from several wl_surfaces, these fields need to be per
wl_surface, not per window.
Start separating such fields from struct window into struct surface by
moving the wl_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Handle the case when we the compositor somehow migrates from requiring
double buffering into working on single buffering, so we release the
extra shm buffer.
Currently, I do not think this can happen in practice, but in the future
it may happen with sub-surfaces.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Check for errors in the first wl_display_dispatch() call. Otherwise
doing something silly like
$ WAYLAND_SOCKET=999 ./clickdot
will segfault.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Make them explicitly mention EGL, otherwise one can easily think that
"failed to initialize display" refers to Wayland display.
Also explicitly mention falling back to wl_shm. I tested this with a
LD_PRELOAD trick that overrides eglBindAPI and makes it fail.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When fading in, if a repaint was triggered after a call to
weston_compositor_fade() but before the first call to fade_frame(),
the fade surface wouldn't be drawn because its alpha channel wasn't
initialized properly.
weston-screenshooter is a helper binary that weston launches to write the
screenshot to disk. If somebody tries to launch it by hand, print a
warning and mention the screenshot keybinding.
We can now handle fullscreen X windows. X clients request to go fullscreen
buy sending a _NET_WM_STATE client message to the root window. When that
happens we call into the shell interface and asks the shell to make the
surface fullscreen. The shell will then resize the window, which causes
the X wm to configure the X window appropriately.
Make sure we ignore configure requests from fullscreened clients and send out
the synthetic configure notify as required in that case.
Finally, inspect _NET_WM_STATE before mapping so we can handle initial
fullscreen correctly.
Tests especially, that attach-attach-commit does not result in a release
of the first buffer.
Also tests, that the old buffer is released when a new buffer has been
attached, committed, and displayed (frame callback).
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>