Commit graph

19939 commits

Author SHA1 Message Date
Vlad Zahorodnii
7e9c6587db Remove scene window traces in scene items
This further decouples scene items from scene windows. The SurfaceItem
still needs to access the underlying window, I would like to re-iterate
over that later.

With this change, it will be possible to introduce WindowItem factory
function in the Toplevel class.
2021-08-12 17:52:24 +00:00
Vlad Zahorodnii
a13fd02ea8 Remove virtualdesktops.h include in toplevel.h
toplevel.h is included in many places. Changing virtualdesktops.h may
trigger rebuild of all kwin.

With this change, only cpp files that use virtualdesktops.h will need to
be recompiled.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
f71686894d Remove unused includes in x11client.h 2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
a848fb6374 Remove input.h include in toplevel.h
It's unused.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
0197d770ab Drop Toplevel::transparentRect()
It can be computed via other means (Toplevel::frameMargins()) and its
name is confusing. It specifies the inner decoration rect.
2021-08-12 17:22:49 +00:00
Aleix Pol
ac16bef409 screenshot: Reuse GLTexture::toImage
Cleans the code a bit. It also makes use of the more performant
Qt::Format_RGBA8888_Premultiplied, which is nice to come by.
2021-08-12 16:00:52 +00:00
Aleix Pol
1473466ef7 inputmethod: Remove the SNI entirely
It can be replaced with an ad-hoc plasmoid that gets to be a bit more
specific and interactive.
2021-08-12 16:00:15 +00:00
Vlad Zahorodnii
ad4f183a76 x11: Drop support for _NET_WM_FRAME_OVERLAP
The main idea behind _NET_WM_FRAME_OVERLAP is to extend the borders of
the server-side decoration so the application can draw on top of it. It
was inspired by similar feature in Windows.

However, _NET_WM_FRAME_OVERLAP is basically unused. Neither GTK nor Qt
support it and I have never seen any application that uses it.

At the moment, kwin is the only compositing window manager that supports
_NET_WM_FRAME_OVERLAP. Neither mutter nor compiz nor compton and so on
support it.

Since _NET_WM_FRAME_OVERLAP is practically unused, there's no point for
keeping supporting it.

This change shouldn't affect any existing app as _NET_WM_FRAME_OVERLAP
atom is not listed in _NET_SUPPORTED.
2021-08-12 11:44:40 +00:00
Vlad Zahorodnii
4ca287641f wayland: Destroy xdg shell clients when corresponding roles are about to be destroyed
This ensures that surface role objects can be still accessed when either
XdgToplevelClient or XdgPopupClient is destroyed. As far as I know, it
doesn't cause any problems right now, but this makes resource destruction
handling consistent, we tend to perform cleanup in aboutToBeDestroyed
signal slots.
2021-08-12 13:03:35 +03:00
Manuel Stoeckl
51d82fc6e5 Replace an old workaround for alpha-only shadows
SceneOpenGLShadow::prepareBackend used to use QImage::Format_Indexed8,
plus a special code path in GLTexture, to create single-channel OpenGL textures.
Now that Qt supports QImage::Format_Alpha8, this workaround can be removed.
2021-08-11 23:32:18 -04:00
l10n daemon script
4ab4f928f0 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-08-12 01:14:37 +00:00
Vlad Zahorodnii
4912c7cfa2 scenes/opengl: Calculate item transforms differently
Currently, a vertex coordinate is transformed first, then mapped to
the global screen coordinates. This causes a problem if a transform
is applied to the top-most item and child items are not at (0, 0).
For example, scaled windows may have popping out sub-surfaces, etc.

