Commit graph

18576 commits

Author SHA1 Message Date
Nicolas Fella
6b34b90635 Revert "[libkwineffects] Add windowId to EffectWindow"
This reverts commit 251bbbb5b5
2020-11-01 14:29:16 +00:00
Nicolas Fella
251bbbb5b5 [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-01 15:25:15 +01:00
l10n daemon script
20dc60eda8 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-01 06:40:02 +01:00
David Faure
8563f1f54f Port from QStandardPaths::DataLocation to QStandardPaths::AppDataLocation
They are the same on Linux (but DataLocation is deprecated). On Windows this enables the use of the roaming path.

NO_CHANGELOG
2020-10-31 14:38:21 +01:00
l10n daemon script
694c42c440 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-10-31 06:30:18 +01:00
Vlad Zahorodnii
d5203c79a0 Report partial updates on all outputs
Previously, we couldn't do it because repaints weren't tracked per each
output.
2020-10-30 20:47:05 +00:00
Ismael Asensio
d9528a5d1d kwinrules: Change singal name to better match its meaning 2020-10-30 20:16:37 +01:00
Ismael Asensio
335eca223a kwinrules: Do not force suggested property values
This is unnecesary and also causes a bug, overwriting
previously set properties with the new detected values
when calling for the menu `Edit window properties`.
2020-10-30 20:16:37 +01:00
Ismael Asensio
a89b66a2e1 queryWindowInfo: Differenciate between unmannaged and user cancel
Previous fix here didn't take into account the case where use can
cancel the query (by pressing Esc).
2020-10-30 19:50:34 +01:00
Benjamin Port
0faf282694 Fix build without krunner 2020-10-30 16:34:45 +00:00
Andrey Butirsky
cfcf2baae7 fix: [1/2] Keyboard Layout applet doesn't follow actual layout switching
We need to emit DBus signal on every layout change - explicit(keyboard shortcut, layout applet click)
and implicit(focus window with different layout).
Otherwise, external layout applet might not get updated.

DIGEST:
BUG: 426900
2020-10-30 14:54:14 +00:00
Benjamin Port
cf4335ca62 Add windows runner
Move windows runner from plasma-workspace to kwin (convert it to dbus runner)

This will allow to interract with windows on wayland too
2020-10-30 10:30:53 +00:00
Vlad Zahorodnii
648dab44da platforms/drm: Don't intersect the final output damage twice 2020-10-30 09:41:37 +00:00
Konstantinos Smanis
dbcf43abfe Allow configuring click behavior in Desktop Grid effect
The following click behaviors are defined:
 * Switch desktop and activate window [default]
 * Switch desktop only

The former emulates the previous default of activating clicked windows
using the Present Windows effect. The latter introduces a new mode where
the clicked window is not activated, allowing the user to select a
virtual desktop without worrying about disrupting the last active
window.

The configuration toggle that controlled the use of the Present Windows
effect has been subsumed into the first click behavior, i.e., if the
effect is enabled, it will be implicitly triggered.
2020-10-30 09:39:00 +00:00
Vlad Zahorodnii
458ea6dc5e platforms/wayland: Enable buffer age for all outputs 2020-10-30 07:24:01 +00:00
Vlad Zahorodnii
ac203818b7 platforms/drm: Enable buffer age for all outputs 2020-10-30 07:24:01 +00:00
Vlad Zahorodnii
74391e250e Store repaint regions per individual screen
AnimationEffect schedules repaints in postPaintWindow() and performs
cleanup in preScreenPaint(). With the X11-style rendering, this doesn't
have any issues, scheduled repaints will be reset during the next
compositing cycle.

But with per screen rendering, we might hit the following case

    - Paint screen 0
    - Reset scheduled repaints
    - AnimationEffect::prePaintScreen(): update the timeline
    - AnimationEffect::postPaintScreen(): schedule a repaint

    - Paint screen 1
    - Reset scheduled repaints
    - AnimationEffect::prePaintScreen(): destroy the animation
    - AnimationEffect::postPaintScreen(): no repaint is scheduled

    - Return to the event loop

In this scenario, the repaint region scheduled by AnimationEffect will
be lost when compositing is performed on screen 1.

There is no any other way to fix this issue but maintain repaint regions
per each individual screen if per screen rendering is enabled.

BUG: 428439
2020-10-30 07:24:01 +00:00
Ismael Asensio
3d828d891c WindowSelector: fix finding unmanaged windows
This typo was preventing the method from actually finding the
requested window if turned to be unmanaged
2020-10-29 23:33:54 +01:00
Aleix Pol
e0c965d316 Do not re-read output configuration if the outputs didn't change
They would override KScreen in case we were using a dock station that
brings 2 displays.
We'd get:
- udev: event for the first hotplughed screen
- kwin: process all screens properly (both)
- kscreen: would offer the right configuration for such displays
- udev: process the event for the second hotplug udev event
- kwin: restore the configuration
- kscreen: would think this is a conscious decision and embrace it as a
configuration

With this change we are only re-reading the configuration in case the
outputs changed.
2020-10-29 14:57:50 +00:00
Aleix Pol
f9becf8085 wayland: Make sure EDID are being fed to wayland outputs
At the moment, despite the protocol supporting it, we were not feeding
the EDIDs. KScreen was falling back to the output name so it didn't fail
horribly but it's still a good idea to provide all the data.
2020-10-29 14:57:50 +00:00
Aleix Pol
4150c1f047 xwl: No need to delete the source immediately
Prefer replacing then deleting the selection to the other way around.
This way less events need to be reported and the clipboard manager
doesn't get confused.
2020-10-29 15:56:13 +01:00
Aleix Pol
0549c14588 xwl: No need to create createX11Source twice consecutively 2020-10-29 15:56:13 +01:00
Aleix Pol
d335070b80 xwl: Do not refresh the x11 Clipboard while fetching
At the moment there was a race condition when putting something into the
keyboard from XWayland apps. The clipboard manager would announce a new
thing before we'd submitted it all resulting in a broken state.

This change detects when it's fetching and will only refresh the source
after everything has been sent.

BUG: 424754
CCBUG: 412350
2020-10-29 15:56:13 +01:00
Aleix Pol
439dcc4b1f xwl: Include errors and warnings 2020-10-29 15:56:13 +01:00
Vlad Zahorodnii
2715cbc86c Transform a pending repaint into a workspace repaint before destroying Deleted
The sliding popups effect schedules a repaint and then unreferences the
deleted window. The problem with doing so is that the scheduled repaint
will be effectively discarded because the Deleted will be destroyed once
we are back in the event loop.

This issue is most noticeable on Wayland. Not sure why. If you close
Kickoff, you may see its flickering ghost in background.

If it happens that a Deleted has a pending repaint, transform it into a
workspace repaint to avoid discarding any scheduled repaints.
2020-10-29 12:56:51 +02:00
Vlad Zahorodnii
5442762371 platforms/drm: Use a software cursor if the cursor image is too big
When dragging files on the desktop, the cursor image might be just too
big for the cursor plane, in which case we need to abandon hardware
cursors for a brief moment and use a software cursor. Once the files
have been dropped and the cursor image is small enough, we can go back
to using hw cursors.

BUG: 424589
2020-10-29 08:53:07 +00:00
Vlad Zahorodnii
d5ee009ba5 Fix capitalization in the word "software" 2020-10-29 08:53:07 +00:00
Vlad Zahorodnii
ae883aaa2d Include cursor theme name and size in support info
It might be useful while triaging cursor related issues.
2020-10-29 06:55:17 +00:00
Ismael Asensio
f397f072df Reply a meaningful dBus error when detecting unmanaged windows
Currently, the method `createErrorReply()` with empty strings
errors out and the client gets no answer:
```
QDBusConnection: error: could not send error message to service "":
Error name cannot be empty
```

Simple test:
qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole
qdbus org.kde.KWin /KWin org.kde.KWin.queryWindowInfo

Error name uses D-Bus Interface-like notation as suggested in
https://doc.qt.io/qt-5/qdbuserror.html#name

CCBUG: 340477
2020-10-28 21:41:21 +01:00
Vlad Zahorodnii
e5b2fca409 scenes/opengl: Use GL_CLAMP_TO_EDGE wrap mode with sw cursor
We use the GL_LINEAR magnification filter. This means that GL_REPEAT
wrap mode cannot be used for the software cursor because sampling texels
beyond the right texture edge is the same as sampling texels on the
left edge. This may produce undesired visual artifacts.
2020-10-28 19:20:46 +02:00
Ismael Asensio
329e816f16 Port from deprecated QString::SkipEmptyParts 2020-10-28 06:30:35 +00:00
Vlad Zahorodnii
7372efffc6 platforms/drm: Remove redundant args in DrmBackend::moveCursor()
Similar to the cursor image, the cursor position can be retrieved by
checking Cursors::self()->currentCursor()->pos().
2020-10-28 06:28:41 +00:00
Ismael Asensio
73f335adc2 kwinrules: Fix binding loop on coordinate editor
Only set the model value when the user explicitly interacts
with the control.

This fixes a bug where some detected properties (position
and size) were not fully applied due to the the binding loop.
2020-10-27 21:50:00 +01:00
Vlad Zahorodnii
b53d195f34 platforms/drm: Hide sw cursor if there is no pointer
Currently, if there is no pointer, only the hardware cursor will be
hidden. If the software cursor is forced, you are going to see a dead
immovable cursor.
2020-10-27 11:46:34 +02:00
Vlad Zahorodnii
170a0b6395 Provide cursor geometry in device-independent pixels
QImage::size() returns the size of the cursor image in the native
pixels. We cannot use it as the cursor size.
2020-10-27 06:04:17 +00:00
Vlad Zahorodnii
c8eeefbd7d platform/drm: Fix clipped HiDPI hardware cursors
If an output is rotated, we will compute a transform matrix for the
cursor plane to rotate its contents.

In order to compute that matrix we need the rect of the cursor in the
device-independent pixels, the scale factor and the output transform.

The problem is that we provide a rect of the cursor in the native
pixels. This may result in the cursor being partially or fully clipped.

CCBUG: 424589
2020-10-27 06:04:17 +00:00
Ismael Asensio
3d80665c0a [kwinrules] Allow negative numbers in position
This was limited by the range of the edition spinbox, not by the
rules mechanism which already allowed it.

BUG: 428083
2020-10-26 21:15:38 +01:00
Vlad Zahorodnii
0ad4901687 wayland: Provide a way to force xdg surface configure events
XdgSurfaceClient tries to avoid sending unnecessary configure events,
but in some cases, the compositor has to send one even if the surface
state hasn't changed, for example in response to a set_maximized()
request, etc.

This change introduces a special flag to indicate that the scheduled
event has to be sent no matter what.
2020-10-26 18:18:42 +02:00
Vlad Zahorodnii
4a0128cac1 Clip software cursors
If you play some video and the software cursor doesn't hover it, then
the shadow cast by the cursor will be getting darker and darker with
every frame.

The main reason for that is that kwin paints the software cursor even
if the rect behind it hasn't been damaged or repainted.
2020-10-26 13:45:55 +02:00
Vlad Zahorodnii
4b12afced9 screencast: Handle the case where pipewire is not installed
If pipewire is not installed, pw_loop_new() may return a nullptr.

BUG: 427949
2020-10-26 11:42:38 +00:00
Vlad Zahorodnii
9b09f0399f Mark the cursor as rendered after performing compositing
If a cursor animation is driven purely by frame callbacks and kwin
uses hardware cursors, the cpu usage may spike to 100%.

This change addresses that issue by sending frame callbacks after a
compositing cycle has been performed.
2020-10-26 10:02:17 +02:00
Ismael Asensio
7cf74d7df7 Revert "[kwinrules] Show defaults indicator in System Settings"
That commit broke CI's build, while it's building fine locally.

Let's revert it until having a better understanding of the cause.
Also revert the attempt to fix it, which didn't succeed.

This reverts commit 9cbac6fe3a.
This reverts commit 3e15f64055.
2020-10-25 21:26:40 +01:00
Ismael Asensio
3e15f64055 Fix CI error caused by 9cbac6fe
Include header "rulebookdata.h" instead of class forwarding.
The header is automatically generated by kcmutils_generate_module_data
and includes a namespace
2020-10-25 20:32:41 +01:00
Xaver Hugl
4462ecf6ef Detect some DrmConnector properties and ignore non-desktop displays
BUG: 419032
2020-10-25 19:18:06 +00:00
Ismael Asensio
9cbac6fe3a [kwinrules] Show defaults indicator in System Settings
The default is having no rules, so the indicator will show
whenever there is one or more rules in the list.
2020-10-25 18:57:44 +01:00
Xaver Hugl
cdab4be19e Automatically detect the proprietary NVidia driver and use EGLStreams accordingly 2020-10-25 17:47:58 +00:00
Vlad Zahorodnii
6b940c1280 scenes/opengl: Properly render cursors with hidpi
GLTexture::width() and GLTexture::height() return the size of the cursor
texture in native pixels, but we need a size in device independent pixels.

CCBUG: 424589
2020-10-25 08:57:13 +00:00
Vlad Zahorodnii
64b7cc3cf3 wayland: Fix drag-and-drop cursors with hidpi
QImage::rect() returns a rect in the native pixels, however we need a
rect that is in the device independent pixels.

CCBUG: 424589
2020-10-25 08:57:13 +00:00
Laurent Montel
2ac8611523 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 21:37:16 +02:00
Laurent Montel
9ffc8bf7d5 Now it depends against new version. Old code can be removed 2020-10-22 14:06:09 +02:00