Commit graph

19357 commits

Author SHA1 Message Date
Vlad Zahorodnii
9236254d5c Schedule a repaint when a window is damaged
Currently, if an X11 or Wayland window is damaged, we will schedule a
repaint. This results in some code duplication that this change intends
to get rid of.
2020-12-02 15:33:08 +00:00
Vlad Zahorodnii
017528956b Move Scene::isPerScreenRenderingEnabled() to Platform
This way the Compositor can know if per screen rendering is enabled
before creating the Scene.
2020-12-02 15:32:30 +00:00
Vlad Zahorodnii
b94c876597 Fix crash in eglTerminate()
At the moment, the gbm_device for the primary device is destroyed before
the EGLDisplay is destroyed. This results in a crash in Mesa.

In order to fix the crash, this change ensures that the EGLDisplay is
destroyed before the gbm device.
2020-12-02 15:32:02 +00:00
Vlad Zahorodnii
932cd27a5c plugins/screencast: Don't make effects opengl context current
This makes eglSwapBuffers() fail with per screen rendering enabled. In
long term, the screencast plugin has to create its own OpenGL context
and capture window frames after a compositing cycle has been performed.
However, it's currently tricky to do because of monitor screencasting.
2020-12-02 15:31:22 +00:00
David Edmundson
5e350b0db5 [autotests] Fix mouse between screens
There were multiple other cases of placing the mouse between screens at
the start of tests. It seems to be all copy paste.

Only maximise and pointerConstraints were failing before this, but we
may as well fix all of them.
2020-12-02 15:09:55 +00:00
zhang yaning
d1e9a4a46b add audio pause mapping in xkb_qt_mapping. 2020-12-02 17:50:55 +08:00
Vlad Zahorodnii
afc77c82f3 platforms/x11: Set reasonable refresh rate for dummy output
A refresh rate of -1 may break compositing scheduling code that relies
on the refresh rate being valid.
2020-12-02 09:10:09 +00:00
Vlad Zahorodnii
e3e6b3de2d platforms/x11: Use correct logging category 2020-12-02 08:34:50 +00:00
Xaver Hugl
b460909212 Small refactor in the drm backends 2020-12-01 16:58:24 +00:00
David Edmundson
d56d4370b2 [autotests] Fix autotests
Since the active screen now follows the mouse, the position is
important.

Between two screens is an overly confusing place for it anyway.
2020-12-01 11:19:55 +00:00
Vlad Zahorodnii
1a4d578b5e wayland: Plumb some X11 code
Things such as move and resize are implemented on Wayland using event
filters that handle both X11 and Wayland clients.

Having both code paths enabled results in things getting performed
twice, e.g. window actions are executed twice, first in X11Client and
the second time in WindowActionsEventFilter.

This also fixes warnings produced by KKeyServer about an unsupported
platform.
2020-11-30 12:54:29 +00:00
Johnny Jazeix
8c3355bdc0 fix compilation in FreeBSD, errno is defined in errno.h 2020-11-29 19:31:49 +01:00
Ismael Asensio
a6c51c5445 kcm/rules: Add a Duplicate action to rules list
Useful action, especially for heavy kwin rules users

As an example, this can help users to migrate their rules to Wayland
(where some matching properties such as window class may be different)
while keeping a version of the rule compatible with X11.

BUG: 429588
FIXED-IN: 5.21
2020-11-29 00:16:51 +01:00
Xaver Hugl
9ab688067a Create egl backend for multiple backends and enable multi-gpu usage for the gbm backend 2020-11-28 17:53:41 +00:00
Vlad Zahorodnii
2a8395c7dd Trim trailing whitespace 2020-11-28 11:01:47 +00:00
Vlad Zahorodnii
2acf25ae69 Remove confusing debug message
This debug message is not helpful without knowing where it comes from.
In addition to that, it indicates that the lack of libinput connection is
bad, but it is not. For example, with the nested wayland compositor you
will never have a valid libinput connection, which is fine.
2020-11-28 11:00:40 +00:00
Andrey Butirsky
fac29606eb impr: Keyboard Layout DBus API: drop excessive method arguments
It's enough to give info about current layout only or all the layouts
altogether, so no need to pass layout to asqure in an argument.

P-W part:
impr: Keyboard Layout plugin: drop excessive DBus API method arguments
2020-11-27 19:04:18 +00:00
Andrey Butirsky
1755b0fd8b impr: Keyboard Layout DBus API: expose switchToNextLayout() method
switchToPreviousLayout() is also added

P-W part:
"Keyboard Layout plugin: passthrough DBus switchToNextLayout() method
to QML applet"
2020-11-27 19:04:18 +00:00
Vlad Zahorodnii
bdfb946267 Convert Night Color into a plugin
Night Color adjusts the color temperature based on the current time in
your location. It's not a generic color correction module per se.

