Commit graph

20221 commits

Author SHA1 Message Date
Vlad Zahorodnii
721bfe1740 autotests: Fix TestDBusInterface
x11DesktopNumber property was replaced with the desktops property, which
is a list of desktop ids.
2021-09-30 10:29:06 +03:00
Xaver Hugl
bcbba62c7c platforms/drm: remove dangling pointer of lease outputs pipeline 2021-09-30 07:16:49 +00:00
Vlad Zahorodnii
66badd905b kcmkwin/rules: Fix suggested values for virtual desktops rule
If the virtual desktops rule is created, only the last virtual desktop
the window is on is going to be checked.

With this, all virtual desktops that the window is currently on will be
checked.

Technically, it's an api breaking change, but the window rules kcm is
the primary user of queryWindowInfo() so I don't think it's a big deal.
2021-09-30 05:40:04 +00:00
Vlad Zahorodnii
57a8d5ca50 autotests: Port testQuickTiling to AbstractOutput 2021-09-29 14:00:45 +00:00
Vlad Zahorodnii
31b9f34d9b libinput: Port to AbstractOutput
CCBUG: 443088
2021-09-29 12:03:39 +03:00
Alexander Lohnau
1022ce0036 Fix condition for making themes configurable
KPluginMetaData::findPlugins only returns valid json metdata, the previous
check was accidentally kept for the condition that the plugin provides a theme engine.

BUG: 442978
FIXED-IN: master
2021-09-28 23:08:43 +00:00
Xaver Hugl
6ca530e02b platforms/drm: fix small memory leak 2021-09-28 23:48:36 +02:00
Vlad Zahorodnii
6bbda88ab5 platforms/drm: Avoid making real commits while searching for output config
This change limits the brute force output configuration search routine
to test only commits, it's way more efficient than real commits.

CCBUG: 442603
2021-09-28 11:31:54 -06:00
Vlad Zahorodnii
eb1daa0aad platforms/drm: Avoid re-using blobs
Blobs are not reference counted if used by other drm master, if kwin
re-uses a deleted blob in an atomic commit, it will fail. For example,
on my computer, this happens when kwin starts after xorg.

Besides that, kwin may try to destroy blobs that it doesn't own, which
is not fatal but it's strange to do so.

CCBUG: 442603
CCBUG: 439873
2021-09-28 11:31:54 -06:00
Vlad Zahorodnii
6513c66ca6 wayland: Move ConnectionAdaptor to the same thread as Connection
Connection deletes the ConnectionAdaptor, but they are in different
threads, which is weird.

CCBUG: 442104
2021-09-28 17:29:34 +00:00
Aleix Pol
6cf060223e gbm: Do not create buffers when there is no display 2021-09-28 17:18:34 +00:00
Aleix Pol
9bda050d84 screencasting: Do not crash when the platform cannot provide textures
When using the QPainter backend, we will be getting null textures. Just
ignore these as the backend isn't all that important.

BUG: 442711
2021-09-28 17:18:34 +00:00
Xaver Hugl
de674e087a platforms/drm: make failure of findWorkingCombination less severe
While findWorkingCombination should never fail, in the case it does
KWin should not crash. To achieve that simply restore the old config
in case of failure.

CCBUG: 439873
2021-09-28 16:23:01 +00:00
Vlad Zahorodnii
d7d1c6600a wayland: Move ownership of the libinput thread to InputRedirection
When libinput tears down, it may access the Session object. This change
re-jitters the shut down logic so the Session object is guaranteed to be
valid when libinput stuff gets destroyed.

BUG: 442104
2021-09-28 14:37:47 +00:00
Vlad Zahorodnii
7900068cab wayland: Destroy InputRedirection explicitly
CCBUG: 442104
2021-09-28 14:37:47 +00:00
David Edmundson
ef06b8ed95 [effects] Avoid animating screenlocker backing window
ksmserver provides the backing window (the hidden black one) for the
lockscreen. We don't want to animate this fading out.

It no longer provides the logout prompt since several plasma releases.
2021-09-27 14:34:42 +00:00
David Edmundson
d3318cde15 [effects] Don't animate lockscreen via fadingpopups effects
Whilst unmanaged, it's clearly not a popup.
2021-09-27 14:34:42 +00:00
Xaver Hugl
4aebf0d730 platforms/drm: fix legacy dpms
BUG: 442969
2021-09-27 12:55:15 +00:00
Xaver Hugl
7bca5d737d platforms/drm: fix dpms tracking
DrmGpu::updateOutputs is now changing the state of some drm properties
without changing the fitting output state (namely RenderLoop inhibition)
which can lead to rendering being inhibited indefinitely in some cases
2021-09-27 12:55:15 +00:00
Vlad Zahorodnii
0f6aa1c4a8 scenes/opengl: Fix clipping with transformed screens
Software-based clipping is naive. It maps the clip region from the
global screen coordinates and intersects it with window quads. If the
window is transformed, the quads won't be clipped as expected.

