20645 Commits (3b80380ba7077b316487ff3315df1b92c21878f0)
 

Author SHA1 Message Date
Vlad Zahorodnii a6090e7f83 effects: Strip unused builtin effect metadata
This improves plugin loading times. As is, the main issue is the number
of builtin effects and the fact that each has a lot of translated
strings, which combined adds up to noticeable loading times. KWin itself
will never read those translated strings, it only needs two pieces - the
plugin id and whether the plugin is enabled by default.

This change adds a little helper to strip unnecessary info from metadata
files.
3 years ago
Vlad Zahorodnii 068d60e36a Revert "wayland: Check workspace position when preferred deco mode changes"
This reverts commit 2560288e4b.

It broke alacricitty. The fix is not obvious, so revert the commit for
the time being.

BUG: 445444
3 years ago
Xaver Hugl 8528bbf800 backends/drm: ignore placholder outputs for the output config
They can only introduce intermediary state when a real output gets enabled
and are not relevant to the actual output config
3 years ago
Xaver Hugl b6b0af727d backends/drm: don't take crtcs from dpms disabled outputs
Fixes a crash I have with dpms + suspend, which was caused by the udev
event for updating outputs being called before the output got enabled
again. When DrmGpu::updateOutputs got called it removed the crtc from
the inactive output and then disabled the output afterwards. Instead,
only remove crtcs if an output is really disabled.
This also allows to generalize the logic for lease outputs, and could
in the future allow for faster dpms on/off switching.
3 years ago
Xaver Hugl 47d5d50bdf backends/drm: don't assume we have a cursor plane
CCBUG: 445507
3 years ago
Vlad Zahorodnii e605ea0c46 effects/blur: Fix tracking of blur region after compositing restart
updateBlurRegion() doesn't setup a
SurfaceInterface::blurChanged() signal connection. slotWindowAdded()
does that.
3 years ago
Vlad Zahorodnii 6234357675 effects/contrast: Fix tracking of contrast region after compositing restart
updateContrastRegion() doesn't setup a
SurfaceInterface::contrastChanged() signal connection. slotWindowAdded()
does that.
3 years ago
Vlad Zahorodnii 7228e9aefd Unify beginFrame() and endFrame() hooks for OpenGL and QPainter backends
This unifies frame hooks for OpenGL and QPainter render backends. There
are a couple of reasons why it's a good idea - it provides one mental
framework to start painting a frame, the Compositor will be able to
start and submit frames. The last one is very cool because it gives the
Compositor more power over compositing.

Besides unifying frame hooks, this cleans up a bit the arg naming mess
in endFrame(). As is, "damage" and "damagedRegion" are very confusing
names. "damage" arg has been renamed to "renderedRegion," because that's
what it is. The renderedRegion arg specifies the region that has been
repainted by the Scene. It's different from the damagedRegion as that
one specifies the surface damage, i.e. the difference between the
current and the next frame, while the renderedRegion may include a
region that had to be repainted to repair the back buffer. The main
reason why we need renderedRegion is the X11 platform. On Wayland, it's
unused.

In the future, we will need to extend this api with output layers.
3 years ago
Vlad Zahorodnii aaf88cd906 scenes/opengl: Keep lanczos filter after changing outputs
The lanczos filter checks the screen size before rendering in
LanczosFilter::updateOffscreenSurfaces(), so this is not needed.

This simplifies lifetime handling of the lanczos filter, e.g. we
don't need to bother with opengl context anymore, and makes the
scene use less Screens' features.
3 years ago
Vlad Zahorodnii af4c37c095 plugins/screencast: Rename PipeWireStream to ScreenCastStream
This change renames the PipeWireStream class to ScreenCastStream to make
naming consistent.
3 years ago
David Redondo 5d5780c770 Remove manual lnf default handling
This is now correctly set up when inside a plasma session.
3 years ago
Vlad Zahorodnii 0ebc563e6c Drop Toplevel::bufferScale()
On Wayland, a window can have subsurfaces. The spec doesn't require the
main surface and its sub-surfaces to have the same scale factor.

