Commit Graph

18174 Commits (27951dc9e7c433c744a019382707122b4d0ec892)

Author SHA1 Message Date
Aleix Pol 27951dc9e7 Only define PipeWire_FOUND if it's found 2020-07-24 02:06:45 +02:00
David Edmundson 83aa8dccd2 [virtualdekstops] Drop multi-head from VirtualDesktopManagement
Kwin's VirtualDesktop saved a different configuration per X screen. This
messes up with a recent refactor of our startup as now we load
virtualdesktops before the X11 screen number is set and we load from the
group "Desktops-screen--1" then save to another place.

For a wayland session it doesn't make sense to have such a strong X
tie-in. We may as well just tidy this up.

Multihead has been deprecated for a decade. There is absolutely no way
Plasma supports it. Worst case if someone magically is using mutlihead
they just get syncronised virtual desktops.

BUG: 424571
2020-07-23 22:33:14 +00:00
Aleix Pol 9438a2e1b1 Disable screencasting if there's no pipewire 0.3
Hopefully fixes the CI
2020-07-23 23:33:30 +02:00
Vlad Zahorodnii e7b8a5ad5e Remove remote-access leftovers
We've switched to PipeWire for screen casting \o/.
2020-07-23 18:19:49 +03:00
Aleix Pol 4ddefd37bd screencasting: Remove deprecated RemoteAccessManager interface
In favour of zkde_screencast_unstable_v1
2020-07-23 13:14:31 +02:00
Aleix Pol 02042908aa screencasting: implement wayland output streaming for egl and wayland backends 2020-07-23 13:14:31 +02:00
Aleix Pol 42e543c5b2 screencasting: implement intefraces to create dmabuf textures 2020-07-23 13:14:22 +02:00
Aleix Pol 38eb72efe3 screencasting: integrate zkde_screencast_unstable_v1
Includes a PipeWire implementation that will send the relevant streams
to the processes that need them.
2020-07-23 13:14:22 +02:00
Aleix Pol 27ea1b9527 screencasting: Expose necessary information to implement efficient screencasting 2020-07-23 13:14:22 +02:00
Aleix Pol 57e19874b7 drm_fourcc.h: only typedef uint32_t on the platforms it's needed
On linux we have it defined on some headers. If we do hardcode it
ourselves build will fail when linux/types.h is included afterwards.
2020-07-23 13:14:22 +02:00
Aleix Pol 4c267c261e Adapt to changes in the PlasmaWindowManagement interface 2020-07-23 13:14:22 +02:00
Aleix Pol 29a2b2a355 Make it possible to specify KWin::GLTexture mutability
Some features will rely on it and complain that GLTexture decided to use
glTexStorage
2020-07-23 13:14:22 +02:00
Aleix Pol ff65bec92c Introduce a GLTexture::toImage helper class 2020-07-23 13:14:22 +02:00
Aleix Pol 1ef90d9c90 Add API to easily find Toplevels from their internal Id 2020-07-23 13:14:22 +02:00
Aleix Pol fbbf96751b Workspace::findToplevel should iterate through allClients
Not just x11 ones.
2020-07-23 13:00:26 +02:00
l10n daemon script a1c0d43deb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-07-23 06:10:20 +02:00
Vlad Zahorodnii 555885072d Check if we successfully restored input focus
In rare cases, Workspace::restoreFocus() may fail, for example when the
most recently activated client is about to be destroyed or unmapped.

If it happens that we cannot restore the focus, then mark the window in
FocusIn event as active.

CCBUG: 424223
2020-07-22 12:29:41 +00:00
Vlad Zahorodnii 4921acf45a Grab all possible keyboard modifiers for window commands
BUG: 424272
FIXED-IN: 5.19.4
2020-07-22 12:28:22 +00:00
Cyril Rossi 3609a029ea KCM KWin Options setting ActiveMouseScreen set proper default value
Fix regression that was introduced by a mismatch in the default value of
ActiveMouseScreen option between kwin.kcfg and kwinoptions_settings.kcfg

BUG: 424389


(cherry picked from commit c853f8313a)
2020-07-22 10:37:30 +00:00
Vlad Zahorodnii 80a31ab4b7 Make setFrameGeometry() re-entrant for X and internal clients
If AbstractClient::setFrameGeometry() is called from a slot connected
directly to the frameGeometryChanged() signal, then is there a good
chance that kwin will fall into an infinite recursion. However, that's
the case with only X11 and internal clients.

The root cause of the infinite recursion is that both X11Client and
InternalClient compare the new geometry against the geometry before
update blocking. In order to fix the bug, we simply need to ensure that
updateGeometryBeforeUpdateBlocking() has been called before we start
emitting the frameGeometryChanged() signal.

Furthermore, a couple of tests were added to ensure that we won't hit
this subtle bug again.
2020-07-22 05:51:23 +00:00
Aleix Pol ef81ae3f9f Resize maximised windows upon workspace change
Don't issue a frameGeometry update until we have fully processed which
geometry we want.

