Commit graph

19939 commits

Author SHA1 Message Date
Xaver Hugl
6260c03548 platforms/drm: don't create modeset dumb buffer for import gpu
When the EglStreamBackend is used for the secondary GPU we don't need
the modesetting dumb buffer.
2021-06-25 10:08:36 +00:00
Emilio Cobos Álvarez
14b70e5e77 wayland: Set cursor surface outputs. 2021-06-25 08:58:28 +00:00
Xaver Hugl
7e96f09670 platforms/drm: use correct size for soft rotation 2021-06-25 00:46:32 +02:00
Vlad Zahorodnii
3427143017 Improve thumbnail item integration
Currently, thumbnail items are rendered by kwin. This means that qtquick
code cannot do things such as applying shader effects to window thumbnails
or simply draw custom controls on top of thumbnails.

With this change, task switchers and qml extensions will be able to
place their own contents on top of thumbnails and apply custom effects
to them.

In order to integrate window thumbnails, a window is rendered on kwin
side using its own opengl context. A fence is inserted in the command
stream to ensure that the qtquick machinery doesn't start using the
offscreen texture while there are still rendering commands being executed.

Thumbnails are rendered into offscreen textures as we don't have full
control over when qtquick windows render their contents and to work around
the fact that things such as VAOs can't be shared across OpenGL contexts.

WindowThumbnailItem and DesktopThumbnailItem act as texture providers.
2021-06-23 17:46:05 +03:00
Vlad Zahorodnii
172c541cad x11: Use global share context
This is needed to share window thumbnails between kwin's scene graph and
qtquick.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
8ed364337b scenes/opengl: Allow setting external global share context
This is needed to initialize global share context on X11.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
fac33750f9 effects: Remove shape property
It's unused and the advantages of keeping it are outweighed by the
disadvantages - the returned value is dependant on the window type.

If you need to draw a drop-shadow that matches the shape of the window
or something along that line, render the window into an offscreen
texture and sample the alpha channel in a fragment shader.
2021-06-23 11:21:51 +00:00
Xaver Hugl
80a7362efc platforms/drm: refactor post processing bits
Putting the OpenGL post processing rotation into its own class cleans
the EglGbmBackend code up a bit and adds post processing rotation for
the EglStreamBackend
2021-06-22 16:35:42 +00:00
Vlad Zahorodnii
b482226d6c wayland: Implement activities window rule
BUG: 439022
2021-06-22 13:48:05 +00:00
Vlad Zahorodnii
0e9ab1fced autotests: Fix TestBuiltInEffectLoader
The looking glass effect creates an opengl texture at load time without
a current context, which aborts the test.

The test should be converted into an integration test. Mocking the GL
library is simply not feasible and not worth the trouble. :/
2021-06-22 16:40:11 +03:00
Vlad Zahorodnii
5d1062f42d autotests: Fix VirtualKeyboardDBusTest
Input method is enabled by default now, adjust the test to that.
2021-06-22 16:28:45 +03:00
Vlad Zahorodnii
4206d8bd9c Remove unused include 2021-06-22 11:45:44 +03:00
Vlad Zahorodnii
da169ee2d9 Replace QRegExp usages with QRegularExpression
QRegExp is deprecated in favor QRegularExpression. It's potentially an
api breaking change as QRegularExpression has a different pattern syntax.
2021-06-22 08:35:10 +00:00
Vlad Zahorodnii
c61085dc2e Remove Toplevel::compositing() and Workspace::compositing()
It is error-prone to have multiple sources for the same data. If the
base implementation (Compositor::compositing()) changes, other helpers
can get out of sync.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
ae70b17c79 Set compositor On status before setupCompositing()
This is needed to ensure that Compositor::compositing() returns true
when Toplevel::setupCompositing() is called.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
d74e81bdd0 x11: Properly detect compositing status
When finishing compositing, Workspace::compositing() will return true,
but it will be preferred if it returns false instead so kwin can properly
update x11 window visibility status, etc.

Instead of checking whether the compositor has a scene, check the status
of the compositor. It will not be "On" during teardown.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
10769548db kwineffects: Allow creating GLTexture without allocated storage
This allows creating a GLTexture object and attaching a dmabuf to it.
Currently, we can do that by using the foreign GLTexture constructor,
but it makes the deletion of the texture handle more error prone.

