Commit graph

18151 commits

Author SHA1 Message Date
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
Aleix Pol
89fca06bdb Make sure tablet coordinates take decorations into account
Fixes a small awkward offset on some applicaitons.

BUG: 423833


(cherry picked from commit 311094ad8be4c76df2a4655fe71e7085fa9c4e14)
2020-07-08 15:20:35 +00:00
Andreas Haratzis
6c9026628c Fix DrmOutput sometimes being freed with a pending pageflip, often when waking from sleep.
It is possible for updateOutputs to be called when a pageflip is pending.
Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free).
This works around the problem by delaying the destruction with teardown().

BUG: 422460
2020-07-07 18:33:28 -07:00
David Edmundson
9e1bb1f130 [autotests] Fix warning
DrmOutput is a class
2020-07-07 09:24:03 +00:00
Benjamin Port
84b8d866e6 Prevent move/resize event when handling a maximize event 2020-07-07 08:35:12 +00:00
Benjamin Port
2d13bc3aa8 Prevent move/resize event when handling set full screen event
BUG: 421232
2020-07-07 08:35:12 +00:00
Chaojiang Luo
0ef5ddfd47 [drm] Do not blank crtc in atomic mode
In atomic setting mode, when external display tears down, it will blank
crtc with dump buffer by legacy api, then re-plug the external display,
the blank can not be removed. We think the blank is not needed in atomic
mode setting.

Signed-off-by: Chaojiang Luo <chaojiangluo@163.com>
2020-07-03 12:09:34 +08:00
Vlad Zahorodnii
617650d440 [scene] Discard pixmaps on buffer size change
The surface size is a logical size, which renders it unsuitable for
deciding whether the window pixmap needs to be discarded.

We need to discard window pixmaps when the buffer size changes. That
has a drawback though, discarding textures is kind of an overkill with
linux-dmabuf. However, fixing that would involve changes in kwayland
server that are far from being trivial.

BUG: 422459
2020-07-01 09:43:27 +00:00
Vlad Zahorodnii
f7a67e0edc [wayland] Ignore decoration updates if initial state isn't committed yet
or else we might send an unexpected configure event.
2020-07-01 09:18:29 +00:00
Vlad Zahorodnii
1013ee1bd0 [wayland] Queue maximize and fullscreen requests if initial state isn't committed yet
In order to ensure that no configure events will be sent before the full
initial state is committed, we need to queue maximize and full screen
requests or else the client may receive an "unexpected" configure event
and we miss to call initialize().
2020-07-01 09:18:29 +00:00
David Edmundson
1b4c725d10 Update clientGeometry for Unmanaged windows
It was udpated when we received a configure event but not in the initial
track.

The symptom of this being missed out was that blur would not be applied
to the window.

BUG: 423405
CCBUG: 423297
2020-06-30 14:59:54 +01:00
David Edmundson
38691aa0e7 [xwl] Fix xcb to wayland clipboard
A seemingly unrelated change to cursors broke xwayland's clipboard
syncing, presumably because of a change in how startup is ordered with
regards to syncing between our internal wayland connection causing a
crash.

It was fixed with a flush, but ultimately guarding things coming up in
the natural order works better.

Long term plans are to finish removing the internal connection.

See xwayland_selections_test in autotests.
2020-06-29 15:06:33 +01:00
Nicolas Fella
fdbca44d3e Use monochrome icon for keyboard layout sni
All SNIs use monochrome icons, except for this one
2020-06-28 19:12:32 +00:00
Nate Graham
898bd496d8 Merge branch 'Plasma/5.19' 2020-06-25 09:46:22 -06:00
Ismael Asensio
ad3d2f5acf Provide a mask for flag-type properties (window types) 2020-06-25 15:44:11 +00:00
Ismael Asensio
8b9472e0bf [kcm/kwinrules] Fix types property for NET::AllTypesMask
When the user selects all of the types or none of them, the "types"
property must be set to a special value (`NET::AllTypesMask = -1`),
different than the sum of all the flags together.

This re-implements this behaviour as the old KCM, fixing some heuristics
that prevented finding the rule corresponding to the current window.

The enum name that handles this property has been changed to `NetTypes`
to make it more explicit.

BUG: 423214
FIXED-IN: 5.19.3

TEST PLAN:
1. Open the `Application specific settings` on a window via menu
2. Select every "Window Type" (or none of them)
3. Give the rule a different name than the default and save
4. Open it again and check that the same rule is found
2020-06-25 15:44:11 +00:00
Vlad Zahorodnii
fa7fe79825 Merge branch 'Plasma/5.19' 2020-06-25 16:14:12 +03:00
Vlad Zahorodnii
578ede2dd7 Merge branch 'Plasma/5.18' into Plasma/5.19 2020-06-25 16:13:57 +03:00
Vlad Zahorodnii
a0c4a8e766 [x11] Force FocusIn events for already focused windows
Depending on the current focus stealing prevention level, it's possible
for kwin to call XSetInputFocus() on a window that already has the input
focus. In which case, we won't receive the corresponding FocusIn event
and the client will remain inactive from kwin's perspective even though
it isn't.

In order to work around this issue, we can move the input focus to the
null window. By doing so, it's guaranteed that we're going to receive
the matching FocusIn event for the client.

This commit indirectly fixes a bug where fullscreen games are displayed
below panels.
2020-06-25 13:12:44 +00:00
l10n daemon script
6a42eccfec 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-06-25 09:53:28 +02:00
l10n daemon script
b62f687c37 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-06-25 09:00:40 +02:00
l10n daemon script
4248f4d9ac 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-06-25 05:49:56 +02:00
Ismael Asensio
eb6e439335 Merge branch 'Plasma/5.19' 2020-06-24 21:22:43 +02:00
Ismael Asensio
3bfc750a79 [kcm/kwinrules] Fix detection of wmclass property
Property `wmclass` of a window rule works in a special way, as it can have
two meanings depending on `wmclasscomplete` flag:
- false: only matches `resourceClass`
- true: matches `resourceName` and `resourceClass`

This MR fixes two subtle bugs when detecting the properties of a window:

In the first case, `resourceName` was being wrongly set instead, which
prevented window matching for windows where those two values differ.

Also, the `wmclass` field was always set to `resourceName` independently
of `wmclasscomplete` property.

BUG: 423138
FIXED-IN: 5.19.3
2020-06-24 18:13:42 +00:00