BUG: 423596
2020-07-21 12:03:12 +00:00
Aleix Pol 7f1abd5dad Allow testing transformations on windowed KWin 2020-07-21 12:03:12 +00:00
Vlad Zahorodnii 2717252861 Partially revert a0c4a8e766
Unfortunately, a0c4a8e766 has a major bug
where clients that track focus events may get confused by focusToNull().

One such a notable example is Dota 2. It tracks the focus events to
minimize itself after the keyboard focus has been lost as well stop
playing music while it's in background. So, when we call focusToNull(),
Dota 2 will receive a corresponding FocusOut event and ask the window
manager to minimize it. It doesn't really matter that the FocusOut
event is going to be followed by a FocusIn event because when a window
is minimized, kwin will activate the next one in the focus chain.

Since those issues can't be fixed from the window manager's side, this
patch partially reverts a0c4a leaving only the autotest.

BUG: 424223
FIXED-IN: 5.19.4
2020-07-21 12:56:21 +03:00
Cyril Rossi 0fad9cc86c KCM KWin Options : propagate defaultsIndicatorVisibleChanged to children KCModule 2020-07-20 15:36:01 +02:00
Andrey Butirsky 0bb05d4b1a make keyboard layout DBus API more reliable
having deferred m_dbusInterface deletion allows to send DBus signal in
more cases.
That addressed in unit tests.
2020-07-17 12:42:28 +00:00
Andrey Butirsky 8e1018de2c save default keyboard layout
Implemented for Global, Virtual Desktop and Application layout policies.
Not implemented for Window policy due separate windows do not preserve
their IDs between sessions (still could be implemented the same way as for Application policy).

Layout saving/restoring happens on Session save/load.
Covered by unit tests
2020-07-17 12:42:28 +00:00
Vlad Zahorodnii cf27128877 Update input transformation matrix when buffer geometry changes
Currently, we update the input transformation matrix for the focused
pointer surface only when the frameGeometryChanged() signal is emitted.
However, since the input transformation matrix is computed based on the
current position of the upper left corner of the main surface, it is
wrong to do so because the frame geometry is a logical geometry that
doesn't have any direct relationship with the buffer geometry, i.e. the
rect on the screen occupied by the main surface.

If the input transformation matrix gets out of sync, user may notice
that pointer events are "shifted."

This change introduces a new signal that's emitted when the input
transformation matrix has been changed. Input related components in kwin
can connect to it to keep a copy of the input transformation matrix in
SeatInterface in sync. Under the hood, the new signal is just an alias
for the bufferGeometryChanged() signal.
2020-07-17 11:56:22 +00:00
Vlad Zahorodnii c4c06c4e1f Notify about new client geometry also when moving windows 2020-07-17 11:56:22 +00:00
Vlad Zahorodnii 9c55c01767 Introduce a signal that notifies about new buffer geometry
The new signal can be useful if one wants to watch a toplevel for buffer
geometry updates. This can be especially useful for input related code
because the position of the upper left corner of the main surface is used
to compute the input transformation matrix.
2020-07-17 11:56:22 +00:00
Vlad Zahorodnii fc839d8b29 Fix testActivities
Currently, the test passes because the activities controller doesn't
have enough time to fetch all activities. So, the test client won't be
placed on the current activity.

Since the Workspace is now created before starting the Xwayland, we now
spin the event loop, which allows the activities controller to fetch the
list of all activities and so the test client will be placed on the
current activity, i.e. client->isOnAllActivities() will no longer return
true.

This change fixes wrong assumptions in the test and makes it robust.
2020-07-17 09:10:51 +00:00
Vlad Zahorodnii 5dbb52de64 Handle delayed start of Xwayland
KWin is supposed to properly handle delayed start of Xwayland, but in
reality it does poor job of that.
2020-07-17 09:10:51 +00:00
Vlad Zahorodnii 97cf90269a Start accepting client connections after creating workspace
Sub-classes of the AbstractClient class need a valid instance of the
Workspace class to function as desired. We should not create xdg-shell
clients until the workspace is created.
2020-07-17 09:10:51 +00:00
Vlad Zahorodnii d1b35f306d Introduce started signal in Application
The new signal is emitted when the Application has fully been initialized.

It allows us to change the startup sequence, for example create workspace
before starting the Xwayland server, without making any adjustments in our
test suit.
2020-07-17 09:10:51 +00:00
David Edmundson 27ceaf9793 Only call VirtualDesktops::load once
It was called twice once with and without X as our implementation of
setRootInfo() missed some calls.

This was done to avoid a bug as setRootInfo() didn't update everything.
This patch aims to resolve that at the root cause.

I tested the original conditions of the patch with an empty kwinrc and a
file in /etc/xdg/kwinrc setting desktops to 2 and everything loaded
correctly.
2020-07-17 09:02:16 +00:00
Aleix Pol 93a08ba947 Fix keyboard layout tests
Don't give the InputConfig a separate config instance. I've seen it
being changed after having initialized the xkb instance which would
break the shared instance.
Using a simple config rather than reading the configuration from
the actual code-path shouldn't make a difference as a test it will be
using ~/.qttest which should be cleaned upp
2020-07-16 17:00:30 +00:00
Vlad Zahorodnii 4a6badc22c Ignore setActive() for windows that are being deleted
We may call setActive() on a window that is being deleted. We cannot
guarantee that at that moment the X11 window or the Wayland surface is
still valid. So, the best course of actions is to do nothing.

