Commit graph

19527 commits

Author SHA1 Message Date
Vlad Zahorodnii
3ae400772b kwineffects: Remove dead code
AnimationEffect sets the clip region to clip windows, so this code can
be safely removed.
2021-06-10 15:58:05 +00:00
Xaver Hugl
40c485f2a6 platforms/drm: fix EglStreamBackend init
BUG: 438363
2021-06-10 13:06:43 +00:00
Xaver Hugl
3d6659b0d7 platforms/drm: on NVidia do pageflips with QPainter
Otherwise it's just gonna display a static black screen

CCBUG: 438363
2021-06-10 11:19:07 +00:00
Aleix Pol
a24e92d0b7 blur: Use a custom projection matrix when passing to copy sample
The screen projection matrix doesn't necessarily apply to that
framebuffer, so we can't use it.
2021-06-10 10:06:35 +02:00
Aleix Pol
fffd41b32e Only create the viewport as needed
So far, we were creating a model view with the complete scene rendered
(even if we didn't render the windows themselves). This required us to
have a big glPerspective spanning the entire scene and we were just
cropping it as we rendered it into a smaller texture.

This changes our scenes so we have the correct matrix set up at all
times.

Specifically in the case of the Pinephone, this solves the following
issue where we were unable to connect external displays because it
exceeded GL_MAX_VIEWPORT_DIMS:
https://invent.kde.org/teams/plasma-mobile/issues/-/issues/11
2021-06-10 10:06:35 +02:00
Aleix Pol
bec50eaec0 deform effect: Use the provided matrix instead of creating a new one 2021-06-10 10:06:35 +02:00
Aleix Pol
059b78337f Add Q_ENUM to enum classes 2021-06-10 10:06:35 +02:00
Aleix Pol
09f99df1a3 inputmethod: Be more assertive towards the input panel visibility
If a new input client has taken over, don't override the trackedClient's
geometry.
Only consider the input geometry of a visible keyboard.
2021-06-10 03:33:36 +00:00
Aleix Pol
6fa96852dc inputmethod: Reconsider what a hidden input method is
When the panel disappears, just reconsider the panel's state but don't
just stop sending updates to the input method.
Some input methods are just helpers that show and hide as necessary.
2021-06-10 03:33:36 +00:00
Nate Graham
66661a9ddc [kcmkwin/kwindecoration] Re-phrase awkward message
BUG: 438189
FIXED-IN: 5.23
2021-06-09 14:22:09 -06:00
Vlad Zahorodnii
a06690021d Remove OpenGL2Compositing enum
OpenGLCompositing and OpenGL2Compositing enums mean de-facto the same
thing, it's confusing to have them both.
2021-06-09 15:24:22 +00:00
Nicolas Fella
1e36e79fa3 Remove unused KIO dependency 2021-06-09 16:18:41 +02:00
Marco Martin
ada29cfc9a don't place windows with invalid geometry
if a window has a size of 0x0, doesn't have its final place yet, so it can't be reliably
placed centered yet
2021-06-09 12:42:12 +00:00
Vlad Zahorodnii
811beb94e0 Remove Xrender backend
The Xrender backend was added at the time when OpenGL drivers were not
particularly stable. Nowadays though, it's a totally different situation.

The OpenGL render backend has been the default one for many years. It's
quite stable, and it allows implementing many advanced features that
other render backends don't.

Many features are not tested with it during the development cycle; the
only time when it is noticed is when changes in other parts of kwin break
the build in the xrender backend. Effectively, the xrender backend is
unmaintained nowadays.

Given that the xrender backend is effectively unmaintained and our focus
being shifted towards wayland, this change drops the xrender backend in
favor of the opengl backend.

Besides being de-facto unmaintained, another issue is that QtQuick does
not support and most likely will never support the Xrender API. This
poses a problem as we want thumbnail items to be natively integrated in
the qtquick scene graph.
2021-06-09 11:21:57 +03:00
Vlad Zahorodnii
3c2ca184e3 effects: Remove Desktop Cube Animation effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
47ef0b5a3c effects: Remove Desktop Cube effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
3722c21660 effects: Remove Cover Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
bcff948e39 effects: Remove Flip Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Xaver Hugl
4ee3f69dd5 platforms/drm: only allocate two dumb buffers for the swapchain 2021-06-08 21:11:39 +02:00
Vlad Zahorodnii
35e37f7347 Fix loading of window rules
We need to call KCoreConfigSkeleton::load() otherwise window rule
objects will not be created.
2021-06-08 15:58:48 +00:00
Vlad Zahorodnii
5929147ee1 Remove unused include 2021-06-08 15:58:21 +00:00
Xaver Hugl
19f92d731a platforms/drm: fix modifiers detection
CCBUG: 437893
2021-06-08 16:38:52 +02:00
Andrey Butirsky
471d635f0c [tabbox] fix non-working global shortcuts overrides
static cuts[] array was initialized only once with copies of non-const
objects, so when new shortcuts are configured, the old objects were still
referenced.
Fixed by having non-static array instead, so actual objects are copied
on the init every time.

BUG: 359141
2021-06-08 11:50:02 +00:00
Vlad Zahorodnii
52eabd064d Remove unused define preprocessor directive
IN_KWIN is unused.
2021-06-08 11:43:46 +00:00
Vlad Zahorodnii
9d1db97f05 Make kwin friendlier for static code analysis tools
Some static code analysis tools break when analysing kwinbindings.cpp.

This change moves the contents of kwinbindings.cpp file in useractions.cpp
to make those tools happier. It also makes code more readable.
2021-06-08 11:43:46 +00:00
Vlad Zahorodnii
7a063f9ab7 Build kwin with QT_NO_KEYWORDS 2021-06-08 10:52:15 +03:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Ismael Asensio
b5a58f83ee kcm/kwinrules: Manage RuleSettings instead of Rules objects
The KCM now manages the RuleSettings config objects directly,
instead of using a list of `Rules` objects as an intermediary.

This highly reduces the overhead, improving loading and saving
times, and also enables a better use of KConfig capabilites.

The config state is now automatically tracked by KConfigXT
objects. Whenever the user edits either the rule list, or any
specific property within a rule, the `needsSave` state is
updated accordingly.

BUG: 421564
FIXED-IN: 5.23
2021-06-07 21:03:29 +02:00
Ismael Asensio
61c2055da7 rulebooksettings: Add accesors to the rules settings list
Previously, the only way to access the rules list was via
the `rules()` and `setRules()` methods, so the actual
settings objects were not accesible.

This commit adds methods to retrieve, insert, remove or reorder
the rules within the list.

Since every individual rule is stored as a KConfig group, and
they are not designed to be dynamically renamed, using consecutive
numbered groups and store only the total count is problematic.

So we also add a new stringlist setting to store the rules group
names and their order.

Now any group name is valid. To avoid collisions use random QUuids
as group names for newly created rules.
2021-06-07 21:03:29 +02:00
Vlad Zahorodnii
d4f75f3e64 scripting: Add clientArea() overload that takes mutable client
Even though there is a clientArea() overload that takes const abstract
clients, QJSEngine seems to be unable to find the right clientArea()
overload if a mutable abstract client has been passed.

BUG: 437507
2021-06-07 18:08:30 +00:00
Alexander Lohnau
9c689d7ddb plugins: Port away from deprecated version checks
Task: https://phabricator.kde.org/T14302
2021-06-07 15:01:19 +00:00
Xaver Hugl
3c10398104 screencast: only use glGetTextureImage where supported 2021-06-07 14:11:07 +02:00
Xaver Hugl
0208f78336 platforms/drm: make context current for direct scanout 2021-06-07 13:45:50 +02:00
Xaver Hugl
cfd7af0179 platforms/drm: support NVidia as secondary GPU with CPU copy
BUG: 431062
2021-06-07 09:23:06 +02:00
Vlad Zahorodnii
605f00d03a effects/backgroundcontrast: Properly handle empty regions set by internal windows 2021-06-07 06:03:19 +00:00
Vlad Zahorodnii
cade5064c3 effects/blur: Properly handle empty blur regions set by internal windows
The task switcher has a valid empty blur region and the blur effect
misdetects that, which results in no blurred background.

BUG: 433131
2021-06-07 06:03:19 +00:00
Aleix Pol
34bfc25759 inputmethod: Don't move the clients around when the input panel is an overlay
It's meant to be floating around the cursor, if we do this we just get a
weird tiny screen.
2021-06-05 23:33:32 +00:00
Ömer Fadıl Usta
8fc3b024be Update dumb_swapchain.cpp 2021-06-05 04:59:02 +00:00
Vlad Zahorodnii
8c8098a61c Move X11Client::wantsShadowToBeRendered to AbstractClient
Otherwise only X11 windows will lose server-side drop-shadows when the
maximized mode changes.

BUG: 434213
2021-06-04 17:57:21 +03:00
Vlad Zahorodnii
5498b37938 scenes/opengl: Delegate viewport setup to backend
Only the backend knows what the right viewport rect is. Furthermore,
setting up the viewport before rendering is less error-prone.
2021-06-04 16:18:34 +03:00
Vlad Zahorodnii
d3f4da370b Prevent emitting Scene::frameRendered more than once per frame
Currently, the frameRendered() signal is emitted every time an effect
calls paintScreen(). This means that the frameRendered() signal can be
emitted more than once when effects such as slide are active. However,
we'd like if it's emitted only once before buffers are swapped.
2021-06-04 07:49:32 +00:00
Vlad Zahorodnii
8b3e999fbf scenes/opengl: Properly destroy backend if initialization fails
SceneOpenGL takes the ownership of the backend. So, if the scene fails
to initialize, the backend will be deleted twice.
2021-06-04 07:39:51 +00:00
Bhushan Shah
2b1d709b04 inputmethod: hook the key and modifiers functions 2021-06-04 00:14:34 +02:00
Aleix Pol
454425b43f inputmethod: Allow input methods to grab the keyboard
This allows different input methods to get information about what's
beign typed from the actual hardware. This is especially useful for
non-latin script languages.
2021-06-03 19:13:21 +02:00
Xaver Hugl
c5ea99cbe5 AbstractEglBackend: only clean up OpenGL context if primary 2021-06-03 14:44:14 +02:00
Aleix Pol
74724065ae inputmethod: Don't disable them by default if there's a connected keyboard
If the user has chosen to have a virtual keyboard (i.e. prefered maliit
over none in the KCM) they should get it. If it's too annoying it should
either be disabled or we can fix it so it gets less in the way.

This is especially important since some hardware registers itself as a
keyboard even if it's not a fully functional keyboard.
2021-06-03 10:51:01 +00:00
David Edmundson
4a16e18808 Remove Wayland::Client usage in wl->xwl drags 2021-06-03 09:04:26 +00:00
Ömer Fadıl Usta
6c97cd118d fix include 2021-06-02 17:41:10 +00:00
Xaver Hugl
b88b6f3bc3 platforms/drm: log when direct scanout starts and stops 2021-06-01 13:02:13 +02:00
Vlad Zahorodnii
de3b7a96db effects/blur: Ignore xshape region
EffectWindow::shape() doesn't fit the item based design. This change
ports the blur effect away from the shape() function to the rect()
function. The XShape extension was introduced when windows with an alpha
channel wasn't really a thing. Setting a shape served as a way to clip a
window, the most notable example is xeyes.

If an application relies on the xshape extension to actually clip the
window and not to force the window manager not to put the server-side
deco, it most likely doesn't support translucency and therefore it
shouldn't set the blur region to begin with.

This change makes the blur effect ignore the xshape region similar to
the background contrast effect. It allows us to decouple a bit more
effects from the rest of rendering machinery and thus make it easier for
us to move forward with the scene redesign goal.
2021-06-01 06:26:17 +00:00