Commit Graph

18590 Commits (1694b24fa69d4c998dc2c14f5afdc1d2a2933801)

Author SHA1 Message Date
Vlad Zahorodnii 1694b24fa6 Move some connects from Scene::addToplevel() to Window constructor 2020-11-03 14:56:36 +00:00
Vlad Zahorodnii 47ea0c98b1 scene: Stop monitoring changes for unmapped surfaces
Once the main surface has been unmapped, we are no longer interested in
any changes that indicate that the window quads cache should be discarded

This also fixes a bug where the scene holds a subsurface monitor object
even after the associated window has been destroyed.
2020-11-03 14:56:36 +00:00
David Edmundson 3d43f8ad93 Drop QGraphicsView classes in PaintData
QGraphicsRotation and Scale are QObject wrappers. It's not useful in
data structures where we're creating mulitple of these every frame. It's
large enough to appear in hotspot as taking over 1% of a regular frame.

We don't even use the QGraphicsRotation mapping inside scene for a
reason, so it's not giving us much.

It's technically an API break in libkwineffects. Pragamatically no-one
would use these. We also lose QGraphicsScale's origin, but we never
exposed this in PaintData's public header.
2020-11-03 13:19:47 +00:00
Gang Wu 28b6db4993 correct the surface id 2020-11-03 13:10:35 +00:00
David Redondo 1caf9f61d6 Disable bouncy cursor effect during ksplash
Since commit commits.kde.org/plasma-workspace/378309e666f52fc436c75648a9e6ad7d5dcbacdf
ksmserver sets a desktopname when restoring applications. This causes the effect
to draw above the splash windows while no cursor is visible.
2020-11-03 12:59:38 +00:00
Cyril Rossi c61ba64a9c KCM KWin ScreenEdge and TouchScreenEdge use KCModuleData 2020-11-03 13:36:46 +01:00
Fang Tan 03a27a0081 The client may have closed itself here,will cause kwin to crash 2020-11-03 19:25:29 +08:00
Bhushan Shah 5e6c81eea0 effects/screenshot: fix the screenshot on GLES
We want to multiply the width/height by scale weather or not we are
using GLES or not, otherwise this will only provide part of screen when
used with e.g fullscreen screenshot.
2020-11-03 09:26:49 +00:00
Lewis Lakerink 00ce98b7a2 [scene] Fix segfault in KWin::WindowPixmap::shape (BUG: 426567) 2020-11-03 07:42:27 +00:00
l10n daemon script d2051d6517 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-03 06:16:23 +01:00
Ismael Asensio cfeca03e48 kwinrules: Limit hightlight scrolling duration
By default, the rules list moves to the hightlighted item
(the one being edited) with a constant velocity. This can
be too slow when the list contains hundreds of items.

By setting `highlightMoveDuration` we set a maximum limit
for this animation.

BUG: 428139
2020-11-02 15:00:24 +00:00
Vlad Zahorodnii c3eba1e41c scenes/opengl: Do not process window thumbnails with lanczos filter
If window thumbnails have to be downscaled, it's up to the application
what filter must be used. Also, we don't really use the lanczos filter
because both x and y scale factors are 1.
2020-11-02 11:00:49 +02:00
Vlad Zahorodnii b9cbf3647e wayland: Adapt to subsurface changes in kwayland-server 2020-11-02 08:47:18 +00:00
l10n daemon script e8162aa79b 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-02 06:22:11 +01:00
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