We need a central component that can be used by both night color and
colord integration to tweak gamma ramps and which will be able to
resolve conflicts between the two. The Night Color manager cannot be
such a thing because of its very specific usecase.

This change converts Night Color into a plugin to prepare some space for
such a component.

The tricky part is that the dbus api of Night Color has "ColorCorrect"
in its name. I'm afraid we cannot do that much about it without breaking
API compatibility.
2020-11-27 18:55:01 +00:00
Andrey Butirsky
2bac328cc8 feat: QML Keyboard Layout applet: allow Short Name override
In parity with legacy layout Widget,
user can now override layout Short Name from KCM

FEATURE:
CCBUG: 390079
2020-11-27 17:35:35 +00:00
Andrey Butirsky
283dff9174 fix: [2/2] Keyboard Layout applet: layout Name doesn't fit if variant is set
Variants are now stored separate from layouts in their own config entry.

P-D commit:
fix: [1/2] Keyboard Layout applet: layout Name doesn't fit if variant is set
2020-11-27 17:22:54 +00:00
Aleix Pol
cea2781318 screencating: query for dmabuf availability before we start streaming
As things are right now, we can only do 32bit textures for dmabuf (see
gbm_bo_format in gbm.h). This means that we were lying to our receivers
when we had 24bit textures by then giving a 32bit texture instead.

This changes it so we request a dummy texture before starting and if we
are offered one we assume they're available and offer a 32bits stream
directly (i.e. BGRA).
2020-11-27 15:42:23 +00:00
Vlad Zahorodnii
e298caaa7a wayland: Fix clipped thumbnails of client-side decorated apps
The buffer offset for client-side decorated windows is not 0, this plus
mixing the frame position and the client size may result in clipped
thumbnails of client-side decorated applications, such as gedit, etc.

BUG: 428595
2020-11-27 15:34:32 +00:00
Vlad Zahorodnii
a3cf1b9205 Drop AbstractClient::isInitialPositionSet()
It's the same as AbstractClient::isPlaceable(), which is a more generic
flag to indicate if the window can be placed.
2020-11-27 10:41:13 +02:00
Aleix Pol
7f4d1120c5 Have clients where we've set their position as non-placeable
If the client opted to position them on purpose, don't move them around.
If the geometry of the workspace changes it's their job to react
accordingly.

BUG: 429353
2020-11-27 08:18:49 +00:00
Claudius Ellsel
bcba2e252f Change the defaults for active screen
As suggested in https://bugs.kde.org/show_bug.cgi?id=425798#c12.

CCBUG: 425798 - https://bugs.kde.org/show_bug.cgi?id=425798
2020-11-27 08:18:02 +00:00
Vlad Zahorodnii
83003f0ccc Re-initialize colord integration when colord daemon is restarted
We need to re-create all colord devices in case colord daemon is reloaded.
2020-11-26 20:28:08 +00:00
Vlad Zahorodnii
3a7bce693e Explicitly destroy plugins
A plugin may need to access kwinApp() or kwinApp()->platform() during
tear down, but the problem is that plugins are destroyed after the
kwinApp() object. The plugin manager must be destroyed explicitly while
the application is still valid to ensure that no crash will occur
during compositor teardown.
2020-11-26 20:51:14 +02:00
Yuri Chornoivan
02c3dfb84b Fix extraction after krunner plugin separation 2020-11-26 09:36:28 +02:00
Aleix Pol
440555166f Address window placing problem on rotation
When changing the workspace size, clients will need to reposition
themselves. This leaves a short amount of time where strutted clients
(e.g. panels) will be floating in the wrong place.

This change makes it so when the area could not be properly calculated,
we ignore these clients until they start giving us proper values again.

This is a bit of a workaround though, it would make sense to implement
client placement more synchronously so we didn't have weird moments
where everything is wrong.

It's mostly prominent on the phone but it happens elsewhere when you
rotate.
2020-11-26 02:49:28 +00:00
Aleix Pol
91064cb26a xdgshellclient: Support set_fullscreen argument
xdgshell allows clients to specify which output should we fill on
set_fullscreen. This change takes this request into consideration
instead of ignoring it.
2020-11-26 02:47:34 +00:00
Vlad Zahorodnii
f04fa44f34 Fix license info in Findlcms2.cmake 2020-11-25 13:30:24 +02:00
Vlad Zahorodnii
8f6edea521 Turn krunner integration into a plugin
krunner stuff doesn't really belong in kwin, it has nothing to do with
compositing or any other things that are the domain of compositors.
Given that, being as a plugin suits the krunner integration stuff best.
2020-11-25 09:34:25 +00:00
Xaver Hugl
459aa66d8e Set setMoveResize(true) after stopping fullscreen and quick tiling
BUG: 427848
2020-11-24 18:17:48 +00:00
Vlad Zahorodnii
5058d5d1b4 Provide more information about colord devices
This helps a lot with identifying outputs in the color corrections kcm.
2020-11-24 18:16:19 +00:00
Vlad Zahorodnii
27e2e85144 Add manufacturer, model, and serialNumber properties to AbstractOutput
This can be useful for the colord integration plugin.
2020-11-24 18:16:19 +00:00
Michał Ziąbkowski
b186f86786 Fixed Toggle Night Color global shortcut, which used i18n in object name, leading to erratic behavior e.g. when system locale or translations changed.
BUG: 428024
2020-11-24 17:49:16 +00:00
Vlad Zahorodnii
59bf2a52ed Initialize the supports partial update flag to false
With 870679e46f, if the partial update
extension is unsupported, setSupportsPartialUpdate() won't be called.