Unfortunately, the OpenGL scene enables software-based geometry clipping
if the screen transformed. It's not clear why it does so, perhaps as a
performance optimization? Either way, this produces incorrect results
when the screen is scaled.

BUG: 440940
2021-09-27 06:52:49 +00:00
Ash Blake
242de43737 tablet: Check if client is supported before sending tool button
BUG: 438010
2021-09-26 09:02:21 +00:00
l10n daemon script
ced2990c8a 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"
2021-09-26 01:13:57 +00:00
l10n daemon script
45ee1969c7 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"
2021-09-25 01:15:12 +00:00
l10n daemon script
6c1447875e 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"
2021-09-24 01:13:57 +00:00
Fabian Vogt
6e1564fc17 gbm_dmabuf: Fix crash if gbm_bo_create fails
And perform proper cleanup if eglCreateImageKHR fails.
2021-09-23 16:09:11 +00:00
Vlad Zahorodnii
c94c2128bd effects/overview: Drop Kompose mode
This makes ExpoLayout easier to maintain. As is, the main issue with it
is the number of layout algorithms.

With this, the ExpoLayout is going to have two layout algorithms - one is
very simple and the other not so.
2021-09-23 16:03:49 +00:00
Xaver Hugl
416f55cea3 platforms/drm: fix hidden cursor
BUG: 438824
2021-09-23 15:54:18 +02:00
Vlad Zahorodnii
966a95e5fd wayland: Set default cursor shape for the root window
Previously, it was done by plasmashell, now it needs to be done by kwin.

BUG: 442539
2021-09-23 13:52:51 +00:00
Vlad Zahorodnii
ca1c72dd16 wayland: Fix cross cursor in Xwayland apps
Startup code in plasmashell was changed so xsetroot is not called
anymore, which is sort of fine.

Unfortunately (or not?), it exposed a bug in kwin. Cursor::x11Cursor()
only works in the standalone X11 session.

On Wayland, Cursor::x11Cursor() will return XCB_NONE which results in
seeing cross cursor when there should be arrow cursor.

This change moves xcb_cursor_t look up code from X11Cursor to the base
Cursor class. In hindsight, I would like to introduce a window manager
class where the xcb cursor and other x11 specific code can be moved in
the future for better encapsulation of platform-specific code.

CCBUG: 442539
2021-09-23 13:52:51 +00:00
Vlad Zahorodnii
29d1b25ad5 effects/desktopgrid: Schedule repaint when toggled
A repaint needs to be scheduled; otherwise the animation may not start
immediately.
2021-09-23 13:39:48 +00:00
Andrey Butirsky
f453cb83e2 fix wrong popups Z-order after applying "Show Desktop" effect
For some reason, layers are change after applying Show Desktop effect, so
we will have AboveLayer for our popups and Desktop, and NotificationLayer
for Dock which hides us.
Also, OSD and critical notifications were always hidden by our popups.

This patch solves both the issues.
Usual notifications will still be hidden, but hopefully it's not a big
issue.

BUG: 442605
2021-09-23 11:54:55 +00:00
Vlad Zahorodnii
67b94586c4 effects/trackmouse: Fix texture check
Both texture and image cannot be not null as they are initialized based
on compositing type.

BUG: 439859
2021-09-23 11:25:46 +00:00
Fabian Vogt
c83a5daf2b kconf_update/kwin-5.23-disable-translucency-effect.sh: Avoid bashism
It uses #!/bin/sh, but contained bash specific syntax.
2021-09-23 06:43:34 +00:00
Vlad Zahorodnii
df11acd467 x11: Cast Window to EGLNativeWindowType using a C cast
reinterpret_cast<>() will fail if the types we cast from and to have
mismatching sizes.

Unfortunately, there are platforms that have Window and
EGLNativeWindowType of different size. This results in compilation
errors.

In order to work around those problematic platforms, this change
replaces reinterpret_cast cast with a c style cast.
2021-09-23 09:41:19 +03:00
Amir Maimon
51925567f6 platforms/drm: Fix explicitGpus check
The check for explicitGpus in udev event handler was limited to new
GPUs, and didn't consider changes to the GPU driver, eg. from vfio-pci
to amdgpu
2021-09-23 06:35:28 +00:00
Vlad Zahorodnii
21a17c87db libkwineffects: Simplify EffectQuickView constructors
This simplifies EffectQuickView constructors and ensures that there
won't be a crash if compositing is off.
2021-09-23 06:28:29 +00:00
Vlad Zahorodnii
1b215e6c06 libkwineffects: Avoid accessing effects in EffectQuickView
EffectQuickView is used by Aurorae. As long as Aurorae decorations are
rendered by kwin, it's not a problem. However, kde-gtk-config kded
module can also render them. This creates a problem. If effects object
is not created, accessing any of its getters or setters will result in a
segmentation fault.

This change rewrites the share context check so the effects object is
not accessed anymore.

