Commit graph

19789 commits

Author SHA1 Message Date
David Edmundson
ec9c2c3e68 Port kwin_wayland_wrapper to Qt/C++
We inintially created the wrapper to be light so avoided the QtCore
dependency and did it all in C.

In hindsight changing requirements means we want to add several more
features in here. The first step is to port to a more readable language
and toolkit.
2021-07-27 12:18:29 +00:00
l10n daemon script
5317ca9da0 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"
2021-07-27 01:25:25 +00:00
Vlad Zahorodnii
ca301d1914 Drop Scene::ImageFilterType
It's unused, GL_LINEAR filter is used by default now.
2021-07-26 14:56:21 +00:00
Vlad Zahorodnii
cb219da766 Remove screenGeometryChanged() in OpenGLBackend and QPainterBackend
The screenGeometryChanged() function is very X11-specific. On Wayland,
it's effectively unused.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
4ecb00889c scene: Move overlay window resizing to backends
The concept of an overlay window is not universal, it's X11 specific.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
e171555f2d Remove stray friend class 2021-07-26 16:25:02 +03:00
David Redondo
d84198f3b8 Set component display name for touchpad and keyboard shortcuts
Otherwise they appear as "KWin" in the settings when we want them
to be "Touchpad" and "Keyboard Layout Switcher".
BUG:440259
FIXED-IN:5.23
2021-07-26 10:37:48 +02:00
Vlad Zahorodnii
d4c7486fe1 Remove Q_UNUSED
damage is used.
2021-07-26 08:40:41 +03:00
Vlad Zahorodnii
3ab2ea40c4 Remove mask arg in Scene::paintScreen()
Render backends don't pass anything to the scene.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
d2b6d7ee59 platforms/wayland: Add support for buffer age in qpainter backend 2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
1cbf232b98 platforms/wayland: Report correct damage to host compositor
damageHistory.first() is the previous damage region, we need to report
the current instead.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
e087b2ce2f platforms/drm: Add buffer age support in qpainter backend
Currently, the entire screen will be repainted when using the qpainter
render backend. With this change, kwin will repaint only the dirty parts
on the screen.
2021-07-25 09:59:00 +03:00
Vlad Zahorodnii
603db353a3 scenes/qpainter: Avoid setting brush in paintBackground()
Calling QPainter::setBrush() without saving the current state, produces
mysterious black rectangles around clip region rects.
2021-07-24 16:32:16 +03:00
Vlad Zahorodnii
501298b0e0 Introduce DamageJournal helper 2021-07-24 16:32:13 +03:00
Vlad Zahorodnii
2fe102768a Remove QPainterBackend::needsFullRepaint()
A better alternative is to return the damage region in the beginFrame()
function. This way, the render backend can force full screen repaints or
indicate what parts of the buffer needs to be repainted (for buffer age)
2021-07-24 14:54:17 +03:00
Vlad Zahorodnii
4abbb6f0d6 Make OpenGLBackend and QPainterBackend QObjects
Almost all their subclasses are QObjects. This simplifies the class
hierarchy by making OpenGLBackend and QPainterBackend qobjects.
2021-07-24 11:30:13 +03:00
Vlad Zahorodnii
d543c0dff6 Remove unused mask param in QPainterBackend::endFrame()
It is unused and it is not a good idea to pass Scene's mask to the
render backend as it results in higher coupling between Platform and
Scene.
2021-07-23 20:42:59 +00:00
Nicolas Fella
a317a3f6bc Remove unused include 2021-07-23 19:51:11 +02:00
Vlad Zahorodnii
85654236d7 Fix build 2021-07-23 18:45:54 +03:00
Vlad Zahorodnii
964c487d4f wayland: Switch to ClientBuffer
The main motivation behind the split is to simplify client buffer code
and allow adding new features easier, for example referencing the shm
pool when a shm buffer is destroyed, or monitoring for readable linux
dmabuf file descriptors, etc.

Also, a referenced ClientBuffer cannot be destroyed, unlike the old
BufferInterface.
2021-07-23 15:33:38 +00:00
Andrey Butirsky
95e954da30 [tabbox] prevent dangling popups when switching on Wayland
If some popups of active window present, there was glitches on switching
such as stale popups or the popup happened below window.
Dismissing all the popups solves the problem.

BUG: 431046
2021-07-23 12:12:03 +00:00
Andrey Butirsky
b45f5c3a66 fix No globalshortcuts with popup grab
BUG: 431046
2021-07-23 12:12:03 +00:00
Nicolas Fella
25b85607d0 Port from KPluginLoader::pluginsById to KPluginMetaData::pluginById
The latter gives us only a single plugin which makes the code a bit more concise
2021-07-22 22:59:13 +02:00
Aleix Pol
05f3939cf1 inputmethod: Use the command as the availability metric 2021-07-22 20:12:54 +02:00
Aleix Pol
278da74eab inputmethod: Add a property to tell whether an input method is running 2021-07-22 17:42:53 +02:00
Vlad Zahorodnii
f431b6ad96 wayland: Cache last surface-to-buffer matrix
If window quads need to be generated after the wl_surface is destroyed,
the SurfaceItemWayland::mapToBuffer() function will return wrong values.

In order to fix that, we need to store the last surface-to-buffer matrix
in SurfaceItem.
2021-07-22 06:26:00 +00:00
l10n daemon script
068c1d4970 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"
2021-07-22 01:15:50 +00:00
Nicolas Fella
2faff3b1d0 [kcms/kwinoption] Remove obsolete desktop files and factory registrations
These appear to be remnants from a time where the current tabs were individual KCMs.