BUG: 424255
2020-07-16 17:04:09 +03:00
Vlad Zahorodnii 6139ea7874 Destroy xdg shell clients when surface is still alive
Destroy xdg shell clients when the aboutToBeDestroyed() signal has been
emitted in order to ensure that no NULL surface is going to be accessed.
2020-07-16 17:04:09 +03:00
Vlad Zahorodnii 036ad759e0 [wayland] Adapt to SurfaceInterface changes 2020-07-15 12:46:28 +00:00
Vlad Zahorodnii cae9828471 Don't perform MouseActivateRaiseAndPassClick for topmost windows
Do nothing if the active window is already most recently raised one.
2020-07-15 12:17:46 +03:00
Adrien Faveraux 6f640ece79 Adapt Contrast to new KWaylandServer 2020-07-14 18:25:38 +00:00
Adrien Faveraux ae12cf9784 adapt Decoration Server to KwaylandServer Change 2020-07-14 18:23:03 +00:00
Andrey Butirsky 3cdfdeb982 deprecate --libinput option
seems do not needed any more
2020-07-14 16:20:45 +00:00
David Edmundson 3a74be2df6 [autotests] Don't change screens during cleanup
Screens are set during init, to do so at cleanup doesn't bring a lot.

It leads to a potential awkward raciness with xwayland failing the test,
whilst doing something that isn't part of what we're testing here or
likely to happen in real life.
2020-07-14 11:12:18 +00:00
Adrien Faveraux bb138d7668 Adapt EglStream to KwaylandServer 2020-07-14 10:09:43 +00:00
Bhushan Shah 28d5a4e73b [virtualkeyboard] Fix the qtvirtualkeyboard with Qt 5.15
On 5.15, the VirtualKeyboard did not have a correct z-order which caused
the virtualkeyboard to hide as soon as key was pressed, upon
investigation it seems that upstream Qt changed behavior in following
changes.

https://codereview.qt-project.org/c/qt/qtvirtualkeyboard/+/292472
https://codereview.qt-project.org/c/qt/qtvirtualkeyboard/+/292674

Now when desktop-integration is used (i.e non-application embedded mode)
one need to set property desktopPanel to true so that it have correct
z-ordering and does not miss input events.

This is used in Component.onCompleted to avoid breaking it for the Qt
5.14.x qtvirtualkeyboard. When we switch to 5.15 property assignment can
be moved to InputPanel declaration.
2020-07-14 14:40:11 +05:30
Vlad Zahorodnii 5463a5427d [wayland] Drop pointless xwayland connection check
Xwayland can operate in two modes - rootless and rootful. When Xwayland
operates in the rootful mode, a container window is created where all
native X11 clients are placed. The container window is an xdg-toplevel
surface. Most compositors are not interested in rootful mode.

When Xwayland operates in the rootless mode, every X11 window is going
to be represented with a Wayland surface that has no role assigned to it.
In order to associate a wayland surface with an X11 window, Xwayland
will send a client message of type WL_SURFACE_ID.

Since we want Xwayland operate only in rootless mode, the check that
verifies that a newly created xdg-toplevel surface belongs to Xwayland
is pointless. We are never going to hit that case.
2020-07-13 15:37:34 +00:00
Adrien Faveraux 8d861b475d adapt Decoration Server palettes to KWaylandServer Changes 2020-07-13 15:36:22 +00:00
Aleix Pol e28e4cb189 Move inputConfig away from KWin::Application
We were calling it from tests that were not running a KWin::Application
and not even including the symbols from main.cpp and main.h. The only
reason they linked was that it was static_casting up the QCoreApplication.
2020-07-13 12:54:34 +02:00
Bernie Innocenti 0c67eb983c [decorations] Fix rendering for depth 30 (10bpc)
When the display is set to 30-bit depth (10-bit per color component),
decorations of some clients appear garbled when compositing is disabled.
This is because the pixel format of the QImage in which the decorations
were rendered differed from the the X pixmap into which the pixels were
being copied by means of xcb_put_image().

For lack of a more robust way, this change guesses A2RGB30 for depth=30,
and keeps using ARGB32 as before for any other depth. I don't expect
anything other to 32bpp to be supported by KWin anyway.

Tested on amdgpu with KWIN_OPENGL_INTERFACE=egl.

BUG: 406302
FIXED-IN: 5.19.4
2020-07-10 13:08:53 +00:00
Konstantinos Smanis 72cd67cbf6 [scripts/videowall] Reenable the config dialog
Install the .desktop file of the videowall script in the services
directory, otherwise the configuration dialog is inaccessible.
2020-07-09 09:47:08 +00:00