The editor will now insert new lines and tabulations when
pressing the corresponding keys on the virtual keyboard.
The Up and Down arrows can be used to navigate through
lines.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77496
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
If more than one input device maps to the new output, then we need
to map all devices to that output... not just the first device.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77576
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
If an input device wants to map to an output that does not
exist, then just map it to the first output.
Also, if a device is mapped to an output that gets unplugged then
it gets default mapped to the first output in the output destroy
listener. However, the original output destroy listener needs to
be removed before adding the new listener for the first output,
otherwise the list gets corrupted.
Later if the other output is plugged back in, we remap the device
to it. In that case, we should remove the destroy listener for
the first output.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77341
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
We need to break after handling LIBINPUT_EVENT_TOUCH_UP otherwise
we fall into the default case and end up logging that the event
is unknown and then return the wrong "handled" result.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77577
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Look for WESTON_LIBINPUT_LOG_PRIORITY environment variable. If
it exists then use it to set the libinput log priority.
Otherwise, don't set the priority and get whatever libinput's
default priority is.
Setting WESTON_LIBINPUT_LOG_PRIORITY=0 allows us to log which
input devices are detected at Weston startup and makes it a
little more consistent with Weston's original evdev input setup
log messages... and useful for debugging and testing.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
We now dynamically move the input panel (i.e. virtual
keyboard) surface to the output containing the currently
focused surface.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71015
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Commit 58e15865 changed the parameters for udev_get_seat_by_name() to
receive a struct udev_input. However, when this gets called from
create_output_from_connector() during initialization, the input struct
is not yet initialized, leading to a crash. Previously, that function
would take only a pointer to the compositor.
This patch fixes the crash by initializing input before creating any
outputs.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77503
The "symbols" modifier key of weston-keyboard is no longer
inactive, but will provide an additionnal layout with
numerals and special characters.
Fix the Arabic keyboard, which was rendering out of the
bounds, and now use the Arabic IBM PC keyboard as a
reference for its standard and new symbols layouts.
https://bugs.freedesktop.org/show_bug.cgi?id=71757
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
It is possible that an input panel will be shown quickly, hidden and
shown again, before the animation for the first appeareance finished.
In that case, another animation would be created and the effect of the
two combined could cause the panel to not appear in the screen.
This patch fixes this by keeping a reference to the previous animation
and deleting it when a new one is created.
The position for the slide animation was calculated assuming the value
of the spring was always between 0.0 and 1.0. Commit 3a869019 broke
that assumption, and the result was that the panel would be positioned
at an invisible part of screen. Since there would be no output repaints
scheduled, the result of the animation would only be seen if something
else triggered a repaint (such as a mouse cursor movement).
This patch changes the values for the slide animation's spring to range
between 0.0 and 1.0, thus fixing the position of the panel and the lack
of scheduled repaints problem.
https://bugs.freedesktop.org/show_bug.cgi?id=77347
All the animations override at least one parameter of the spring that
is set during the creation of the animation. Some need to do the whole
setup again.
This patch changes the initialization of a view animation to a three
step process. First, the animation is created. Then the caller sets up
the spring and calls weston_view_animation_run() to apply the effect of
the animation for the first animation frame.
bad-buffer-test is FAIL_TEST and every assert() (or even SIGSEGV signal)
make it pass. It shouldn't be so for example when assert() is invoked
when a client couldn't connect to display.
Make sure that only relevant asserts make the test pass
and the other make it fail (by returning 0)
We now carry the shell_client around with each shell_surface. This is much
more reliable than tacitly assuming that there is only one wl_shell or
xdg_shell instance bound to a particular wl_client. In particular, weston
would crash when a client bound to both wl_shell and xdg_shell even if it
only ever used one of them.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
It takes the stride in bytes, not pixels. The bug was hidden when using
va intel-driver 1.2.1 because it would ignore the stride from user and
set the surface state in a wrong way.
https://bugs.freedesktop.org/show_bug.cgi?id=77495
Previously, the repositioning logic would iterate the compositor's list
of layers and move the views on those layers. However, that failed in
two different ways: it didn't cover hidden workspaces and crashed when
the display was locked.
This patch changes the logic to explicit iterate over all the layers
owned by the shell. The iteration is done through a helper function,
shell_for_each_layer().
https://bugs.freedesktop.org/show_bug.cgi?id=76859https://bugs.freedesktop.org/show_bug.cgi?id=77290
When a fullscreen surface gets the maximized state, the function
reset_surface_type() is called and that causes unset_fullscreen() to be
called. That function would set the value of shsurf->fullscreen_output
to NULL. However, since the surface still has the fullscreen state, it
will be configured as a fullscreen surface again, and an attempt to
access that field would cause the compositor to crash.
Fix the crash by keeping the value of fullscreen_output around after
unset_fullscreen(). This is safe since the value is only used when a
surface has the fullscreen state and is replaced on a new request to
make the surface fullscreen.
https://bugs.freedesktop.org/show_bug.cgi?id=76867
The timer was left running after the screensaver was terminated. When
it triggered, a fade out that would in turn cause the screen to be
locked was started. Since that could happen without the compositor
emitting the idle signal, there would be no wake signal to make the
shell show the lock screen, so the system was left unresponsive
until the idle signal actually triggered.
https://bugs.freedesktop.org/show_bug.cgi?id=70923
Before commit 2f5faff7f9 when the compositor is locked it would
reset the keyboard focus on all of the seats as part of pushing the
focus_state. This was removed because it now always keeps track of the
focus_state in the workspace instead of waiting until the state is
pushed. However this had the side effect that the active surface would
retain focus when the compositor is locked. This patch just makes it
explicitly set the keyboard focus to NULL on all of the seats when
locking. This will be restored based on the workspace's state when
unlocking.
https://bugs.freedesktop.org/show_bug.cgi?id=73905
The focus_state list on a workspace only contains entries for seats
which have a keyboard focus on that workspace. For workspaces that
have no surfaces the list will be empty. That means that when a
workspace with no surfaces is switched to it would previously leave
the keyboard focus unaffected and you could still type in the surface
on the old workspace.
This patch makes it instead reset the keyboard focus to NULL for seats
without a focus_state. It does this by temporarily stealing the
compositor's list of seats while it iterates the focus_states. After
all of the focus states have been processed any seats remaining in
this temporary list have their focus reset.
https://bugs.freedesktop.org/show_bug.cgi?id=73905
Commit c85f1d45 caused the move of an unresponsive surface to be no
longer possible, since the grabbed flag would prevent the move grab
to start while the busy grab was still active.
weston-terminal uses RLE (U+202B) as a placeholder of the right half
of a double width character. However, not all fonts include this
glyph and cairo renders it as .notdef (glyph index 0) in that case.
There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.
The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h
Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
This fixes :
- leaking the mask used to simulate transparency ;
- code style (definitions moved up, use of brackets) ;
- applying an opaque region when transparency is
wanted (shound not happen).
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
If the client attaches a new SHM buffer with a different format from a
previous one then we ought to trigger a full upload so that GL can
allocate a new texture. Otherwise Weston would technically be doing
invalid operations because it would call glTexSubImage2D with a
different format from the one specified in glTexImage2D. Presumably it
would also mean GL would have to convert the buffer as it copies the
sub-region in which isn't ideal.
This patch makes it decide the GL format when the buffer is attached
instead of when processing the damage and it will set
needs_full_upload if it is different from what it used before.
The subsurface widgets on the nested example aren't using Cairo to
render so we should turn it off to prevent the toy toolkit from
creating a redundant extra surface for it. This is particularly
important since Mesa commit 6c9d6898fdfd7e2 because the surface that
the toolkit tries to create is zero-sized and that patch prevents that
from working. This was causing weston-nested to crash.
When the alpha channel of a surface is changed and the surface
refreshed, pixman renderer will now apply a mask corresponding
to the alpha channel value.
This allows visual effects like shell fade in, shell fade out,
window switching, to work when using pixman renderer.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
The shell_destroy_shell_surface function only set the backing resource to
NULL, leaving an unusable surface in the popup_grab list until the surface's
fading animation finished and it could be freed. This caused a segfault if
the shell tried to forcibly break the grab during that time interval due to
the compositor losing the keyboard focus.
https://bugs.freedesktop.org/show_bug.cgi?id=77072
Previously when uploading SHM data we would initialise the texture
with glTexImage2D and NULL data when the buffer is attached. Then if
the GL_EXT_unpack_subimage extension is available we would always use
glTexSubImage2D to upload the data. The problem with that is that the
first glTexImage2D was always setting the internal format to
GL_BGRA_EXT and then if a 16-bit texture is used we would later call
glTexSubImage2D with a data format of GL_RGBA. Under GLES2 the
internal format must always match the data format so this is
technically invalid.
This patch makes it so that it always calls glTexImage2D when flushing
the damage for the first time. That way it will use the right internal
format and we don't need to call glTexImage2D with NULL data.
https://bugs.freedesktop.org/show_bug.cgi?id=75251
Ensure, that the resulting surface size is at least 1x1, even when
destination size is not set and source size is zero. Previously this
lead to zero surface size.
This can still happen due to wl_viewport.set(#, #, 0, 0, #, #) followed
by wl_viewport.set_destination(-1, -1).
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Let's make the source and destination size rules consistent: neither can
have zero, {-1, -1} disables it, and other negatives are not allowed.
The sanity of allowing zero sized source rectangle as debatable. Now the
minimum becomes 1/256x1/256, and with output_scale the actual samples
may be even smaller. That should be enough.
On not allowed values, raise a protocol error. This should help catch
bugs in clients that accidentally send garbage values.
The old wl_viewport.set request remains the same, and can still produce
zero sized source rectangle.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When adding a subsurface (to display a tooltip) in toytoolkit,
we now get the parent window surface type (SHM or EGL) and
define the new surface type as the same.
This fixes crashes with tooltips in cases like having
Cairo-EGL available but running the X11 compositor.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This adds a plugin called screen-share.so. If the screen-share.so module
is imported, it will add the CTRL+ALT+s keybinding to start a screen
sharing session. If you press CTRL+ALT+S, weston will spawn another copy
of weston, this time with the RDP backend, and mirrors the current screen
to it and adds any seats from RDP as aditional seats. The current screen
is defined as the one with the mouse pointer. Currently the CTRL+ALT+s
keybinding is hardcoded as the only way to activate screen sharing. If, at
some point, shells want more control over the screen sharing process, the
API's should be easy to update and export to make this possible.
For security, the command and path to weston is currently hard-coded. It
would not take much aditional code to make this configurable or to allow a
shell to launch other screen-sharing programs. However, handling those
security issues is outside the scope of this patch so it is hard-coded for
now.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This patch adds an option to the RDP compositor to disable
desktop resizes initiated by RDP peer. The current behaviour
is that if an incoming RDP peer suggests a resolution that is
not the current one, a mode_switch() is done and the desktop is
resized to that new resolution. This new flag allows to disable
that behaviour. If the flag is set, the new behaviour is that the
RDP peer will be instructed to resize to the size of the desktop.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
On startup weston now detects the WAYLAND_SERVER_SOCKET environment
variable. If found, weston does not create the display like normal, but
instead directly adds a client corresponding to the given fd. This,
combined with the fullscreen shell, allows a process to spawn weston and
use it as a backend.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>