Given that Toplevel::bufferScale() makes no sense with Wayland windows,
this change drops it to make code more reasonable and to prevent people
from using Toplevel::bufferScale().
3 years ago
Vlad Zahorodnii d755e74c29 Remove some manual repaints in X11Client
Let the scene schedule a repaint instead.
3 years ago
Vlad Zahorodnii 29235e122d kcmkwin/compositing: Hide Compositing label on Wayland
All compositing checkboxes are invisible on Wayland, so hide the
compositing label.
3 years ago
Vlad Zahorodnii 7013c1473c kwinglutils: Clean up persistent vbo fences at the start of the frame
With a persistent vbo, kwin will allocate one big enough buffer and
allocate memory out of it.

In order to prevent overwriting vertex buffer data that is currently
being accessed by the GPU, fences are inserted at the end of frame.

The signaled fences are destroyed after the buffer swap operation, which
seems a bit odd because the just inserted fence most likely won't be
signaled. Perhaps it's a historical artifact?

This change rearranges fence cleanup so it's performed right before
starting a new frame. With it, kwin will most likely re-use the
previously used memory chunk because there will be plenty of time for
the fence to become signaled.

Another motivation behind this change is to make refactoring SceneOpenGL
code easier. As is, m_backend->endFrame() is wrapped in
GLVertexBuffer::endOfFrame() and GLVertexBuffer::framePosted(). With
that, the Compositor can't call m_backend->endFrame(), which can be
desired for cleaning up render backend abstractions.
3 years ago
Vlad Zahorodnii eecf14394e plugins/screencast: Introduce ScreenCastSource.closed signal
With the closed signal, we can unify how screen cast streams are closed.
3 years ago
Vlad Zahorodnii e7cd2c4396 plugins/screencast: Optimize output screencasting with memfd
When screencasting an output, read the output texture directly.
3 years ago
Vlad Zahorodnii 92a461c687 plugins/screencast: Exclude client-side drop shadows
The buffer geometry may include client-side drop shadows, which looks
odd when screencasting.
3 years ago
Vlad Zahorodnii 8518a7ea8c Drop Scene::Window::windowTexture() 3 years ago
Vlad Zahorodnii 10032e99e3 plugins/screencast: Make embedded cursor position handling simpler
If the position of the cursor changes, let the screen cast source to
repaint memfd or dmabuf buffer.
3 years ago
Vlad Zahorodnii c3c87ed8fa plugins/screencast: Introduce base ScreenCastSource type
Currently, when screencasting a window, kwin may render a window into a
temporary offscreen texture, copy that offscreen texture to the dma-buf
render target, and discard the offscreen texture.

Allocating and deallocating offscreen textures is inefficient. Another
issue is that the screencast plugin uses Scene::Window::windowTexture().
It's a blocker for killing scene windows.

This change introduces a base ScreenCastSource type. It allows us to
move away from Scene::Window::windowTexture() and make the dma-buf code
path efficient with applications such as Firefox that utilize
sub-surfaces.

With the ScreenCastSource, kwin can also provide screen cast frames with
arbitrary device pixel ratio.
3 years ago
Marco Martin 9eb5b92023 Apply roles to xdg popups if present
Like top level clients, apply plasmashell roles to popups as well (limiting them, don't allow dock or desktop roles in poups as they don't make sense)

This makes possible to recognize plasma tooltips as tooltips, treating them in a way closer to X, and makes morphingpopups work on wayland
3 years ago
Felipe Kinoshita 57b53e8d4e
Group compositing options in compositor KCM 3 years ago
Vlad Zahorodnii cc50c64e8d effects/overview: Forward unhandled keys to search field
After user edits the name of a desktop, the search field is no longer
focused. If the user starts typing text, one could expect that it will
be forwarded to the search field without requiring a click.

This change forwards unhandled key events to the search field to ensure
that searching is intuitive.
3 years ago
Vlad Zahorodnii 0b56711bf4 Make ServiceType irrelevant when searching for binary effects
Since binary effects are installed in their own directory, checking
service type is redundant. Also, KPluginMetaData::serviceTypes() has
been deprecated.