With this change, the item transforms will be computed differently. For
example, if the parent item is transformed, a child's transform will
look as follows

  [Parent's translation][Parent's transform][Child's translation]

instead of

  [Parent's translation][Child's translation][Parent's transform]

In the future, I'd like to get rid of the Item::setTransform() call in
OpenGLWindow::performPaint() and have either AnimationEffect or
libkwineffects call Item::setTransform().

BUG: 440201
2021-08-11 19:43:31 +03:00
David Edmundson
60255fd7a9 Teardown view before QQuickRenderControl
Deleting QQuickWindow will force any remaining runnables to complete.
This is important for any items (such as our new ThumbnailItem) that
deletes resources in queued cleanups.

We need to invoke this manually whilst we still have an active render
control with a valid context, otherwise remaining runnables will no-op.

We also then want to manually delete our scene contents before the view
so they're not orphaned temporarily.

This fixes a memory leak observed with the new Overview effect.
2021-08-11 07:31:53 +00:00
Vlad Zahorodnii
fdb1914a83 wayland: Wire in surface mapped state
If a sub-surface should be considered unmapped, make the corresponding
item invisible.

Note that this must apply only to sub-surfaces. Whether the main surface
should be visible is up to kwin. It may want to play an animation when
the toplevel surface is unmapped, etc.
2021-08-11 06:41:00 +00:00
Manuel Stoeckl
aa386896f1 Rename QImage to GL format conversion table
Also expand the comment describing it.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
b440be5bd2 Avoid converting images when updating GLTexture
In GLTexture::update, reuse the mechanism from the GLTexture(QImage, ...)
constructor to upload QImage data directly when the QImage format
has compatible GL format and type codes. Before this change, all QImage
formats other than ARGB32_Premultiplied required a format conversion.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
9be3513348 platforms/wayland: Delay setup until first configure
As per the xdg-shell specification, the compositor can only attach
a wl_buffer to an xdg_surface once the compositor has sent an
xdg_surface.configure event. Previously, there was a race condition
in which WaylandOutput objects were added/enabled on creation, making
it possible for the EglWaylandOutputs to be set up and for
EglWaylandBackend to draw a frame (thereby attaching a buffer), all
before the xdg_surface.configure configure event was received.
Compositors other than kwin would then send an unconfigured buffer
error and close the connection.

This commit avoids the problem by not marking the WaylandBackend
ready for use until all the output surfaces constructed at startup
have received their initial configure event. (In practice, this
takes one additional roundtrip.)
2021-08-10 14:21:12 +00:00
Alexander Volkov
1bf901cfbf Use c++ version of True to make sure it will compile
kwin fails to build for me because of missing 'True'.
Besides, 'true' is used in other places.
2021-08-10 10:46:07 +00:00
Nicolas Fella
050b4945ce [kcms/decoration] Try loading decoration KCMs without plugin keyword
We're porting away from using plugin keywords (and have done that for
the breeze and oxygen decoration). However to allow that we need to
adjust the loading code.

Keep the old codepath for compatibility.

BUG: 440786
2021-08-10 10:14:24 +00:00
Fabian Vogt
11c7e7a64d scenes/opengl: Avoid blending for entirely opaque SurfaceItems
Blending is quite expensive especially with software rendering.
In the case of Firefox on Wayland, it uses a ARGB8888 buffer but marks the
entire surface as opaque, so the alpha channel can be ignored.

CCBUG: 440386
2021-08-09 06:52:12 +00:00
Xaver Hugl
1041ef8275 platforms/drm: introduce virtual outputs
When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.

CCBUG: 420160
CCBUG: 438839
2021-08-07 17:18:40 +02:00
l10n daemon script
f7e2f5504a 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-08-07 01:15:04 +00:00
Vlad Zahorodnii
1dae29175f kwineffects: Fix potential image detaching
QImage is implicitly shared. However, methods such as QImage::bits() may
detach. In order to avoid the detach, one either needs make the image
const or use QImage::constBits() method.

Currently, the GLTexture class uses QImage::bits() all over the place.
It prevents implicit detaching by storing images in const variables. Such
code is fragile. Adding an intermediate (optional) conversion step may
result in odd performance regressions.
2021-08-06 07:20:54 +00:00
l10n daemon script
f4c0e19935 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-08-06 01:16:36 +00:00
Xaver Hugl
7879450cdf platforms/drm: work around tigerlake bug
CCBUG: 440361
2021-08-05 12:25:54 +00:00
Vlad Zahorodnii
e94fbcd853 Copy shape region to Deleted
Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.

If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.

BUG: 440001
BUG: 438458
BUG: 435378
2021-08-05 06:03:11 +00:00
l10n daemon script
d47b27f9cd 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-08-05 01:15:06 +00:00
Alexander Lohnau
e34d8bbed6 Consistently name kpackage structures
This will allow kpackage to load the structures by their path.

Task: https://phabricator.kde.org/T14757
Conceptually the same direction as https://phabricator.kde.org/T14499.
2021-08-04 18:42:31 +00:00
Alexander Lohnau
9fe294776d Define new KPackageStructure property in kpackage structures
Task: https://phabricator.kde.org/T14563
2021-08-04 18:42:31 +00:00
Alexander Lohnau
370f0c0b22 Clean up unneeded service type definitions in kpackage structures
Task: https://phabricator.kde.org/T14483
2021-08-04 18:42:31 +00:00
Xaver Hugl
81136a0448 platforms/drm: drop unused methods 2021-08-04 15:06:43 +02:00
l10n daemon script
7db6ea0c15 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-08-04 01:15:43 +00:00
Aleix Pol
896880be96 Revert "Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372"
https://invent.kde.org/plasma/kwin/-/merge_requests/1220

This reverts commit 44ad9437c4 because it
breaks build:
platforms/x11/common/eglonxbackend.cpp:224:66: error: cannot initialize a parameter of type 'EGLNativeWindowType' (aka 'unsigned long') with an rvalue of type 'xcb_window_t *' (aka 'unsigned int *')
        surface = eglCreateWindowSurface(eglDisplay(), config(), &window, nullptr);
                                                                 ^~~~~~~
2021-08-03 18:09:04 +02:00
nerdopolis turfwalker
44ad9437c4 Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372 2021-08-03 08:28:04 -04:00
l10n daemon script
b90d92a8fb 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-08-03 01:15:25 +00:00
Andrey Butirsky
998bbf4eba fix wrong cursor hotspot under Wayland on VMs 2021-08-02 09:03:07 +00:00
David Edmundson
47e38b7141 Disconnect frame renders when ThumbnailItem has no window
It is perfectly valid to have a case where an item exists but has no
window. During these times the item will never be rendered.

Rather than guard in updateOffscreenTexture, it's more economical to
disable the frame rendering in the first place. Especially as then it's
easy to extend to item visibility.

BUG: 440318
2021-08-02 08:43:27 +00:00
l10n daemon script
cf9c60a0c0 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-08-02 01:12:21 +00:00
Xaver Hugl
2e473a21fb platforms/drm: small logging improvements 2021-08-01 23:26:49 +02:00
l10n daemon script
d2aac8cb05 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-08-01 01:21:11 +00:00
Aleix Pol
53dcd205c6 inputmethod: Add a test that simulates client switching 2021-07-31 02:10:17 +02:00
David Redondo
3b9ffdfbf6 Revert "Do not pass input to windows that are not painted"
This reverts commit 09f786a209.
2021-07-30 17:08:48 +02:00
David Redondo
09f786a209 Do not pass input to windows that are not painted
Passing input to windows that we do not paint is confusing as what happens
is different from what is visible on the screen.
2021-07-30 16:22:37 +02:00
l10n daemon script
141f627413 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-30 01:11:30 +00:00
l10n daemon script
ac438d6bb3 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-29 01:15:05 +00:00
Aleix Pol
475993db70 kscreen effect: Work per screen
Makes it possible to apply the dpms settings per screen instead of
applying it to all of them, which is wrong at many levels.
Will be even more important with other effects like rotation.
2021-07-28 10:57:27 +00:00
Alex Richardson
ed57ac39e2 Convert the KPackage plugin metadata to .json 2021-07-28 11:09:38 +01:00
Nate Graham
9f00c29c67 [kcmkwin/kwinrules] Port OverlaySheet headers to use title: property
This was added to Kirigami in
https://invent.kde.org/frameworks/kirigami/-/merge_requests/314
and simplifies and standardizes the creation of simple text-based
headers in OverlaySheet. This commit ports the KWin Rules KCM to
use it.
2021-07-27 15:17:41 -06:00
David Edmundson
beedf2be71 Fix minor typo 2021-07-27 13:20:24 +01:00
David Edmundson
0c6a8e7b88 Avoid setting crash count to 0 when restarted
If kwin is explicitly restarted (kwin_wayland --replace) we reset the
crash count so that you can run it more than 10 times without exiting to
the logout screen.

Resetting to 0 causes a issue as that triggers ksplash to be shown
again.

BUG: 434489
2021-07-27 12:18:29 +00:00