In the future, we can add a method that allocates the texture storage,
but there's no need for that yet.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
2b8453abb8 platforms/x11: Port away from GLTexture::discard()
Currently, if discard() is called, kwin will crash because
EglPixmapTexture does not override the discard method.

In principle, neither GlxPixmapTexture nor EglPixmapTexture should mess
around with internals of the GLTexture class. It is better to have a
wrapper texture with a bind method, which will re-bind the pixmap to the
opengl texture if necessary.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
3b8b87a663 scenes/opengl: Update unstyled EffectFrame texture only when rendering
When the EffectFrame is created, there may not be any opengl context
current.
2021-06-22 09:58:31 +03:00
Vlad Zahorodnii
19699e9a26 scene: Store cached quads using std::optional
This way, the code is slightly more readable.
2021-06-21 16:32:55 +00:00
Xaver Hugl
9194c0c974 platforms/drm: some improvements for logging 2021-06-21 17:57:36 +02:00
Xaver Hugl
7552b53066 partially revert 2742e5b422
It seems like without a surface creation of the scene fails somehow. At
least until the exact problem is solved, update outputs for EglStream
gpus before creating the EglStreamBackend.

BUG: 438363
2021-06-21 14:49:44 +02:00
Xaver Hugl
0f6495f4b2 XdgSurfaceClient: set to current activity and desktop in constructors
BUG: 435745
FIXED-IN: 5.22.2
2021-06-20 20:37:29 +02:00
Xaver Hugl
0223136712 platforms/drm: fix mistake in DrmGbmBuffer
When gbm_bo_get_handle_for_plane isn't supported or doesn't work we'd be
passing the buffer format as its handle to drmModeAddFB(2).
2021-06-20 18:47:10 +02:00
Vlad Zahorodnii
46b81be246 autotests: Make SceneQPainterTest more robust to BufferInterface changes
At the moment, the test depends on the implicit client connection flush
in BufferInterface::unref(). It will be highly desirable if that connection
flush is gone as it allows us batching wayland events better. It also
allows us remove a system call from a hot path.
2021-06-19 09:24:16 +00:00
Alexander Lohnau
e170c3be7d
Use K_PLUGIN_CLASS_WITH_JSON instead of K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON
Task: https://phabricator.kde.org/T14542
2021-06-19 07:12:52 +02:00
Vlad Zahorodnii
b494efb23e autotests: Fix kwinglplatformtest
OpenGL2Compositing enum was replaced with OpenGLCompositing.
2021-06-18 17:31:32 +03:00
Xaver Hugl
b33fef02f5 platforms/drm: show cursor when exiting dpms
BUG: 438824
2021-06-18 14:10:22 +00:00
Nate Graham
c9a719e109 [effects] Use standard arrow cursor in Present Windows & Desktop Grid
The pointing finger cursor is used to show that a piece of text is a
clickable link, and it is inappropriate to use it in other contexts.
Regular UI elements that do something when single-clicked continue to
use the standard arrow cursor in other contexts, so let's follow that
convention in the Present Windows and Desktop Grid effects too.

BUG: 421928
FIXED-IN: 5.23
2021-06-18 12:58:40 +00:00
Felipe Kinoshita
ca3609eb4d [kcmkwin/kwincompositiong] Remove not so useful separators lines
This commit removes the separators lines below "scale method" and
"rendering backend", options here shouldn't be separated since they
are all related to eachother.
2021-06-18 10:40:23 +00:00
Nate Graham
bbf9c54dd8 [kcmkwin/kwineffects] Collapse list item when clicking on it again
Currently, each effect's list items expands when you click on any
non-interactive part of it, but it does not collapse when you click on
it again.

With this commit, now it does.

BUG: 421883
FIXED-IN: 5.23
2021-06-18 10:17:47 +00:00
Aleix Pol
56915dc113 xdgactivation: do not tell effects about unknown applications
Makes for an odd decoration.
We generally will not have an app_id in the cases where we are creating
a token just in case it's necessary down the line.
2021-06-18 00:11:56 +00:00
Aleix Pol
81f7436fda xdgactivation: Let activation requests through when they come from a window manager
If a client already has powers to move clients around, let them also
activate using the right protocols as well.