One could argue that kde-gtk-config has to provide a dummy EffectsHandler
but it doesn't use effects and libkwineffects is not a dependency of
KDecoration2. So, providing a dummy EffectsHandler makes no sense.

In hindsight, we need to revisit the usage of EffectQuickView in Aurorae
as accessing the EffectsHandler in EffectQuickView is a totally valid
usecase and integration of QOpenGLContext.

BUG: 441585
2021-09-23 06:28:29 +00:00
Vlad Zahorodnii
0b95979751 kcm/compositing: Don't reset animation speed to default value when running in plasma
When running in plasma, the animation speed slider is in General
Behavior KCM.

The Defaults button should not reset the animation speed slider because
it's hidden.

BUG: 442600
2021-09-22 15:09:46 +00:00
l10n daemon script
c27e4df375 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"
2021-09-22 01:19:05 +00:00
Vlad Zahorodnii
c29c437e58 effects/glide: Adjust the effect to projection matrix changes
With per-screen rendering, the projection matrix is no longer created
with the workspace geometry, i.e. all screen geometries united, so the
center of the workspace geometry may not map to (0, 0) in the clip
coordinates.

GLRenderTarget::virtualScreenGeometry() can be used to query the rect
that was used to create the projection matrix.

BUG: 442770
2021-09-21 12:20:19 +00:00
Xaver Hugl
6d79d855be platforms/drm: waitIdle before updating outputs
KMS can only ever have one frame pending at the moment. If we
update the outputs while a pageflip is still pending on any output
the atomic commit will fail with EBUSY, which both invalidates
the testing for output configuration and makes applying the wanted
configuration fail.

This can be removed again once KMS gains the ability to do mailbox
presentation; that will likely still take a while though.

BUG: 442677
2021-09-21 14:18:16 +02:00
Vlad Zahorodnii
2200febcd6 Restore fbo binding after updating surface texture from EGLStreams
Currently, data from client buffer EGLStream is copied to a surface
texture. An fbo is used for that purpose. The main issue with it is that
it doesn't restore the old framebuffer binding.

The surface texture can be updated in the middle of a compositing cycle.

If the framebuffer binding is not restored, any window that must be
rendered in an offscreen texture won't be rendered to the offscreen
texture.

This change makes EglStreamSurfaceTextureWayland restore the fbo binding
so the DeformEffect and software screen rotation work as expected with
the proprietary NVIDIA driver.

BUG: 442697
2021-09-21 12:41:45 +03:00
Vlad Zahorodnii
595c7a7edc Add NOTIFY signal to closeable property
QML doesn't like that the overview effect uses the closeable property
yet it has no NOTIFY signal.
2021-09-21 05:41:46 +00:00
Nate Graham
095f953847 kcmkwin/kwinscripts: Hide help button
There is no help for this KCM, so don't show the Help button.

BUG: 442460
FIXED-IN: 5.23
2021-09-20 19:52:48 +00:00
Jan Blackquill
b376f8832f Fix desktop grid border activation
BUG: 442518
FIXED-IN: 5.23
2021-09-20 14:34:11 -04:00
Jan-Marek Glogowski
6ead28a6a1 composite: adjust terminal messages (prio + text)
This makes the compositingPossible() output more elaborative,
and adjusts their priorities to qCWarning.

I thought about dropping the "Compositing is not possible"
(qCCritical) message. It's not critical for X11 and Wayland
depends on OpenGL. OTOH it's from a different component. So in
the end I settled for qCWarning again; there is no real way
to know, if the platform will consider this a critical problem
(and eventually abort).

Then I saw X11StandalonePlatform::compositingNotPossibleReason,
which has more user friendly, QT Richtext / HTML encoded output,
but this seems overkill for the terminal; now I would like to
know, where this is actually used...

While at it report "manually" suspended compositing via qCInfo
instead of qCDebug.
2021-09-20 13:18:33 +00:00
Jan-Marek Glogowski
bcdf047018 composite: log when disabled via OpenGLIsUnsafe
After updating my Debian buster to bullseye, I noticed missing
shadows / composite for KDE, which made overlapping windows hard
to recognize.

.xsession-errors just had "kwin_core: Compositing is not possible".
Using the suggested QT_LOGGING_RULES="kwin_*.debug=true" didn't
provide any more clues; nothing I tried did.
Eventually I ended reading the kwin source and found, that
disabled composite via kwinrc :: [Compositing] :: OpenGLIsUnsafe
was not reported.

IMHO all these disabling cases should use qCCritical(KWIN_CORE),
like the "Compositing is not possible" message, but for the time
being, this simply logs the OpenGLIsUnsafe reason, just like all
the others.
2021-09-20 13:18:33 +00:00
Lewis Lakerink
fc860a226e Fix screen edge detection 2021-09-20 13:15:23 +00:00
Kristen McWilliam
5fdf1da808 Add hotkey option to move active window to center 2021-09-20 13:14:24 +00:00
Kristen McWilliam
69417dd5f7 Fix required if statement before switch 2021-09-20 13:12:17 +00:00