The problem is that it may leave OpenGLBackend::supportsPartialUpdate()
uninitialized, which can lead to a crash if an OpenGL render backend
tries to call eglSetDamageRegionKHR() and EGL_KHR_partial_update is
unsupported.
2020-11-24 18:18:30 +02:00
Vlad Zahorodnii
f037a69f1c Introduce colord integration
This change introduces basic colord integration in wayland session. It
is implemented as a binary plugin.

If an output is connected, the plugin will create the corresponding
colord device using the D-Bus API and start monitoring the device for
changes.

When a colord devices changes, the plugin will read the VCGT tag of the
current ICC color profile and apply it.
2020-11-24 17:51:32 +02:00
Vlad Zahorodnii
6f83132bd1 Introduce Platform::{outputAdded, outputRemoved} signals
These new signals can be useful if you are interested only in when a
specific output gets added or removed.
2020-11-24 17:51:32 +02:00
Vlad Zahorodnii
c766e5da6d Introduce infrastructure for compositor extensions
The scripting api is not suitable for implementing all features that
should not be implemented in libkwin. For example, the krunner
integration or screencasting are the things that don't belong to be
compiled right into kwin and yet we don't have any other choice.

This change introduces a quick and dirty plugin infrastructure that
can be used to implement things such as colord integration, krunner
integration, etc.
2020-11-24 15:50:33 +00:00
Andrey Butirsky
a482d73de2 feat: expose keyboard layout Short Name via DBus
Due space constraints, Short Name is the only name suitable for keyboard
layout indication on panels and systray. Usually it's just 2 symbols
corresponding to standard ISO country code.

libxkbcommon doesn't have this information, so we have to store it in
compositor for the exposing:
https://github.com/xkbcommon/libxkbcommon/issues/192

It's exposed by getLayoutDisplayName() DBus method now, as it should initially.
For Long Name, getCurrentLayoutLongName() method was added.

Relevant P-W commits:
Keyboard Layout plugin: passthrough Short Name from compositor to QML applet
fix: Keyboard Layout plugin: wrong property for passing Short Name
X11 part, P-D:
feat: expose keyboard layout Long Name via DBus

CCBUG: 390079
FEATURE:
2020-11-24 16:34:57 +03:00
Bhushan Shah
ba4dbab4aa minor: fix coding style in abstract_egl_backend 2020-11-24 13:30:59 +05:30
Bhushan Shah
870679e46f Make it possible to disable partial update at runtime
This makes it possible to disable the partial updates and the swap
buffers with damage at runtime.
2020-11-24 13:30:59 +05:30
Vlad Zahorodnii
70393eec6f Consistently name some KF5 integration plugins 2020-11-23 16:44:42 +00:00
Vlad Zahorodnii
0dd2f787ae wayland: Link statically against KIdleTime integration plugin
The main motivation behind this change is to improve startup time. The
Poller class was renamed to avoid potential name conflicts in the future.
2020-11-23 16:44:42 +00:00
Vlad Zahorodnii
f3a902911a wayland: Link statically KWindowSystem integration plugin
Without the KWindowSystem integration plugin, Wayland experience will be
negatively affected because windows created by kwin itself won't behave
as desired. Therefore it makes little sense to load this plugin at runtime.
2020-11-23 16:44:41 +00:00
Vlad Zahorodnii
49e0b84d84 wayland: Link statically KGlobalAccel integration plugin
Without the KGlobalAccel integration plugin, Wayland experience will be
negatively affected. Therefore it makes little sense to load it at run-
time.
2020-11-23 16:44:41 +00:00
Aleix Pol
07c994fb82 screencasting: don't crash if the cursor is too big for our buffer
Make sure we stay within our bounds.
Also initialise the background to transparent so there's no data from
past renders.
2020-11-23 13:38:24 +00:00
Yu Zhang
bf5155f82b fix: Restore the default properties of dialog window so that the max and min buttons can be customized 2020-11-23 18:36:08 +08:00