Commit graph

18868 commits

Author SHA1 Message Date
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
Xaver Hugl
cb9ccdb0fd Don't check atomic property non_desktop when not using atomic mode setting 2020-11-17 08:10:51 +00:00
Ismael Asensio
871611e9ec kcm/decorations: Fix border size updating for thumbnails
The property was only being updated on changes, but reset back
to `Normal` on KCM loading or after clicking Apply.
2020-11-16 17:23:07 +00:00
Ismael Asensio
47efd17763 kcm/decorations: Fix thumbnail border size on theme change
Correctly update the thumbnails' border sizes when the theme
changes and `Theme's Default` is selected,
as different themes may have different border defaults.

Before 9cf52340e, this was implicitly done on QML side.
Do it explicitly now on C++ side.
2020-11-16 16:29:30 +00:00
David Edmundson
88f1883e90 Update to wayland-server changes for plasmashell 2020-11-16 10:10:08 +00:00
l10n daemon script
7659261982 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"
2020-11-16 06:14:08 +01:00
l10n daemon script
d36e326d66 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"
2020-11-14 06:42:08 +01:00
Ismael Asensio
9cf52340ef kcm/decorations: Simplify border selection
Use a single combobox instead of checkbox + combobox.
Adds a new property that acts as a proxy for the configuration value,
while internal configuration properties are kept unchanged.

BUG: 426157
BUG: 417430
FIXED-IN: 5.21
2020-11-13 22:00:04 +01:00
Ismael Asensio
1829dce1a9 kwinrules: Show error when detected window is unmanaged
BUG: 340477
2020-11-13 20:29:01 +01:00
Ismael Asensio
bf7e7b2130 kwinrules: Improvements on Detect Properties button
Slight UX and code improvents:

- Disable the detection button when property sheet is open.

- Add a minimum limit (smallDuration) to the delay before detecting
a window. Otherwise we freeze the window before even showing the
button release feedback, which can feel unexpected

- Prefer Q_INVOKABLE over public slot to expose method to QML
2020-11-13 20:18:04 +01:00
Vlad Zahorodnii
f26eeb9706 Use consistent naming for begin/end frame hooks
Currently, the OpenGLBackend and the QPainterBackend have hooks to
indicate the start and the end of compositing cycle, but in both cases,
the hooks have different names. This change fixes that inconsistency.
2020-11-12 09:14:57 +02:00
Vlad Zahorodnii
76303888ab Unify begin/end frame hooks in OpenGLBackend 2020-11-12 09:14:54 +02:00
Vlad Zahorodnii
81abc341d7 Remove assert in Compositor::aboutToSwapBuffers()
The purpose of Compositor::aboutToSwapBuffers() is notify the compositor
about a pending buffer. It's totally safe to call it multiple times if you
have multiple outputs. Ideally, it should also take an AbstractOutput or
screen id, but with the introduction of render loops per each output, we
won't need Compositor::aboutToSwapBuffers(). So, for the time being, this
change drops the annoying assert to make necessary per screen rendering
related refactorings easier to perform.
2020-11-11 22:03:45 +02:00
Vlad Zahorodnii
755dd81e49 Refactor how per screen rendering is handled
In order to allow per screen rendering, we need the Compositor to be
able to drive rendering on each screen. Currently, it's not possible
because Scene::paint() paints all screen.

With this change, the Compositor will be able to ask the Scene to paint
only a screen with the specific id.
2020-11-11 22:03:45 +02:00
Konrad Materka
d2f3372749 Fix Connections warnings
Qt 5.15 introduced new syntax for defining Connections. Fix warnings like this one:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2020-11-11 19:22:40 +00:00
Vlad Zahorodnii
7cab8cf8bb Make Scene::qpainterRenderBuffer() take a screen id 2020-11-11 07:22:10 +00:00
Vlad Zahorodnii
94b731c196 Prepare QPainter render backend for per screen rendering 2020-11-11 07:22:10 +00:00
Vlad Zahorodnii
edfb0a3fd9 Drop support for X11 overlay windows in QPainter render backend
It's unused.
2020-11-11 07:22:10 +00:00
Vlad Zahorodnii
e4861c28a7 scenes/qpainter: Drop support for Xinerama-style rendering
All platforms that provide support for the QPainter render backend use
per screen rendering. Since there is no any way to test Xinerama-style
rendering, it's better to drop the dead code.
2020-11-11 07:22:10 +00:00
Marco Martin
f64bea0f68 move decorations kcm to appearance
the application style category doesn't exist anymore
2020-11-10 14:03:36 +00:00
Aleix Pol
8ba6006a1b startupfeedback: Prefer using smart pointers to raw
Better security and less boilerplate.
2020-11-10 12:12:27 +00:00
Aleix Pol
4d549d76be startupfeedback: Don't use a lambda unnecessarily 2020-11-10 12:12:27 +00:00