Task: https://phabricator.kde.org/T14483
3 years ago
l10n daemon script 07e0205ca5 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"
3 years ago
Vlad Zahorodnii b2f879eb33 effects/overview: Use strict equality operator in DesktopBar
It yields better performance.
3 years ago
Vlad Zahorodnii b7d0f292f3 effects/overview: Load desktop name editor on demand
It's most likely going to be unused, so don't bother loading it.
3 years ago
David Redondo 3bebd3dce4 Start pointer gestures with fingerCount fingers not time fingers 3 years ago
Vlad Zahorodnii ca4e643d67 effects/overview: Move Escape key handling to ScreenView
With this, no individual component has to handle the Escape key to
deactivate the effect.
3 years ago
Fushan Wen 25b035e84c effects/overview: Press Enter to create a new desktop
Add `Keys.onReturnPressd` and `Keys.onEnterPressed` to PC3.Button in
DesktopBar, so user can trigger the action by pressing Enter.
3 years ago
Oleg Solovyov cd4bdaa8fe Use NewStuff Elements 3 years ago
Weng Xuetian 83a036e9d4 Fix XWayland abstract socket address.
NUL-termination byte is not needed for abstract socket. This leads to
XWayland listening to a wrong address.

Confirmed with lsof.

BUG: 442362
3 years ago
Xaver Hugl 0afd0aa4be backends/drm: some simplifications for multi gpu
There is only one type of egl backend now, so the abstract backend can be
removed
3 years ago
Xaver Hugl c68f7f13f3 backends/drm,wayland: require gbm
The ifdefs for have_gbm obfuscate the code unnecessarily - the drm backend
is not a great experience with qpainter, so in practice noone should ship
it without gbm anyways.
3 years ago
Bharadwaj Raju 87afdb3e01 effects/overview: Make pressing Esc after closing label edit end the effect 3 years ago
Vlad Zahorodnii affb640bcb Move OverlayWindow getter to RenderBackend 3 years ago
Vlad Zahorodnii b8b8f93ca3 Drop Workspace::m_compositor
The Compositor is a singleton, there's no need to cache the return value
of Compositor::self().
3 years ago
Vlad Zahorodnii 9fca6209b7 Make Scene responsible for handling Workspace::deletedRemoved() 3 years ago
Vlad Zahorodnii 1fe8a18844 Make Scene responsible for scheduling repaint when current activity changes 3 years ago
Vlad Zahorodnii 6d0cca5c7f Move all dirty region scene repaint scheduling to Scene
The Compositor contains nothing that can potentially get dirty and need
repainting.

As is, the advantages of this move aren't really noticeable, but it
makes sense with multiple scenes.

Backend parts are far from ideal, they can be improved later on as we
progress with the scene redesign.
3 years ago
Vlad Zahorodnii 158fb016a4 Add Workspace::geometryChanged() signal
The new signal can be used to monitor workspace geometry changes. It can
be used by the Scene.
3 years ago
Vlad Zahorodnii 48f943bd75 Introduce explicit base render backend type
The main idea behind the render backend is to decouple low level bits
from scenes. The end goal is to make the render backend provide render
targets where the scene can render.

Design-wise, such a split is more flexible than the current state, for
example we could start experimenting with using qtquick (assuming that
the legacy scene is properly encapsulated) or creating multiple scenes,
for example for each output layer, etc.

So far, the RenderBackend class only contains one getter, more stuff will
be moved from the Scene as it makes sense.
3 years ago
Vlad Zahorodnii f3071707f9 Simplify no compositing code path in Compositor::setupStart()
If either the render backend or the scene has failed to initialize,
both m_backend and m_scene will be null.
3 years ago
Nicolas Fella 44dff155b4 Remove unneeded X-Plasma-API from KCM metadata
It doesn't serve any purpose
3 years ago
Aleix Pol bfe5c73541 Install the org.kde.KWin.TabletModeManager.xml 3 years ago
Fushan Wen c517e6cebd xwl: Fix unused warning in xwldrophandler.cpp 3 years ago
Xaver Hugl bad5752110 platforms/drm: kill the EglStreams backend
The proprietary NVidia driver now supports gbm, which vastly improves the
user experience. For older devices that will not get gbm support dropping
EglStreams will likely not have a big impact as it has several session breaking
issues anyways.

By removing the backend a lot of logic can be simplified, most notably multi-gpu.
3 years ago
Aleix Pol f91ae3e975 xwayland: Also follow the primary output
We want to update the XRandR information so that X11 apps know which is
the primary display, since some of them make use of it to position
themselves.
3 years ago
Vlad Zahorodnii 7580d6c6e0 scenes/opengl: Remove NPOT extension check
NPOT textures are in core spec in OpenGL 2.0+.
3 years ago