Remove some unneeded stuff and convert the only relevant registration to the normal K_PLUGIN_FACTORY macro
2021-07-21 19:42:45 +00:00
Nicolas Fella
cff33e7e40 [GenericScriptedConfig] Remove unused parameter
The passed value is always the same and never used
2021-07-21 19:42:15 +00:00
Nicolas Fella
55c6de1790 [kcms/effects] Remove unneeded X-KDE-PluginKeyword 2021-07-21 21:15:26 +02:00
Nicolas Fella
2f9adf4715 [effectsmodel] Simplify generic config plugin loading
We know exactly which plugin we want to load

No need to go through findPlugins()
2021-07-21 16:10:19 +02:00
Aleix Pol
26fd5d3667 inputmethod: Remove workaround 2021-07-21 13:10:30 +02:00
Aleix Pol
422522d15b inputmethod: Also expose the visibility on dbus
Since we adapted inputmethod to support methods like ibus, the input
method can be active but not have a visible panel.
This includes an extra property that will indicate us if the panel is
visible at any time. This will allow us to properly render the virtual
keyboard hide button in Plasma Mobile (or wherever we need it).
2021-07-21 13:10:30 +02:00
Aleix Pol
abf22570c7 inputmethod: Reduce consecutive activation+deactivation+activation sequences
So far calling setActive(true) would issue a deactivation then another
activation. This sometimes makes maliit crash and we can achieve the
same result just by just issuing a reset.
2021-07-21 13:10:30 +02:00
Aleix Pol
9b5b02c957 kwin tests: Add heplers to access the input panel client and its surface
It's useful when dealing with unit tests for input methods
2021-07-21 13:10:30 +02:00
Aleix Pol
638174ae09 inputmethod: Make sure the menu is only created when we create the SNI
It always does the same anyway, this way we make sure we don't leak
2021-07-21 13:10:30 +02:00
Aleix Pol
0169bca6e0 inputmethod sni: return early for readability 2021-07-21 13:10:29 +02:00
Michal Malý
d2ceea83b7 (Wayland) Allow moving windows from one virtual desktop to another with a single action 2021-07-21 10:43:58 +00:00
Vlad Zahorodnii
b344afd8cd wayland: Fix glitchy steam during interactive resize
Xwayland windows have two geometry types that are used during rendering
- wl_surface's geometry and x11 window's geometry. Unfortunately, it's
not possible just ignore the x11 window geometry because the window may
have a custom shape region. Pixels outside the shape region can have
arbitrary values; it's not guaranteed that the area outside the shape
region will be transparent.

In some cases, the x11 window geometry can be larger than the wl_surface
rect. That breaks repaint logic as the SurfaceItemXwayland can draw
outside the bounding rect.

Specifically, this issue can be seen while resizing Steam interactively.
Another example is where a video game enters fullscreen mode. I
occasionally see that Red Dead Redemption II window leaves a ghost after
itself when it switches to fullscreen mode.

It's not a perfect solution, but on the other hand, it doesn't look like
there's a better way to handle this due to the fact that there are two
conflicting geometry sources.
2021-07-20 05:33:53 +00:00
l10n daemon script
f14350e1bb 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"
2021-07-20 01:17:06 +00:00
Vlad Zahorodnii
d29954ae33 scripting: Make QTimer constructible
If a QObject is exposed to js using QJSEngine::newQMetaObject(), a new
instance of it can be made only with constructors exposed by Q_INVOKABLE

At the moment, QTimer's constructor is not Q_INVOKABLE, so code such as
`const timer = new QTimer()` will not work.

BUG: 439630
FIXED-IN: 5.22.4
2021-07-19 12:14:16 +03:00
Vlad Zahorodnii
73bfe648ef wayland: Notify Qt about activated/deactivated windows
Currently, internal windows are not marked as active. This breaks focus
logic in QtQuick.
2021-07-19 06:40:06 +00:00
Vlad Zahorodnii
a3e192837b wayland: Force decoration update
If the client had created an xdg-toplevel-decoration and has called the
set_mode() request with csd before the initial configure event is sent,
we still need to send an xdg-toplevel-decoration configure event with
csd mode.
2021-07-19 06:39:37 +00:00
Vlad Zahorodnii
9e5cb836a3 scripting: Provide hidpi window thumbnails 2021-07-16 17:11:46 +00:00
Xaver Hugl
97f8bfac5c platforms/drm: where necessary, disconnect CRTCs after VT switch 2021-07-16 17:19:26 +02:00
Xaver Hugl
f9f474d7e4 platforms/drm: fix property updating
A wrong index caused some properties to contain wrong values
2021-07-16 16:34:40 +02:00
Xaver Hugl
afcef2a6f8 platforms/drm: fix crash with secondary GPUs and buffer age
CCBUG: 433107
2021-07-15 11:42:57 +00:00
Vlad Zahorodnii
7863f3dc31 Add NOTIFY to toplevel x/y/width/height properties
Currently, when using Toplevel's x, y, width, and height properties in
qml, a bunch of warnings will be printed about missing NOTIFY.
2021-07-14 12:32:14 +03:00
Vlad Zahorodnii
64f7c03083 wayland: Emit geometryChanged signal if transform changes
If the output transform changes, the geometry may change as well;
otherwise qpa may not call QWindowSystemInterface::handleScreenGeometryChange()
with the corresponding platform screen.
2021-07-13 10:06:30 +00:00
Vlad Zahorodnii
adac3b8646 scripting: Guard against the case where a window is destroyed after changing visibility
If the visiblityChanged signal is emitted and then the window is
immediately destroyed, the slot will still be executed because the
connection has type of Qt::QueuedConnection.
2021-07-13 12:50:56 +03:00