This is useful to be able to implement SNI or Notifications where the
shell doesn't get full surface activation when interacting with it.
2021-06-18 00:11:56 +00:00
Nicolás Alvarez
08143fb0d0 Update IRC network name in the README
KDE has moved from freenode to Libera Chat, update the README to reflect
this.
2021-06-17 10:07:23 +03:00
Nicolás Alvarez
a5c007c54a Update IRC network name in the README
KDE has moved from freenode to Libera Chat, update the README to reflect
this.
2021-06-16 14:26:36 -03:00
l10n daemon script
2f3a425c5e 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-06-16 01:24:38 +00:00
Nate Graham
77affd3259 [kcmkwin/kwindesktop] Drop local back for Formlayout label width
This hack was added in the past to prevent the combobox from being
pushed out of view when the label next to it was very long, as it can be
in certain languages. However it had the effect of making the label get
elided in *all* languages, and also the issue it was working around is
no longer present; even with very long text, the combobox no longer gets
pushed out of view, and instead the formlayout first switches to mobile
view and then elides the Label, exactly as intended. So we can safely
remove the hack.

BUG: 438504
FIXED-IN: 5.22.2
2021-06-15 17:27:14 -06:00
Xaver Hugl
250169ff84 platforms/drm: make context current without outputs in eglstream 2021-06-15 23:21:08 +02:00
Vlad Zahorodnii
61159d943c effects: Fix interpolated values for redirected animations
If a redirected animation reaches the end, the timeline value will be 0,
i.e. the interpolated() function has to return the from value, not `to`.

BUG: 438368
2021-06-15 08:46:58 +03:00
Vlad Zahorodnii
2ab70d0674 scenes/opengl: Clean up includes 2021-06-14 16:19:48 +03:00
Vlad Zahorodnii
1c94e1bfc4 scenes/opengl: Move out X11 explicit sync
This moves X11 specific code to a better place, which allows us make
item rendering code less platform specific and easier to change.
2021-06-14 13:14:54 +00:00
Vlad Zahorodnii
047c1a91f2 Properly destroy Compositor during teardown
When the aboutToDestroy signal is emitted, the compositor object is
already partially destroyed. This contradicts to the name of the signal.

In addition to that, it will be better to call the stop method in the
destructors of X11Compositor and WaylandClient as it allows them to add
custom cleanup code when compositing is turned off.
2021-06-14 13:14:54 +00:00
Vlad Zahorodnii
38f6494b2c scene/opengl: Remove unused includes 2021-06-14 12:20:37 +03:00
Vlad Zahorodnii
f9cf0baead kwineffects: Allocate hidpi textures in DeformEffect
If a window is animated using DeformEffect, allocate an offscreen
texture with the scale factor of the screen where the window is
considered to be on.

Also, resize the offscreen texture on demand in order to make resource
handling more efficient.
2021-06-14 09:02:44 +00:00
Vlad Zahorodnii
4af9d6c234 kwineffects: Remove unused WindowVertex and WindowQuad props
Since window quads are no longer passed in prePaintWindow(), we don't
need to track original vertex coords. This results in smaller memory
footprint.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
5339b1a9d7 scene: Move item preprocessing to scene
We no longer use window pixmaps to get the shape and the opaque regions,
so preprocess() can be called now only if we are about to paint the item.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
49744cfc53 scene: Improve window quad management
At the moment, we handle window quads inefficiently. Window quads from
all items are merged into a single list just to be broken up again.

This change removes window quads from libkwineffects. This allows us to
handle window quads efficiently. Furthermore, we could optimize methods
such as WindowVertex::left() and so on. KWin spends reasonable amount
of time in those methods when many windows have to be composited.

It's a necessary prerequisite for making wl_surface painting code role
agnostic.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
a6268595fb scene: Generate quads in item local coordinate space
Window quads need to be in some coordinate space. Since we want items to
be used not only for rendering windows, window-local coordinates do not
suffice.

This change makes scene items generate quads in the item-local coordinate
space.

The model matrix is used to map the quads to the global screen coordinate
system from the item coordinate space.

Since the quads are in the item local coordinate space, the mvp matrix
needs to be updated on every draw call. Given the render data, tracking
the last mvp matrix won't result in less glUniform calls. If this indeed
becomes a serious performance bottleneck, we can explore the possibility
of dumping mvp matrices in a UBO, which have been introduced in OpenGL
3.1.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
29cc319455 kwineffects: Remove WindowQuadType
The window quad type has become irrelevant.
2021-06-14 07:56:02 +00:00
l10n daemon script
3ed363c498 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-06-14 01:16:13 +00:00