Commit Graph

31 Commits (88829de9dd7007e8c5b57dd50815ad848f23ae53)

Author SHA1 Message Date
Vlad Zahorodnii 88829de9dd wayland: Refactor creation of input panel clients
This change introduces a shell integration class for input panel
surfaces. This effectively breaks the direct dependency between our
virtual keyboard component in kwin and the input_panel protocol,
which means that an input method server could use the layer-shell
protocol instead of the input_panel protocol.
2020-09-04 13:08:34 +00:00
Bhushan Shah 31e881d0e4 virtualkeyboard: close keyboard when focused text input goes away
Currently when focused text input goes away due to either crash or
explicit user action, keyboard leaves hanging, instead close it up.
2020-09-03 09:52:25 +00:00
Bhushan Shah 9fc09b9a32 virtualkeyboard: update the input panel state when textinput requests it
v1, v2 and v3 protocols supports the update/commit state methods for the
text-input protocol, use it to commit the input method state
2020-09-03 09:08:54 +00:00
Bhushan Shah f93af91327 virtualkeyboard: remove unused event overrides
Previously qtvirtualkeyboard was integrated weirdly so that it was
acting as the focus object and proxy for input methods, however now that
we support proper input methods, this code is totally unused and it is
confusing to have it here, so just drop it

See: f26f2fe181 for the reference of the
code deleted.
2020-09-03 09:08:54 +00:00
Bhushan Shah 97c0270cd3 Send surroundingText and content hints/purpose to inputmethod
Previously we were either sending out this information to InputMethod of
the QApp (i.e kwin itself) which is no longer case since we switched to
using the proper wayland protocol instead of the qtvirtualkeyboard
inside the kwin.

This fixes the issue with the weston-keyboard at least that in field
which accepts digits it shows the keyboard with digit layout. I still
have some issues with maliit-keyboard but that might be bug on the
maliit-keyboard side.
2020-09-03 09:08:54 +00:00
Marco Martin 97f4712f29 Fix size restore upon keyboard close in XdgSurfaceClient
in XdgSurfaceClient setFrameGeometry is async,
so we can't rely on it having the final value immediately.
make setVirtualKeyboardGeometry a virtual.
in the implementation on setVirtualKeyboardGeometry
use requestedFrameGeometry() instead of frameGeometry()
2020-09-01 08:58:46 +00:00
Aleix Pol c7e5680d63 Hide the keyboard if we type using the physical keyboard 2020-08-18 10:55:21 +00:00
Aleix Pol 3733e3e77f Remove embedded implementation of the Virtual Keyboard 2020-08-18 10:55:21 +00:00
Aleix Pol 7aabd45df9 Integrate input-method-unstable-v1 2020-08-18 10:55:21 +00:00
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Aleix Pol 3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
Vlad Zahorodnii be759b7d33 Use AbstractClient instead of XdgShellClient wherever possible
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan: Existing tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27778
2020-03-04 09:57:13 +02:00
Tobias Fella 6fe7f9281a Make the virtual keyboard disappear when locking the screen
Summary: Previously, the virtual keyboard did not close when locking the screen, instead blocking part of the lockscreen while not actually working. This patch actually makes the keyboard close before locking

Test Plan: Open virtual keyboard -> Lock Screen -> No keyboard shown

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27172
2020-02-06 10:34:03 +01:00
Vlad Zagorodniy 168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Bhushan Shah d7cfd0012a Revert "Load the keyboard on-demand"
This reverts commit 5c39795b88.

This unfortuntaely introduces the regression on the phone where there's
multiple bugs preset,

- Keyboard can no longer be closed using close button, or removing
  focus.
- Opening keyboard makes application get no input events, making it look
  like it is crashed/stuck or hung.

I failed to reproduce this bug on desktop unfortunately.

CCMAIL: Aleix Pol <aleixpol@kde.org>
2019-08-09 11:40:22 +05:30
Aleix Pol 5c39795b88 Load the keyboard on-demand
Summary: No need to load the keyboard view as soon as wayland starts. It's not a simple UI and it often will be unused.

Test Plan: played with the keyboard, still worked

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22430
2019-08-01 17:21:00 +02:00
Aleix Pol 1f3fd63790 Fix crash on closing
Test Plan: Start in windowed mode, close. Doesn't crash anymore.

Reviewers: #plasma, #kwin, mart

Reviewed By: #plasma, #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19919
2019-03-20 17:35:14 +01:00
Marco Martin 6bc2ddd56a virtualkeyboard: resize the focused window to make room for the keyboard
Summary:
alternative approach: try to resize the winidow to make room for the keyboard.
the new input wayland protocol doesn't have anymore the overlap rectangle (and it would not be going to work with qwidget apps anyways)

