Commit graph

18739 commits

Author SHA1 Message Date
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
David Edmundson
30f9e2a570 [autotests] Fix decoration input test
QTRY_COMPARE doesn't work well with how we do our wayland event
dispatching.

We know the client hasn't processed any events yet, so we can safely do
a normal wait.
2020-11-22 23:56:44 +00:00
David Edmundson
71ce1f7a5b Add an explicit quit mechanism controlled by plasma
On X Kwin's lifespan used to be managed by XSMP. This accidentally broke
in 5.20 as we made kwin start before ksmserver for speed purposes.

This leaves kwin to be killed by the display manager as the X connection
closes, but this can lead to deadlocks.

BUG:428817

On wayland kwin's lifespan is mapped to the lifespan of the ksmserver
binary. This is problematic as it makes our entire xwayland robustness
redundant if we ultimately rely on an application that /has/ to run in
xwayland.

BUG: 427688
2020-11-22 22:04:59 +00:00
Xaver Hugl
8f104815e8 Add a QRect to showWindowMenu
This is so we don't have to rely on the cursor position for the popup

BUG: 393163
2020-11-22 21:47:31 +00:00
David Edmundson
5e60e64a5d Bundle QPA plugin directly
On wayland, we know we're always going to load our internal QPA. Instead
of shipping a plugin and loading it dynamically we can use Qt static
plugins.

This should result in slightly faster load times, but also reduce the
number of moving pieces for kwin.

This also prevents anyone outside kwin loading our QPA which wouldn't
have made any sense and just crashed.
2020-11-22 17:52:14 +00:00
Aleix Pol
786207a4ba placement: Make internal methods private 2020-11-20 18:18:52 +01:00
Aleix Pol
df395f440b placement: Remove unused function 2020-11-20 18:10:01 +01:00
Nate Graham
3df7985570 [kcmkwin/kwinscreenedges] Disable left touch edge by default
On X11, it creates a dead pixel on the left edge which interferes with
left panels, the left-nost widget on bottom and top panels, and scroll
events on the left-most pixel in various apps.

It works properly on Wayland, but unfortunately turning it off by
default only on X11 but not Wayland is not easily doable. So let's turn
it off by default everywhere.

BUG: 387775
FIXED-IN: 5.21
2020-11-20 14:25:15 +00:00
Aleix Pol
3acb1a788e xkb: Don't call the seat's keyboard if it doesn't have one
Otherwise I can't start windowed kwin
2020-11-19 22:32:52 +01:00
Aleix Pol
4f484180cd Add emit to signal calls
To signify they're emitting.
2020-11-19 22:32:08 +01:00
Aleix Pol
22658bb2b4 Prefer Q_ENUM to Q_ENUMS
It exposes more information to introspect on.
2020-11-19 22:32:08 +01:00
Niccolò Venerandi
a590dbd309 Raise default blur strenght 2020-11-19 19:53:52 +01:00
yunqiang tai
51eeacd649 Initializes 'UserActionsMenu::m_multipleDesktopsMenu' and 'UserActionsMenu::m_shortcutOperation' in the constructor 2020-11-19 11:11:03 +00:00
Bhushan Shah
3429617662 adapt to changes in seat and keyboard interface
Now several methods of keyboard_interface are public and wrappers for
them are removed from the seat_interface.
2020-11-19 06:05:45 +00:00
Nate Graham
592c82abeb [kcmkwin/kwindecoration] Clean up QML code
Various fixes:
- Remove unneeded PlasmaCore import
- Re-arrange imports to be alphabetical and grouped consistently
- Use standard import names
- Use Kirigami units explicitly
- Remove unused ids
- Remove unneeded cases of setting aproperty to its default value
- Use Layouts where appropriate instead of lots of anchors
- Reduce number of unnecessary items
- Fix inappropriate mutation of `width` and `height` inside layouts

Visual changes are extremely minor and of a bugfixy nature.

BUG: 428883
FIXED-IN: 5.21
2020-11-18 14:53:11 +00:00
Chaojiang Luo
99c5f0aed6 fix: Restore full screen window to the right screen
We should use the geometry restore to check the full screen workspace
to make sure the window is on the right screen.
Step:
    1.plug extend display, change to Extend mode
    2.start a window, move to extend display, change to fullscreen
    3.unplug the extend display
    4.re-plug the extend display
Now, the full screen window do not restore to the extend display
2020-11-18 10:08:30 +00:00
xinbo wang
44b2a3f872 fix: magiclamp effect wrong direction.
if the dock is on the top,and the dock is not close together with screen edge.
for example,the dock is 10 pixels taller then sceen edge,the "position" will be "Bottom".
Autually,the dock is on the top of screen.
2020-11-18 10:06:06 +00:00
Nicolas Fella
fe6c296073 [libkwineffects] Add windowId to EffectWindow
My use case is integrating with a system that tracks window properties based on the windowId. This allows the effect to do window-specific things.
2020-11-17 21:56:17 +00:00
Nicolas Fella
3281569c12 Fix typos in comment 2020-11-17 21:55:42 +00:00