in the future will probably be needed anextension to the input protocol v3 which partially gets back this, tough window resizing is needed regardless

what's missing: the resize should be "temporary" and the window should be restored to its previous geometry when the keyboard closes

Test Plan: tested with test QML code

Reviewers: #plasma, #kwin, bshah, graesslin, romangg, davidedmundson

Reviewed By: #plasma, #kwin, romangg, davidedmundson

Subscribers: nicolasfella, mart, kwin, davidedmundson, graesslin

Tags: #kwin

Maniphest Tasks: T9815

Differential Revision: https://phabricator.kde.org/D18818
2019-03-20 11:05:06 +01:00
Aleix Pol 9e42ff2f48 Virtual Keyboard SNI: Improve text and usability
Summary:
This way we can see from the system tray its state.

CCBUG: 405397

Reviewers: #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19898
2019-03-19 21:57:59 +01:00
Bhushan Shah 533f43ad02 Make it easier to debug the virtualkeyboard
Summary:
Provide the important debug messages which can be used to debug why
virtualkeyboard is not starting.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17454
2018-12-10 16:28:13 +05:30
Martin Flöser 8c2b2faf9d Add DBus protocol to virtual keyboard
Summary:
This change adds a DBus API to query whether the virtual keyboard is
currently enabled and provides DBus methods to request that the virtual
keyboard gets enabled/disabled. This is useful for e.g. providing a
Plasmoid or for convertables where the tablet mode needs to be enabled.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8166
2017-10-19 17:59:19 +02:00
Martin Flöser a17c85a9ea Support mapping QKeyEvent to xkb_keysym_t
Summary:
This is needed in virtual keyboard and also used KKeyServer so far. With
this change it is moved to new API provided in Xkb. The new translation
map is now also used for the direction from Qt::Key +
Qt::KeyboardModifier to xkb_keysym_t.

New implementation is supported by a new test case covering the same
combinations as in the existing direction.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7356
2017-09-19 19:09:17 +02:00
Martin Gräßlin 16647c3a3c Require Qt 5.7 and remove pre-5.7 code
Summary:
Increases minimum Qt version to 5.7. This allows to drop the pre-5.7
virtual keyboard and various ifdefs for now unsupported versions.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4485
2017-02-07 20:43:19 +01:00
Martin Gräßlin b636feb8eb Disable standard actions on VirtualKeyboard SNI
Summary:
We don't want a context-menu entry to quit KWin.

T5168

Test Plan: No more context menu shown.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D4299
2017-01-27 16:03:11 +01:00
Martin Gräßlin 9581f23ed8 Translate Qt key events through the unicode text with xkbcommon
Summary:
KKeyServer does an incorrect translation to keysyms: it always
translates to the uppercase variant.

This change makes the default go through xkbcommon and tries to get
the keysym from matching the unicode representation. E.g. an "a" is
then recognized as the lower case a, and an "A" as the uppercase one.

Only if the translation through text fails we pass back to KKeyServer
which does a reasonable translation for non-text symbols.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2471
2016-08-18 07:55:27 +02:00
Martin Gräßlin b3d41ee0f3 Add missing break in virtualkeyboard.cpp 2016-08-09 16:09:22 +02:00
Martin Gräßlin 19b5c2e418 Make virtualkeyboard a frameless window
We don't want that KWin tries to add a window decoration to it.
2016-08-09 15:51:06 +02:00
Martin Gräßlin 4c6c4e6717 [wayland] Always have a keyboard on the Seat
Summary:
This is a workaround for QTBUG-54371 resulting in QtWayland never
requesting the input methods panel without having keyboard focus.
Thus also the virtual keyboard is not working.

With this change we go back to always announcing a keyboard and
binding the virtual keyboard to whether we don't have an alpha-numeric
keyboard instead of whether there is a keyboard on the seat.

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2343
2016-08-03 11:27:00 +02:00
Martin Gräßlin 13adf9609f Fix broken build
Sorry, forgot to adjust the enum naming to latest round of changes
in KWayland.
2016-06-02 11:54:14 +02:00
Martin Gräßlin f26f2fe181 Integrate QtVirtualKeyboard into KWin/Wayland
Summary:
The idea is to have KWin provide a virtual keyboard. To support this
KWin uses the QT_IM_MODULE qtvirtualkeyboard and makes sure that the
QPA plugin loads it.

KWin has a new class VirtualKeyboard which acts as the focus object and
the "proxy" for input methods. The QPA plugin ensures that this is the
focusObject, so that all input method related events are sent to this
class. From there it will be possible to delegate to other applications
through the Wayland interfaces.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1638
2016-06-02 11:26:53 +02:00