Commit graph

1225 commits

Author SHA1 Message Date
Vlad Zahorodnii
7937aa78ef Port X11 desktop user actions menu to VirtualDesktop
It's mostly identical to the virtual desktop user actions menu on
Wayland.
2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
d5c2518973 Add Workspace::clientArea() that take no desktop
The new overloads take the client (as context) and the desired screen id
or a point and return the client area.

The main motivation behind this change is to make the transition to the
new virtual desktop model where a window can be on several desktops less
painful.
2021-08-19 10:49:40 +00:00
David Edmundson
2b88432b17 Export our nested environment to kwin's env
In the recent refactor we made it so environment variables got synced to
the Application::processStartupEnvironment.

It then seemed safe and cleaner to remove the qputenv calls, but this
was not the case. It regressed the unit tests on CI and kglobalaccel
which is another path where kwin spawns clients.
2021-08-19 09:17:43 +00:00
David Redondo
6104dc50cf xwl: Sync primary selection
Syncs the primary selection from wayland to X and from X to wayland.
Instead of doing it through the internal connection like the clipboard,
this sets/reacts to changes in SeatInterface::prrimarySelection directly.

BUG:422426
FIXED-IN:5.23
2021-08-19 06:46:23 +00:00
David Redondo
fddb83200f Fix typo
GIT_SILENT
2021-08-19 06:46:23 +00:00
Vlad Zahorodnii
4f66cd4c78 effects/overview: Make expo layout spacing configurable
This allows setting "hidpi-aware" spacing on X11.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
6132329c2c Add Overview effect
This effect is meant to be as a replacement for the present windows and
the desktop grid effect. It is written using QML.

So far, this effect implements only the basic features of the present
windows effect. Desktop management features will be added later.

CCBUG: 295775
CCBUG: 303438
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
30da8f497c scripting: Draw window thumbnails with drop shadows 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c66f38ba7d kwineffects: Add properties to EffectScreen
This allows exposing EffectScreen to effects that use js or qml.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
9675da6325 kwineffects: Allow specifying render window for EffectQuickView
QtQuick can use the render window to compute the device pixel ratio for
the managed QQuickWindow.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c51de0f370 wayland: Don't track last focused internal window
QGuiApplication::focusWindow() can be used instead.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
dd6a60beea qpa: Implement QPlatformWindow::requestActivateWindow() 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c79d7f56dd kwineffects: Disable OpenGLContext sharing check in EffectQuickView
On Wayland, QOpenGLContext::shareContext() will always return null even
if the newly created context has a share context.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
b32592f54e kwineffects: Allow disabling automatic frame scheduling in EffectQuickView 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
212090d990 Add Toplevel.stackingOrder property
This primarily targets QML scripts.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
2b06957f6f scripting: Register Workspace singleton type 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
5435865329 scripting: Introduce ClientModel V3
ClientModel V3 is much easier to extend and maintain than the one in V2.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
cecf2ee7a1 scripting: Move old ClientModel in V2 namespace 2021-08-19 06:30:55 +00:00
Ismael Asensio
f6f027aa10 kcm/kwindecoration: Fix window thumbnail sizes
Caused by a stray `units` context property that no longer exists.
2021-08-18 23:07:30 +02:00
Vlad Zahorodnii
1fbd99b572 Simplify Workspace::sendClientToDesktop()
This allows changing the type of desk to QVector<VirtualDesktop *>.

Based on the dont_activate flag, Workspace::sendClientToDesktop() will
try to focus the window if it's moved to the current virtual desktop.

In order to implement that, it needs to know whether the window has been
on the current desktop. c->isOnDesktop(desk) is a much sophisticated way
to do that.
2021-08-18 06:40:50 +00:00
Xaver Hugl
2e0336681f platforms/drm: consider KWIN_DRM_DEVICES for hotplugged gpus 2021-08-17 19:23:35 +02:00
David Edmundson
ff99100ec5 Fix build 2021-08-17 13:17:27 +01:00
Vlad Zahorodnii
0c0118f5e8 Port Workspace::takeActivity() to VirtualDesktop
Workspace::takeActivity() forces the modal dialog and its parent window
to be on the same virtual desktop. It uses int-based desktop ids for
that purpose.

This change ports the relevant parts of Workspace::takeActivity() to the
VirtualDesktop object.
2021-08-17 11:16:16 +00:00
David Edmundson
ad6ff56468 [kwin_wrapper] Port kwin_wrapper to not block
Functionally the same, but will be useful for some pending startup
changes where we have other operations.
2021-08-17 09:42:19 +01:00
David Edmundson
f541d851ed [kwin_wrapper] Transfer ownership of Xwayland socket creation and Xauthority to the wrapper
This way if kwin_wayland crashes we don't need to ensure that new
environment variables need to get synced across the new env.

This fixes an issue where spawning an xwayland application from a
wayland window that survives a crash would fail.

By moving the logic here we no longer need to wait for kwin_wayland to
start before starting plasmashell or even ksmserver as all environment
variables are set. As long as the wrapper is ready we can continue
starting and clients will just block on connect.

That should still allow for both a lot of optimisations both for speed
and cleaning up the startplasma-wayland scripts.

This will be addressed in follow up patches.

Use of kwin_wayland directly with xwayland is still supported for
testing.
2021-08-17 09:41:57 +01:00
David Edmundson
9692b49219 [kwin_wrapper] pass the wayland socket name via arguments rather than the env
The initial goal of kwin_wrapper was that it would set up all relevant
environment variables that will be used by the clients of kwin.

This meant having to cache old variables before we overrode them and
pass additional settings to the backends for the old wayland_display. It
works, but with X11 about to move too ends up being unnecessarily
complex. In hindsight it's easier for kwin to have the environment
represent the platform it is currently on, and have kwin explicitly set
variables in the QProcessEnvironment of the session it forks itnto.

This patch is changed so that we set the wayland socket name used by the
wrapper explicitly which is then used by the process environment kwin
uses for the main session.
2021-08-17 07:00:08 +00:00
Vlad Zahorodnii
9962a9fe59 Consider only windows on current desktop when snapping them
If a window is on several desktops, AbstractClient::desktop() will
return the id of the last desktop.

For example, if a window is on virtual desktops A and B, the desktop()
function will return the id of desktop B. This can be the culprit for
bugs such as window snapping not working as expected when moving a
window on virtual desktop A, e.g.

- moved window is on desktops A, and C. desktop() returns the id of C
- snap candidate (l) is on desktops A, and B. desktop() returns the id
  of B

Even though the snap candidate window and the moved window are both on
the same desktop (A), the moved window won't be snapped because the
desktop() function returns garbage values.

To fix that, the workspace needs to check whether the window is on the
current desktop.

For what it's worth, that's also how the workspace handles windows being
on multiple activities.
2021-08-17 06:24:19 +00:00
Vlad Zahorodnii
7c8d9c5b1c Port FocusChain to VirtualDesktop 2021-08-17 06:23:52 +00:00
Vlad Zahorodnii
42f2afd80d Port Workspace::findDesktop() to VirtualDesktop 2021-08-17 06:23:52 +00:00
Vlad Zahorodnii
b75f089981 Port Workspace::topClientOnDesktop() to VirtualDesktop
This patch has one behavioral change - raiseOrLowerClient() will not
work if the client is not on the current virtual desktop.

However, raiseOrLowerClient() can be called only in two cases:

* user triggers the raise or lower shortcut for the active client. Since
  the active client is on the current virtual desktop, it's not an issue

* an x11 window restacks itself. It makes no sense if an x11 window
  restacks itself while it's inactive or not on current virtual desktop.
  Also, the Opposite restack mode is rarely used, some window managers
  don't even bother implementing it. So, having such a constraint should
  not be a problem.

The main reason for not allowing raiseOrLowerClient() for windows that
are not on the current virtual desktop is that a window can be on
multiple virtual desktops. If a window is on A and B virtual desktops,
the only logical option is to toggle stacking position if the window is
on the current desktop. It's the only viable option as kwin does not
maintain per virtual desktop stacking order.
2021-08-17 06:23:52 +00:00
Ismael Asensio
76e74d7660 [kcm/kwinrules] Adapt width to new breeze style spinboxes
Also port from a stray `units` context property.
2021-08-16 15:12:34 +00:00
Vlad Zahorodnii
f5a883dc17 Port virtual desktops user action menu to VirtualDesktop
VirtualDesktop objects are more reliable than int-based desktop ids.
2021-08-16 15:00:01 +00:00
Xaver Hugl
566223b190 platforms/drm: fix crashing debug operator 2021-08-16 14:58:34 +00:00
Xaver Hugl
26dff99f78 platforms/drm: explicit modifiers
IN_FORMATS contains information about which buffer formats can be
scanned out with a given drm plane. Using these plane-specific
format+modifier combinations as well as explicit modifiers in
general can yield bandwidth and performance improvements,
especially in multi-gpu systems.
2021-08-16 16:56:32 +02:00
Vlad Zahorodnii
19cc22102c Change VirtualDesktop::id type from QByteArray to QString
This removes a lot of UTF-16 - UTF-8 conversions.
2021-08-16 16:15:57 +03:00
Vlad Zahorodnii
7f883fa724 Make EGL_KHR_surfaceless_context mandatory
We use surfaceless contexts with internal windows. We also require
the EGL_KHR_surfaceless_context extension for making context current
without outputs.

Arguably, we could use pbuffers, but since mainstream drivers (Mesa and
NVIDIA) support surfaceless contexts, the extra complexity doesn't buy
us anything.
2021-08-16 10:56:46 +00:00
Vlad Zahorodnii
4af9674f17 Revert "screenshot: Reuse GLTexture::toImage"
This reverts commit ac16bef409.

It causes crashes and color channels seem to be swapped.

GLTexture::toImage() needs more work before it can be used in the
screenshot effect, or maybe dropped.
2021-08-16 12:28:40 +03:00
David Edmundson
46980c0bb4 Fix crash in nested wayland backend on startup
In a recent refactor screens are only created when our xdg_surface has
been acked. This leaves a window where m_waylandCursor is null and
events are still being processed.
2021-08-16 08:09:42 +00:00
Vlad Zahorodnii
2a04a3d42c Remove Platform::sceneEglContext()
It's unused.
2021-08-16 08:08:31 +00:00
Vlad Zahorodnii
e315b0f9fe Remove Platform::sceneEglConfig()
With per-screen rendering, every output may have different EGLConfig.
Having a single global EGLConfig doesn't work out well.

This change removes Platform::sceneEglConfig(). It's used primarily to
create the global share context. In hindsight, the global share context
can be created without EGLConfig as it's never made current.

EGL_NO_CONFIG_KHR is part of EGL_KHR_no_config_context extension, which
is supported by both Mesa and NVIDIA driver so it should be safe to make
it mandatory.
2021-08-16 08:08:31 +00:00
Vlad Zahorodnii
bc7b28bb65 Fix a typo
At this point, desktop() is -1 since the client hasn't been moved to any
virtual desktop yet.

It seems like checking desktop() is a typo. It makes more sense to check
desktopId.
2021-08-16 06:32:43 +00:00
Vlad Zahorodnii
7f04d730e6 Make WindowRules::checkDesktop take a list of desktops
This ports relevant apis in WindowRules to the VirtualDesktop class.

If the client has no desktop rule, the desktop list that has been passed
to the checkDesktops() function will be returned.

If the client has a desktop window rule, the checkDesktop() function
will return a list with a single VirtualDesktop object or none if the
window is forced to be on all virtual desktops.
2021-08-16 06:32:43 +00:00
Vlad Zahorodnii
8e8fc55b0b Simplify desktop check in AbstractClient::setOnAllDesktops() 2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
86fa79c33b Use more Toplevel::isOnCurrentDesktop() 2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
43d773730d Unify virtual desktop removal handling on X11 and Wayland
On X11, a window can be only on a single virtual desktop or all, so the
platform specific code paths are not needed.
2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
7f1baf66f9 Port some code away from AbstractClient::setDesktop() to AbstractClient::setDesktops()
The main motivation behind this change is to reduce the number of usages
of int-based virtual desktop apis. int-based desktop ids are highly
unreliable. For example, if a new virtual desktop is inserted in the
middle or removed in the middle, the desktop ids will change. This makes
working with virtual desktops code more challenging due to its behavior.
This is not an issue with VirtualDesktop objects.
2021-08-16 06:31:59 +00:00
Manuel Stoeckl
2aa3ed0005 Use texture unpacking for QImage uploads when possible
This change avoids unnecessary copying of QImage data when updating
textures using QImages that have non-ARGB32_Premultiplied formats.

There are three cases where texture unpacking can not be done/is
not worth doing: if GLES is used, and the extension for unpacking
subimages is not supported; if the entire image is being updated;
or if a format conversion needs to be done, in which case only the
region to update will have its format converted, and the resulting
image can be passed directly to glTexSubImage2d without setting
unpacking parameters.
2021-08-16 06:30:59 +00:00
l10n daemon script
214a318811 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-08-16 01:12:48 +00:00
l10n daemon script
d6f16882ff 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-08-14 01:18:16 +00:00
Méven Car
c5907e8f36 Fix a few compile warnings 2021-08-13 20:56:45 +02:00
Vlad Zahorodnii
3982f8399f Remove some redundant addWorkspaceRepaint() calls
These repaints were added to fix visual artifacts that appear when
shadow is removed, but since items schedule repaints when needed, we can
remove these two.
2021-08-13 06:28:18 +00:00
Vlad Zahorodnii
ec8a9f7cf7 Add isOnDesktop() overload that takes VirtualDesktop
int-based desktop ids are unreliable, but VirtualDesktop are not. So far
virtual desktop objects aren't used widely in kwin, but it's a good start.
2021-08-13 06:27:46 +00:00
Vlad Zahorodnii
a7cb034513 Simplify Toplevel::isOnDesktop() and Toplevel::isOnAllDesktops()
Wayland- and X11-specific code paths are not needed.

If the window is on all virtual desktops, Toplevel::desktops() will be
an empty list.

If the window is on a particular virtual desktop, Toplevel::desktops()
will contain that desktop. On X11, the desktops list can have at most
only one item.
2021-08-13 06:27:46 +00:00
Xaver Hugl
724f9a5db0 Correct check for when VRR should be active
The old calculation ignored the render time and safety margin of the
frame scheduling algorithm, which makes VRR activate properly only when
the refresh rate is much lower than the maximum refresh rate.
2021-08-12 20:38:45 +00:00
Vlad Zahorodnii
ef9d541487 Remove unused XCB includes in toplevel.h
Damage handling has been moved to SurfaceItemX11.
2021-08-12 20:57:17 +03:00
Vlad Zahorodnii
363177f36f Remove unused markedAsZombie signal 2021-08-12 17:52:24 +00:00
Vlad Zahorodnii
7e9c6587db Remove scene window traces in scene items
This further decouples scene items from scene windows. The SurfaceItem
still needs to access the underlying window, I would like to re-iterate
over that later.

With this change, it will be possible to introduce WindowItem factory
function in the Toplevel class.
2021-08-12 17:52:24 +00:00
Vlad Zahorodnii
a13fd02ea8 Remove virtualdesktops.h include in toplevel.h
toplevel.h is included in many places. Changing virtualdesktops.h may
trigger rebuild of all kwin.

With this change, only cpp files that use virtualdesktops.h will need to
be recompiled.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
f71686894d Remove unused includes in x11client.h 2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
a848fb6374 Remove input.h include in toplevel.h
It's unused.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
0197d770ab Drop Toplevel::transparentRect()
It can be computed via other means (Toplevel::frameMargins()) and its
name is confusing. It specifies the inner decoration rect.
2021-08-12 17:22:49 +00:00
Aleix Pol
ac16bef409 screenshot: Reuse GLTexture::toImage
Cleans the code a bit. It also makes use of the more performant
Qt::Format_RGBA8888_Premultiplied, which is nice to come by.
2021-08-12 16:00:52 +00:00
Aleix Pol
1473466ef7 inputmethod: Remove the SNI entirely
It can be replaced with an ad-hoc plasmoid that gets to be a bit more
specific and interactive.
2021-08-12 16:00:15 +00:00
Vlad Zahorodnii
ad4f183a76 x11: Drop support for _NET_WM_FRAME_OVERLAP
The main idea behind _NET_WM_FRAME_OVERLAP is to extend the borders of
the server-side decoration so the application can draw on top of it. It
was inspired by similar feature in Windows.

However, _NET_WM_FRAME_OVERLAP is basically unused. Neither GTK nor Qt
support it and I have never seen any application that uses it.

At the moment, kwin is the only compositing window manager that supports
_NET_WM_FRAME_OVERLAP. Neither mutter nor compiz nor compton and so on
support it.

Since _NET_WM_FRAME_OVERLAP is practically unused, there's no point for
keeping supporting it.

This change shouldn't affect any existing app as _NET_WM_FRAME_OVERLAP
atom is not listed in _NET_SUPPORTED.
2021-08-12 11:44:40 +00:00
Vlad Zahorodnii
4ca287641f wayland: Destroy xdg shell clients when corresponding roles are about to be destroyed
This ensures that surface role objects can be still accessed when either
XdgToplevelClient or XdgPopupClient is destroyed. As far as I know, it
doesn't cause any problems right now, but this makes resource destruction
handling consistent, we tend to perform cleanup in aboutToBeDestroyed
signal slots.
2021-08-12 13:03:35 +03:00
Manuel Stoeckl
51d82fc6e5 Replace an old workaround for alpha-only shadows
SceneOpenGLShadow::prepareBackend used to use QImage::Format_Indexed8,
plus a special code path in GLTexture, to create single-channel OpenGL textures.
Now that Qt supports QImage::Format_Alpha8, this workaround can be removed.
2021-08-11 23:32:18 -04:00
l10n daemon script
4ab4f928f0 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-08-12 01:14:37 +00:00
Vlad Zahorodnii
4912c7cfa2 scenes/opengl: Calculate item transforms differently
Currently, a vertex coordinate is transformed first, then mapped to
the global screen coordinates. This causes a problem if a transform
is applied to the top-most item and child items are not at (0, 0).
For example, scaled windows may have popping out sub-surfaces, etc.

With this change, the item transforms will be computed differently. For
example, if the parent item is transformed, a child's transform will
look as follows

  [Parent's translation][Parent's transform][Child's translation]

instead of

  [Parent's translation][Child's translation][Parent's transform]

In the future, I'd like to get rid of the Item::setTransform() call in
OpenGLWindow::performPaint() and have either AnimationEffect or
libkwineffects call Item::setTransform().

BUG: 440201
2021-08-11 19:43:31 +03:00
David Edmundson
60255fd7a9 Teardown view before QQuickRenderControl
Deleting QQuickWindow will force any remaining runnables to complete.
This is important for any items (such as our new ThumbnailItem) that
deletes resources in queued cleanups.

We need to invoke this manually whilst we still have an active render
control with a valid context, otherwise remaining runnables will no-op.

We also then want to manually delete our scene contents before the view
so they're not orphaned temporarily.

This fixes a memory leak observed with the new Overview effect.
2021-08-11 07:31:53 +00:00
Vlad Zahorodnii
fdb1914a83 wayland: Wire in surface mapped state
If a sub-surface should be considered unmapped, make the corresponding
item invisible.

Note that this must apply only to sub-surfaces. Whether the main surface
should be visible is up to kwin. It may want to play an animation when
the toplevel surface is unmapped, etc.
2021-08-11 06:41:00 +00:00
Manuel Stoeckl
aa386896f1 Rename QImage to GL format conversion table
Also expand the comment describing it.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
b440be5bd2 Avoid converting images when updating GLTexture
In GLTexture::update, reuse the mechanism from the GLTexture(QImage, ...)
constructor to upload QImage data directly when the QImage format
has compatible GL format and type codes. Before this change, all QImage
formats other than ARGB32_Premultiplied required a format conversion.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
9be3513348 platforms/wayland: Delay setup until first configure
As per the xdg-shell specification, the compositor can only attach
a wl_buffer to an xdg_surface once the compositor has sent an
xdg_surface.configure event. Previously, there was a race condition
in which WaylandOutput objects were added/enabled on creation, making
it possible for the EglWaylandOutputs to be set up and for
EglWaylandBackend to draw a frame (thereby attaching a buffer), all
before the xdg_surface.configure configure event was received.
Compositors other than kwin would then send an unconfigured buffer
error and close the connection.

This commit avoids the problem by not marking the WaylandBackend
ready for use until all the output surfaces constructed at startup
have received their initial configure event. (In practice, this
takes one additional roundtrip.)
2021-08-10 14:21:12 +00:00
Alexander Volkov
1bf901cfbf Use c++ version of True to make sure it will compile
kwin fails to build for me because of missing 'True'.
Besides, 'true' is used in other places.
2021-08-10 10:46:07 +00:00
Nicolas Fella
050b4945ce [kcms/decoration] Try loading decoration KCMs without plugin keyword
We're porting away from using plugin keywords (and have done that for
the breeze and oxygen decoration). However to allow that we need to
adjust the loading code.

Keep the old codepath for compatibility.

BUG: 440786
2021-08-10 10:14:24 +00:00
Fabian Vogt
11c7e7a64d scenes/opengl: Avoid blending for entirely opaque SurfaceItems
Blending is quite expensive especially with software rendering.
In the case of Firefox on Wayland, it uses a ARGB8888 buffer but marks the
entire surface as opaque, so the alpha channel can be ignored.

CCBUG: 440386
2021-08-09 06:52:12 +00:00
Xaver Hugl
1041ef8275 platforms/drm: introduce virtual outputs
When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.

CCBUG: 420160
CCBUG: 438839
2021-08-07 17:18:40 +02:00
l10n daemon script
f7e2f5504a 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-08-07 01:15:04 +00:00
Vlad Zahorodnii
1dae29175f kwineffects: Fix potential image detaching
QImage is implicitly shared. However, methods such as QImage::bits() may
detach. In order to avoid the detach, one either needs make the image
const or use QImage::constBits() method.

Currently, the GLTexture class uses QImage::bits() all over the place.
It prevents implicit detaching by storing images in const variables. Such
code is fragile. Adding an intermediate (optional) conversion step may
result in odd performance regressions.
2021-08-06 07:20:54 +00:00
l10n daemon script
f4c0e19935 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-08-06 01:16:36 +00:00
Xaver Hugl
7879450cdf platforms/drm: work around tigerlake bug
CCBUG: 440361
2021-08-05 12:25:54 +00:00
Vlad Zahorodnii
e94fbcd853 Copy shape region to Deleted
Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.

If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.

BUG: 440001
BUG: 438458
BUG: 435378
2021-08-05 06:03:11 +00:00
l10n daemon script
d47b27f9cd 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-08-05 01:15:06 +00:00
Alexander Lohnau
e34d8bbed6 Consistently name kpackage structures
This will allow kpackage to load the structures by their path.

Task: https://phabricator.kde.org/T14757
Conceptually the same direction as https://phabricator.kde.org/T14499.
2021-08-04 18:42:31 +00:00
Alexander Lohnau
9fe294776d Define new KPackageStructure property in kpackage structures
Task: https://phabricator.kde.org/T14563
2021-08-04 18:42:31 +00:00
Alexander Lohnau
370f0c0b22 Clean up unneeded service type definitions in kpackage structures
Task: https://phabricator.kde.org/T14483
2021-08-04 18:42:31 +00:00
Xaver Hugl
81136a0448 platforms/drm: drop unused methods 2021-08-04 15:06:43 +02:00
l10n daemon script
7db6ea0c15 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-08-04 01:15:43 +00:00
Aleix Pol
896880be96 Revert "Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372"
https://invent.kde.org/plasma/kwin/-/merge_requests/1220

This reverts commit 44ad9437c4 because it
breaks build:
platforms/x11/common/eglonxbackend.cpp:224:66: error: cannot initialize a parameter of type 'EGLNativeWindowType' (aka 'unsigned long') with an rvalue of type 'xcb_window_t *' (aka 'unsigned int *')
        surface = eglCreateWindowSurface(eglDisplay(), config(), &window, nullptr);
                                                                 ^~~~~~~
2021-08-03 18:09:04 +02:00
nerdopolis turfwalker
44ad9437c4 Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372 2021-08-03 08:28:04 -04:00
l10n daemon script
b90d92a8fb 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-08-03 01:15:25 +00:00
Andrey Butirsky
998bbf4eba fix wrong cursor hotspot under Wayland on VMs 2021-08-02 09:03:07 +00:00
David Edmundson
47e38b7141 Disconnect frame renders when ThumbnailItem has no window
It is perfectly valid to have a case where an item exists but has no
window. During these times the item will never be rendered.

Rather than guard in updateOffscreenTexture, it's more economical to
disable the frame rendering in the first place. Especially as then it's
easy to extend to item visibility.

BUG: 440318
2021-08-02 08:43:27 +00:00
l10n daemon script
cf9c60a0c0 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-08-02 01:12:21 +00:00
Xaver Hugl
2e473a21fb platforms/drm: small logging improvements 2021-08-01 23:26:49 +02:00
l10n daemon script
d2aac8cb05 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-08-01 01:21:11 +00:00
David Redondo
3b9ffdfbf6 Revert "Do not pass input to windows that are not painted"
This reverts commit 09f786a209.
2021-07-30 17:08:48 +02:00
David Redondo
09f786a209 Do not pass input to windows that are not painted
Passing input to windows that we do not paint is confusing as what happens
is different from what is visible on the screen.
2021-07-30 16:22:37 +02:00
l10n daemon script
141f627413 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-07-30 01:11:30 +00:00
l10n daemon script
ac438d6bb3 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-07-29 01:15:05 +00:00
Aleix Pol
475993db70 kscreen effect: Work per screen
Makes it possible to apply the dpms settings per screen instead of
applying it to all of them, which is wrong at many levels.
Will be even more important with other effects like rotation.
2021-07-28 10:57:27 +00:00
Alex Richardson
ed57ac39e2 Convert the KPackage plugin metadata to .json 2021-07-28 11:09:38 +01:00
Nate Graham
9f00c29c67 [kcmkwin/kwinrules] Port OverlaySheet headers to use title: property
This was added to Kirigami in
https://invent.kde.org/frameworks/kirigami/-/merge_requests/314
and simplifies and standardizes the creation of simple text-based
headers in OverlaySheet. This commit ports the KWin Rules KCM to
use it.
2021-07-27 15:17:41 -06:00
David Edmundson
beedf2be71 Fix minor typo 2021-07-27 13:20:24 +01:00
David Edmundson
0c6a8e7b88 Avoid setting crash count to 0 when restarted
If kwin is explicitly restarted (kwin_wayland --replace) we reset the
crash count so that you can run it more than 10 times without exiting to
the logout screen.

Resetting to 0 causes a issue as that triggers ksplash to be shown
again.

BUG: 434489
2021-07-27 12:18:29 +00:00
David Edmundson
ec9c2c3e68 Port kwin_wayland_wrapper to Qt/C++
We inintially created the wrapper to be light so avoided the QtCore
dependency and did it all in C.

In hindsight changing requirements means we want to add several more
features in here. The first step is to port to a more readable language
and toolkit.
2021-07-27 12:18:29 +00:00
l10n daemon script
5317ca9da0 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-07-27 01:25:25 +00:00
Vlad Zahorodnii
ca301d1914 Drop Scene::ImageFilterType
It's unused, GL_LINEAR filter is used by default now.
2021-07-26 14:56:21 +00:00
Vlad Zahorodnii
cb219da766 Remove screenGeometryChanged() in OpenGLBackend and QPainterBackend
The screenGeometryChanged() function is very X11-specific. On Wayland,
it's effectively unused.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
4ecb00889c scene: Move overlay window resizing to backends
The concept of an overlay window is not universal, it's X11 specific.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
e171555f2d Remove stray friend class 2021-07-26 16:25:02 +03:00
David Redondo
d84198f3b8 Set component display name for touchpad and keyboard shortcuts
Otherwise they appear as "KWin" in the settings when we want them
to be "Touchpad" and "Keyboard Layout Switcher".
BUG:440259
FIXED-IN:5.23
2021-07-26 10:37:48 +02:00
Vlad Zahorodnii
d4c7486fe1 Remove Q_UNUSED
damage is used.
2021-07-26 08:40:41 +03:00
Vlad Zahorodnii
3ab2ea40c4 Remove mask arg in Scene::paintScreen()
Render backends don't pass anything to the scene.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
d2b6d7ee59 platforms/wayland: Add support for buffer age in qpainter backend 2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
1cbf232b98 platforms/wayland: Report correct damage to host compositor
damageHistory.first() is the previous damage region, we need to report
the current instead.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
e087b2ce2f platforms/drm: Add buffer age support in qpainter backend
Currently, the entire screen will be repainted when using the qpainter
render backend. With this change, kwin will repaint only the dirty parts
on the screen.
2021-07-25 09:59:00 +03:00
Vlad Zahorodnii
603db353a3 scenes/qpainter: Avoid setting brush in paintBackground()
Calling QPainter::setBrush() without saving the current state, produces
mysterious black rectangles around clip region rects.
2021-07-24 16:32:16 +03:00
Vlad Zahorodnii
501298b0e0 Introduce DamageJournal helper 2021-07-24 16:32:13 +03:00
Vlad Zahorodnii
2fe102768a Remove QPainterBackend::needsFullRepaint()
A better alternative is to return the damage region in the beginFrame()
function. This way, the render backend can force full screen repaints or
indicate what parts of the buffer needs to be repainted (for buffer age)
2021-07-24 14:54:17 +03:00
Vlad Zahorodnii
4abbb6f0d6 Make OpenGLBackend and QPainterBackend QObjects
Almost all their subclasses are QObjects. This simplifies the class
hierarchy by making OpenGLBackend and QPainterBackend qobjects.
2021-07-24 11:30:13 +03:00
Vlad Zahorodnii
d543c0dff6 Remove unused mask param in QPainterBackend::endFrame()
It is unused and it is not a good idea to pass Scene's mask to the
render backend as it results in higher coupling between Platform and
Scene.
2021-07-23 20:42:59 +00:00
Nicolas Fella
a317a3f6bc Remove unused include 2021-07-23 19:51:11 +02:00
Vlad Zahorodnii
85654236d7 Fix build 2021-07-23 18:45:54 +03:00
Vlad Zahorodnii
964c487d4f wayland: Switch to ClientBuffer
The main motivation behind the split is to simplify client buffer code
and allow adding new features easier, for example referencing the shm
pool when a shm buffer is destroyed, or monitoring for readable linux
dmabuf file descriptors, etc.

Also, a referenced ClientBuffer cannot be destroyed, unlike the old
BufferInterface.
2021-07-23 15:33:38 +00:00
Andrey Butirsky
95e954da30 [tabbox] prevent dangling popups when switching on Wayland
If some popups of active window present, there was glitches on switching
such as stale popups or the popup happened below window.
Dismissing all the popups solves the problem.

BUG: 431046
2021-07-23 12:12:03 +00:00
Andrey Butirsky
b45f5c3a66 fix No globalshortcuts with popup grab
BUG: 431046
2021-07-23 12:12:03 +00:00
Nicolas Fella
25b85607d0 Port from KPluginLoader::pluginsById to KPluginMetaData::pluginById
The latter gives us only a single plugin which makes the code a bit more concise
2021-07-22 22:59:13 +02:00
Aleix Pol
05f3939cf1 inputmethod: Use the command as the availability metric 2021-07-22 20:12:54 +02:00
Aleix Pol
278da74eab inputmethod: Add a property to tell whether an input method is running 2021-07-22 17:42:53 +02:00
Vlad Zahorodnii
f431b6ad96 wayland: Cache last surface-to-buffer matrix
If window quads need to be generated after the wl_surface is destroyed,
the SurfaceItemWayland::mapToBuffer() function will return wrong values.

In order to fix that, we need to store the last surface-to-buffer matrix
in SurfaceItem.
2021-07-22 06:26:00 +00:00
l10n daemon script
068c1d4970 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-07-22 01:15:50 +00:00
Nicolas Fella
2faff3b1d0 [kcms/kwinoption] Remove obsolete desktop files and factory registrations
These appear to be remnants from a time where the current tabs were individual KCMs.

Remove some unneeded stuff and convert the only relevant registration to the normal K_PLUGIN_FACTORY macro
2021-07-21 19:42:45 +00:00
Nicolas Fella
cff33e7e40 [GenericScriptedConfig] Remove unused parameter
The passed value is always the same and never used
2021-07-21 19:42:15 +00:00
Nicolas Fella
55c6de1790 [kcms/effects] Remove unneeded X-KDE-PluginKeyword 2021-07-21 21:15:26 +02:00
Nicolas Fella
2f9adf4715 [effectsmodel] Simplify generic config plugin loading
We know exactly which plugin we want to load

No need to go through findPlugins()
2021-07-21 16:10:19 +02:00
Aleix Pol
422522d15b inputmethod: Also expose the visibility on dbus
Since we adapted inputmethod to support methods like ibus, the input
method can be active but not have a visible panel.
This includes an extra property that will indicate us if the panel is
visible at any time. This will allow us to properly render the virtual
keyboard hide button in Plasma Mobile (or wherever we need it).
2021-07-21 13:10:30 +02:00
Aleix Pol
abf22570c7 inputmethod: Reduce consecutive activation+deactivation+activation sequences
So far calling setActive(true) would issue a deactivation then another
activation. This sometimes makes maliit crash and we can achieve the
same result just by just issuing a reset.
2021-07-21 13:10:30 +02:00
Aleix Pol
638174ae09 inputmethod: Make sure the menu is only created when we create the SNI
It always does the same anyway, this way we make sure we don't leak
2021-07-21 13:10:30 +02:00
Aleix Pol
0169bca6e0 inputmethod sni: return early for readability 2021-07-21 13:10:29 +02:00
Michal Malý
d2ceea83b7 (Wayland) Allow moving windows from one virtual desktop to another with a single action 2021-07-21 10:43:58 +00:00
Vlad Zahorodnii
b344afd8cd wayland: Fix glitchy steam during interactive resize
Xwayland windows have two geometry types that are used during rendering
- wl_surface's geometry and x11 window's geometry. Unfortunately, it's
not possible just ignore the x11 window geometry because the window may
have a custom shape region. Pixels outside the shape region can have
arbitrary values; it's not guaranteed that the area outside the shape
region will be transparent.

In some cases, the x11 window geometry can be larger than the wl_surface
rect. That breaks repaint logic as the SurfaceItemXwayland can draw
outside the bounding rect.

Specifically, this issue can be seen while resizing Steam interactively.
Another example is where a video game enters fullscreen mode. I
occasionally see that Red Dead Redemption II window leaves a ghost after
itself when it switches to fullscreen mode.

It's not a perfect solution, but on the other hand, it doesn't look like
there's a better way to handle this due to the fact that there are two
conflicting geometry sources.
2021-07-20 05:33:53 +00:00
l10n daemon script
f14350e1bb 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-07-20 01:17:06 +00:00
Vlad Zahorodnii
d29954ae33 scripting: Make QTimer constructible
If a QObject is exposed to js using QJSEngine::newQMetaObject(), a new
instance of it can be made only with constructors exposed by Q_INVOKABLE

At the moment, QTimer's constructor is not Q_INVOKABLE, so code such as
`const timer = new QTimer()` will not work.

BUG: 439630
FIXED-IN: 5.22.4
2021-07-19 12:14:16 +03:00
Vlad Zahorodnii
73bfe648ef wayland: Notify Qt about activated/deactivated windows
Currently, internal windows are not marked as active. This breaks focus
logic in QtQuick.
2021-07-19 06:40:06 +00:00
Vlad Zahorodnii
a3e192837b wayland: Force decoration update
If the client had created an xdg-toplevel-decoration and has called the
set_mode() request with csd before the initial configure event is sent,
we still need to send an xdg-toplevel-decoration configure event with
csd mode.
2021-07-19 06:39:37 +00:00
Vlad Zahorodnii
9e5cb836a3 scripting: Provide hidpi window thumbnails 2021-07-16 17:11:46 +00:00
Xaver Hugl
97f8bfac5c platforms/drm: where necessary, disconnect CRTCs after VT switch 2021-07-16 17:19:26 +02:00
Xaver Hugl
f9f474d7e4 platforms/drm: fix property updating
A wrong index caused some properties to contain wrong values
2021-07-16 16:34:40 +02:00
Xaver Hugl
afcef2a6f8 platforms/drm: fix crash with secondary GPUs and buffer age
CCBUG: 433107
2021-07-15 11:42:57 +00:00
Vlad Zahorodnii
7863f3dc31 Add NOTIFY to toplevel x/y/width/height properties
Currently, when using Toplevel's x, y, width, and height properties in
qml, a bunch of warnings will be printed about missing NOTIFY.
2021-07-14 12:32:14 +03:00
Vlad Zahorodnii
64f7c03083 wayland: Emit geometryChanged signal if transform changes
If the output transform changes, the geometry may change as well;
otherwise qpa may not call QWindowSystemInterface::handleScreenGeometryChange()
with the corresponding platform screen.
2021-07-13 10:06:30 +00:00
Vlad Zahorodnii
adac3b8646 scripting: Guard against the case where a window is destroyed after changing visibility
If the visiblityChanged signal is emitted and then the window is
immediately destroyed, the slot will still be executed because the
connection has type of Qt::QueuedConnection.
2021-07-13 12:50:56 +03:00
Aleix Pol
23129c09ce SceneOpenGL2::paintCursor make sure the OpenGL context is current
Instead of painting right away when Cursors::currentCursorChanged is
emitted, mark as dirty and call again when paintCursor is called.

BUG: 439134
2021-07-12 13:15:29 +00:00
Xaver Hugl
2977ae8e37 platforms/drm: don't take the rotation property for granted
Should fix the crash on the pinephone
2021-07-12 14:28:38 +02:00
Xaver Hugl
3c28a78956 Fix build 2021-07-10 23:54:08 +02:00
Xaver Hugl
303132ae0f platforms/drm: update plane properties before updating outputs
Seems like some drivers change the properties in the time it takes to
initialize the scene
2021-07-10 21:18:37 +02:00
Xaver Hugl
b23dfd55ac platforms/drm: optimize cursor setting 2021-07-10 21:18:37 +02:00
Xaver Hugl
5ad0d18476 platforms/drm: update properties on VT switch and failing commits 2021-07-10 21:18:37 +02:00
Xaver Hugl
586efe94d4 platforms/drm: Introduce DrmPipeline
DrmPipeline is now what contains all the thing related to drm calls,
instead of DrmOutput. This allows for some more flexibility and tidies
the code up a bit. Additionally instead of rolling back changes if
presentation fails, changes are directly tested with atomic test only
commits.
2021-07-10 21:18:33 +02:00
Xaver Hugl
92726372f4 platforms/drm: simplify deleted output handling 2021-07-10 20:13:01 +02:00
Xaver Hugl
c89961a4e2 platforms/drm: save modelist in DrmConnector 2021-07-10 20:13:01 +02:00
Xaver Hugl
ee4b4fc9a3 platforms/drm: refactor presentation in gbm backend 2021-07-10 20:13:01 +02:00
Xaver Hugl
da71d218c8 platforms/drm: refactor the gbm surface 2021-07-10 20:13:01 +02:00
Xaver Hugl
4b5571163e inputmethod: save enabled state 2021-07-10 17:47:45 +00:00
Xaver Hugl
fe11219a0c improve gesture recognition
In order to not make misdetections with sub-pixel movements the gesture
recognizer completely ignored those. This fails however when you move
your fingers very slowly, so instead accumulate the delta and only use
it for direction detection if it's high enough.
2021-07-09 20:28:04 +00:00
Aleix Pol
eb62dbb9c5 Allow the KScreenEffect to work on Wayland
Makes it possible for wayland systems to show a dimming effect when a
display dpms is off.
2021-07-09 12:39:42 +02:00
Aleix Pol
1012adeaf7 Add support to DPMS to the Wayland Backend
Moves the DpmsInputEventFilter to libkwin, so that it can be used by
other backends other than DRM.
This mostly helps develop features around DPMS.
2021-07-09 02:41:26 +02:00
Xaver Hugl
caa8c8fd45 platforms/drm: always populate atomic req with connector props
If we don't then overscan and underscan are never applied
2021-07-08 16:14:25 +00:00
Xaver Hugl
4d8ae93f06 platforms/drm: fix underscan
The enums belong to "underscan", not to "underscan hborder".
The aspect ratio also needed correction
2021-07-08 16:14:25 +00:00
Vlad Zahorodnii
be6c33458f wayland: Allow placing sub-surfaces below their parent
According to the spec, if the wl_subsurface.place_below request is
called with the parent surface, the sub-surface must be placed below the
parent surface.

BUG: 438808
2021-07-08 06:55:38 +00:00
Vlad Zahorodnii
4ebe5d32b4 scene: Introduce z-property
This allows placing child items below their parent item by setting
negative Z values.
2021-07-08 06:55:38 +00:00
Vlad Zahorodnii
2a1f9f1646 wayland: Switch to SurfaceInterface::{below,above} 2021-07-08 06:55:38 +00:00
Xaver Hugl
a1847f77f1 platforms/drm: only show cursor on dpms on if not hidden
While always calling showCursor isn't a problem for when there's no
pointing device as the cursor image is empty in that case, it can
cause a temporarily stuck cursor image when it's supposed to be
hidden because of touch input
2021-07-07 21:05:49 +02:00
Xaver Hugl
925ff96401 platforms/drm: support underscan 2021-07-07 15:03:39 +02:00
David Redondo
5fe6de699c Handle when a xdg-toplevel changes its min or max size
We previously never emitted maximiziableChanged() meaning we never
synced the state to the decoration.
BUG:439578
2021-07-07 14:17:36 +02:00
David Edmundson
e35ed5088a [rules] Allow setting WindowType to KDE specific window type OSD
An example use case is allowing a user to write rules to put firefox
Picture in picture windows above fullscreen users

CCBUG: 439573
2021-07-07 10:32:29 +00:00
Vlad Zahorodnii
8b1e2fd50e kcmkwin/compositing: Remove Crisp scale method
The OpenGL backend now supports only smooth and accurate scale methods.
2021-07-06 12:34:59 +00:00
Vlad Zahorodnii
95adc883aa scenes/opengl: Use GL_LINEAR also on X11
We've been using GL_LINEAR on Wayland for a couple of years, and it has
caused us no issues. For the consistency sake, let's do the same on X11.
2021-07-06 12:34:59 +00:00
Andrey Butirsky
8da06a0bdb fix Meta key randomly stops opening Plasma launcher menu
BUG: 391322
2021-07-06 10:43:52 +00:00
Vlad Zahorodnii
1e1ad82f3b Remove unused geometry setters in Item
Originally, only x, y, width, and height property setters were used. A
bit later "position" and "size" helper setters were added to simplify
code in SurfaceItem sub-classes. It seems like setX(), setY(), setWidth(),
and setHeight() are unused now, so remove them.
2021-07-05 20:55:30 +03:00
Vlad Zahorodnii
db6b4c9c2e Update parent item's bounding rect explicitly
If the parent's bounding rect may change, call its update method
explicitly. This way the code is more readable as there is less
signal-slot magic.
2021-07-05 20:53:08 +03:00
Vlad Zahorodnii
fb276dbdd2 scene: Avoid discarding quads in more cases 2021-07-05 13:54:47 +00:00
Aleix Pol
0a1a4d362b tablet: Update the cursor as the surface changes
The tablet protocol offers us the cursor in a surface. This patch makes
sure we connect to the surface so that we can also refresh the
representation if the client submits a change.

BUG: 437777
2021-07-05 13:23:03 +00:00
Aleix Pol
d706d98e86 cursor: remove unused attribute 2021-07-05 13:23:03 +00:00
Vlad Zahorodnii
29ff0d30ad x11: Fix BadDamage warning
The XDamageDestroy has a weird requirement saying that it can be called
as long as the X11 window is still valid. On the other hand, one could
argue that it is more intuitive if the damage handle becomes inert if the
associated window is destroyed. Unfortunately, that's not the case and
as git history shows, it's an easy way to shoot yourself in the foot, we
had the exact warning many years ago.

The problem with the XDamageDestroy API is that it is simply unreliable
given the asynchronous nature of communication between kwin and xorg.

Anyway, with X11 sunsetting, let's destroy the damage handle only when
the X11 window is unmapped and not bother too much about it.
2021-07-05 13:22:07 +00:00
Erik Kurzinger
770875a76e platforms/drm: check wl_eglstream buffers before attaching
If a wl_eglstream buffer is attached to a surface, but then later a different
type of buffer, such as a dmabuf, is attached to the same surface, kwin will
mistakenly keep trying to acquire frames from the EGLStream associated with the
previous buffer. This can happen if an Xwayland window is made full-screen
causing it to switch to the flipping presentation path, for instance. The
result is that the window contents will no longer be updated.

Instead, the eglstream backend's loadTexture and updateTexture functions should
first pass the buffer to eglCreateStreamAttribNV. If it fails with
EGL_BAD_STREAM_KHR, that indicates it is indeed a wl_eglstream, and that we've
already associated a server-side EGLStream with it in attachStreamConsumer, so
we can proceed as usual. If it fails with EGL_BAD_ACCESS, though, that
indicates it is not a wl_eglstream and we should fall back to the parent class
which handles attaching other buffer types. If it doesn't fail at all, that
means the client tried to attach a new wl_eglstream to a surface without first
attaching the stream consumer. There's not really a great way to handle this,
so just re-use the previous EGLStream.
2021-07-05 11:13:24 +00:00
Vlad Zahorodnii
a1c6e2584a x11: Re-use Qt's EGLDisplay
This is to ensure that both kwin and Qt use the same EGLDisplay. Note
that the native context handle can have no display, however it's very
unlikely to happen.
2021-07-05 09:14:09 +00:00
Vlad Zahorodnii
9f6b5ea44f x11: Call eglGetPlatformDisplayEXT() without attrs
There are EGL implementations that will refuse to create a context if
the share context belongs to other EGLDisplay. Currently, that's the
case on some platforms.

If eglGetPlatformDisplayEXT() is called with the same parameters, it'll
return the same EGLDisplay. The main motivation behind this change is to
ensure that both kwin and Qt share the same EGLDisplay, QtXCB calls
eglGetPlatformDisplayEXT() without any additional args.

If EGL_PLATFORM_X11_SCREEN_EXT is not specified via attrs, the EGL
implementation will use the default screen, which is the same as
m_x11ScreenNumber.
2021-07-05 09:14:09 +00:00
Vlad Zahorodnii
12b14779ba x11: Gracefully handle failed compositing initialization
X11Platform includes NoCompositing in supported compositing types.
Therefore, Q_UNREACHABLE() cannot be used.
2021-07-05 11:53:26 +03:00
Vlad Zahorodnii
8b8669eece scene: Avoid discard quads when only position changes
Since the quads are in the item local coordinate space now, it is okay
not to discard cached quads if only the item position changes.
2021-07-04 16:12:33 +00:00
Vlad Zahorodnii
c6ffdf4f7f kwineffects: Remove WindowQuad::uvAxisSwapped
Since makeSubQuad() uses bilinear interpolation, the flag to indicate
whether UV-coordinates are swapped is redundant.
2021-07-04 16:12:06 +00:00
Aleix Pol
8386a8bb66 tablet+libinput: do not crash if there's a tablet event without a client
It triggers if you start with your pen on the tablet while starting
kwin.
2021-07-02 23:50:57 +02:00
Aleix Pol
c8a37ef27f tablet: use the right scope for the variable 2021-07-02 20:54:57 +02:00
Aleix Pol
df9978d6a1 tablet: no need to forward the cursorChanged signal
It's already emitted by updateCursor, so we were doing it twice.
2021-07-02 20:54:45 +02:00
Xaver Hugl
f54d7a2697 xdgshellclient: fix moveresize with touch and CSD
When moveresize is done with touch we need to use the current touch
point and not the mouse position.

BUG: 438283
CCBUG: 431489
2021-07-01 13:13:07 +00:00
Xaver Hugl
a4dcfbfb31 input: fix touch input getting borked on quick tile
The decorationPressId never gets reset as the decoration isn't below the
touch point anymore after the quick tile, so if we have no decoration
under the touch point reset the decorationPressId to -1.

CCBUG: 430560
2021-07-01 13:11:41 +00:00
David Edmundson
893f95eed8 Guard against null compositor in thumbnail item
If compositing is disabled, compositor will be null.

We hit a path where we could destroyOffscreenTexture when the
compositing is disabled then again when the Thumbnail is destroyed. In
this case we query Compositor::self()->scene() and crash.
2021-07-01 12:38:57 +01:00
l10n daemon script
f53cf9d71e 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-06-30 01:21:12 +00:00
David Redondo
b4150e3eb5 Fix build 2021-06-29 10:32:06 +02:00
Xaver Hugl
2ecce63d93 platforms/drm: don't crash if drmModeGetConnector fails
I don't think this is the cause of 439208, where it's likely only a
side effect of some other issue; should be guarded against anyways.

CCBUG: 439208
2021-06-28 20:13:36 +00:00
l10n daemon script
a333b87f74 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-06-28 01:30:05 +00:00
Xaver Hugl
6260c03548 platforms/drm: don't create modeset dumb buffer for import gpu
When the EglStreamBackend is used for the secondary GPU we don't need
the modesetting dumb buffer.
2021-06-25 10:08:36 +00:00
Emilio Cobos Álvarez
14b70e5e77 wayland: Set cursor surface outputs. 2021-06-25 08:58:28 +00:00
Xaver Hugl
7e96f09670 platforms/drm: use correct size for soft rotation 2021-06-25 00:46:32 +02:00
Vlad Zahorodnii
3427143017 Improve thumbnail item integration
Currently, thumbnail items are rendered by kwin. This means that qtquick
code cannot do things such as applying shader effects to window thumbnails
or simply draw custom controls on top of thumbnails.

With this change, task switchers and qml extensions will be able to
place their own contents on top of thumbnails and apply custom effects
to them.

In order to integrate window thumbnails, a window is rendered on kwin
side using its own opengl context. A fence is inserted in the command
stream to ensure that the qtquick machinery doesn't start using the
offscreen texture while there are still rendering commands being executed.

Thumbnails are rendered into offscreen textures as we don't have full
control over when qtquick windows render their contents and to work around
the fact that things such as VAOs can't be shared across OpenGL contexts.

WindowThumbnailItem and DesktopThumbnailItem act as texture providers.
2021-06-23 17:46:05 +03:00
Vlad Zahorodnii
172c541cad x11: Use global share context
This is needed to share window thumbnails between kwin's scene graph and
qtquick.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
8ed364337b scenes/opengl: Allow setting external global share context
This is needed to initialize global share context on X11.
2021-06-23 17:45:48 +03:00
Vlad Zahorodnii
fac33750f9 effects: Remove shape property
It's unused and the advantages of keeping it are outweighed by the
disadvantages - the returned value is dependant on the window type.

If you need to draw a drop-shadow that matches the shape of the window
or something along that line, render the window into an offscreen
texture and sample the alpha channel in a fragment shader.
2021-06-23 11:21:51 +00:00
Xaver Hugl
80a7362efc platforms/drm: refactor post processing bits
Putting the OpenGL post processing rotation into its own class cleans
the EglGbmBackend code up a bit and adds post processing rotation for
the EglStreamBackend
2021-06-22 16:35:42 +00:00
Vlad Zahorodnii
b482226d6c wayland: Implement activities window rule
BUG: 439022
2021-06-22 13:48:05 +00:00
Vlad Zahorodnii
4206d8bd9c Remove unused include 2021-06-22 11:45:44 +03:00
Vlad Zahorodnii
da169ee2d9 Replace QRegExp usages with QRegularExpression
QRegExp is deprecated in favor QRegularExpression. It's potentially an
api breaking change as QRegularExpression has a different pattern syntax.
2021-06-22 08:35:10 +00:00
Vlad Zahorodnii
c61085dc2e Remove Toplevel::compositing() and Workspace::compositing()
It is error-prone to have multiple sources for the same data. If the
base implementation (Compositor::compositing()) changes, other helpers
can get out of sync.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
ae70b17c79 Set compositor On status before setupCompositing()
This is needed to ensure that Compositor::compositing() returns true
when Toplevel::setupCompositing() is called.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
d74e81bdd0 x11: Properly detect compositing status
When finishing compositing, Workspace::compositing() will return true,
but it will be preferred if it returns false instead so kwin can properly
update x11 window visibility status, etc.

Instead of checking whether the compositor has a scene, check the status
of the compositor. It will not be "On" during teardown.
2021-06-22 08:32:35 +00:00
Vlad Zahorodnii
10769548db kwineffects: Allow creating GLTexture without allocated storage
This allows creating a GLTexture object and attaching a dmabuf to it.
Currently, we can do that by using the foreign GLTexture constructor,
but it makes the deletion of the texture handle more error prone.

In the future, we can add a method that allocates the texture storage,
but there's no need for that yet.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
2b8453abb8 platforms/x11: Port away from GLTexture::discard()
Currently, if discard() is called, kwin will crash because
EglPixmapTexture does not override the discard method.

In principle, neither GlxPixmapTexture nor EglPixmapTexture should mess
around with internals of the GLTexture class. It is better to have a
wrapper texture with a bind method, which will re-bind the pixmap to the
opengl texture if necessary.
2021-06-22 08:25:50 +00:00
Vlad Zahorodnii
3b8b87a663 scenes/opengl: Update unstyled EffectFrame texture only when rendering
When the EffectFrame is created, there may not be any opengl context
current.
2021-06-22 09:58:31 +03:00
Vlad Zahorodnii
19699e9a26 scene: Store cached quads using std::optional
This way, the code is slightly more readable.
2021-06-21 16:32:55 +00:00
Xaver Hugl
9194c0c974 platforms/drm: some improvements for logging 2021-06-21 17:57:36 +02:00
Xaver Hugl
7552b53066 partially revert 2742e5b422
It seems like without a surface creation of the scene fails somehow. At
least until the exact problem is solved, update outputs for EglStream
gpus before creating the EglStreamBackend.

BUG: 438363
2021-06-21 14:49:44 +02:00
Xaver Hugl
0f6495f4b2 XdgSurfaceClient: set to current activity and desktop in constructors
BUG: 435745
FIXED-IN: 5.22.2
2021-06-20 20:37:29 +02:00
Xaver Hugl
0223136712 platforms/drm: fix mistake in DrmGbmBuffer
When gbm_bo_get_handle_for_plane isn't supported or doesn't work we'd be
passing the buffer format as its handle to drmModeAddFB(2).
2021-06-20 18:47:10 +02:00
Alexander Lohnau
e170c3be7d
Use K_PLUGIN_CLASS_WITH_JSON instead of K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON
Task: https://phabricator.kde.org/T14542
2021-06-19 07:12:52 +02:00
Xaver Hugl
b33fef02f5 platforms/drm: show cursor when exiting dpms
BUG: 438824
2021-06-18 14:10:22 +00:00
Nate Graham
c9a719e109 [effects] Use standard arrow cursor in Present Windows & Desktop Grid
The pointing finger cursor is used to show that a piece of text is a
clickable link, and it is inappropriate to use it in other contexts.
Regular UI elements that do something when single-clicked continue to
use the standard arrow cursor in other contexts, so let's follow that
convention in the Present Windows and Desktop Grid effects too.

BUG: 421928
FIXED-IN: 5.23
2021-06-18 12:58:40 +00:00
Felipe Kinoshita
ca3609eb4d [kcmkwin/kwincompositiong] Remove not so useful separators lines
This commit removes the separators lines below "scale method" and
"rendering backend", options here shouldn't be separated since they
are all related to eachother.
2021-06-18 10:40:23 +00:00
Nate Graham
bbf9c54dd8 [kcmkwin/kwineffects] Collapse list item when clicking on it again
Currently, each effect's list items expands when you click on any
non-interactive part of it, but it does not collapse when you click on
it again.

With this commit, now it does.

BUG: 421883
FIXED-IN: 5.23
2021-06-18 10:17:47 +00:00
Aleix Pol
56915dc113 xdgactivation: do not tell effects about unknown applications
Makes for an odd decoration.
We generally will not have an app_id in the cases where we are creating
a token just in case it's necessary down the line.
2021-06-18 00:11:56 +00:00
Aleix Pol
81f7436fda xdgactivation: Let activation requests through when they come from a window manager
If a client already has powers to move clients around, let them also
activate using the right protocols as well.

This is useful to be able to implement SNI or Notifications where the
shell doesn't get full surface activation when interacting with it.
2021-06-18 00:11:56 +00:00
l10n daemon script
2f3a425c5e 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-06-16 01:24:38 +00:00
Nate Graham
77affd3259 [kcmkwin/kwindesktop] Drop local back for Formlayout label width
This hack was added in the past to prevent the combobox from being
pushed out of view when the label next to it was very long, as it can be
in certain languages. However it had the effect of making the label get
elided in *all* languages, and also the issue it was working around is
no longer present; even with very long text, the combobox no longer gets
pushed out of view, and instead the formlayout first switches to mobile
view and then elides the Label, exactly as intended. So we can safely
remove the hack.

BUG: 438504
FIXED-IN: 5.22.2
2021-06-15 17:27:14 -06:00
Xaver Hugl
250169ff84 platforms/drm: make context current without outputs in eglstream 2021-06-15 23:21:08 +02:00
Vlad Zahorodnii
61159d943c effects: Fix interpolated values for redirected animations
If a redirected animation reaches the end, the timeline value will be 0,
i.e. the interpolated() function has to return the from value, not `to`.

BUG: 438368
2021-06-15 08:46:58 +03:00
Vlad Zahorodnii
2ab70d0674 scenes/opengl: Clean up includes 2021-06-14 16:19:48 +03:00
Vlad Zahorodnii
1c94e1bfc4 scenes/opengl: Move out X11 explicit sync
This moves X11 specific code to a better place, which allows us make
item rendering code less platform specific and easier to change.
2021-06-14 13:14:54 +00:00
Vlad Zahorodnii
047c1a91f2 Properly destroy Compositor during teardown
When the aboutToDestroy signal is emitted, the compositor object is
already partially destroyed. This contradicts to the name of the signal.

In addition to that, it will be better to call the stop method in the
destructors of X11Compositor and WaylandClient as it allows them to add
custom cleanup code when compositing is turned off.
2021-06-14 13:14:54 +00:00
Vlad Zahorodnii
38f6494b2c scene/opengl: Remove unused includes 2021-06-14 12:20:37 +03:00
Vlad Zahorodnii
f9cf0baead kwineffects: Allocate hidpi textures in DeformEffect
If a window is animated using DeformEffect, allocate an offscreen
texture with the scale factor of the screen where the window is
considered to be on.

Also, resize the offscreen texture on demand in order to make resource
handling more efficient.
2021-06-14 09:02:44 +00:00
Vlad Zahorodnii
4af9d6c234 kwineffects: Remove unused WindowVertex and WindowQuad props
Since window quads are no longer passed in prePaintWindow(), we don't
need to track original vertex coords. This results in smaller memory
footprint.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
5339b1a9d7 scene: Move item preprocessing to scene
We no longer use window pixmaps to get the shape and the opaque regions,
so preprocess() can be called now only if we are about to paint the item.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
49744cfc53 scene: Improve window quad management
At the moment, we handle window quads inefficiently. Window quads from
all items are merged into a single list just to be broken up again.

This change removes window quads from libkwineffects. This allows us to
handle window quads efficiently. Furthermore, we could optimize methods
such as WindowVertex::left() and so on. KWin spends reasonable amount
of time in those methods when many windows have to be composited.

It's a necessary prerequisite for making wl_surface painting code role
agnostic.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
a6268595fb scene: Generate quads in item local coordinate space
Window quads need to be in some coordinate space. Since we want items to
be used not only for rendering windows, window-local coordinates do not
suffice.

This change makes scene items generate quads in the item-local coordinate
space.

The model matrix is used to map the quads to the global screen coordinate
system from the item coordinate space.

Since the quads are in the item local coordinate space, the mvp matrix
needs to be updated on every draw call. Given the render data, tracking
the last mvp matrix won't result in less glUniform calls. If this indeed
becomes a serious performance bottleneck, we can explore the possibility
of dumping mvp matrices in a UBO, which have been introduced in OpenGL
3.1.
2021-06-14 07:56:02 +00:00
Vlad Zahorodnii
29cc319455 kwineffects: Remove WindowQuadType
The window quad type has become irrelevant.
2021-06-14 07:56:02 +00:00
l10n daemon script
3ed363c498 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-06-14 01:16:13 +00:00
l10n daemon script
943bdc0e64 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-06-13 01:21:07 +00:00
Vlad Zahorodnii
86bb4e68ef Refactor window quad handling
The scene items depend on the scene windows for caching window quads.
The goal of this change is to move window quads management to item.

Merging window quads in one list and then splitting them is inefficient,
it will be highly desirable if window quads are removed from the public
api so we can optimize window quad management.

With this change, the window quad type becomes irrelevant to render
backends for the most part. Note that the Xrender backend is a bit
nitpicky about window quads, so the shadow item doesn't create generic
"WindowQuadShadow" quads anymore.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
d109e7d69b Introduce Item visible property
This property can be used to control the visibility of an item and its
child subtree.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
a106a5aab8 Move AbstractClient::isShade() to Toplevel
This simplifies rendering code and allows to cache properly the shaded
state for Deleted windows.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
de122825fd scenes/qpainter: Remove support for drop-shadows
Drop-shadows with the software render backend impact performance quite
significantly. It also makes it easier to prepare render backends for the
item based design.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
30d0dbbaf0 Remove EffectsHandler::buildQuads()
It's currently unused and it doesn't fit the item based scene design.
2021-06-11 06:03:08 +00:00
Vlad Zahorodnii
a9e4d6d1f7 x11: Initialize m_target of EGL platform surface texture
We need to initialize m_target; otherwise the surface texture won't be
bound to GL_TARGET_2D.
2021-06-11 06:01:00 +00:00
Ismael Asensio
40d708f9c5 kcm/kwinrules: Adapt spinbox width to actual text
Use FontMetrics to calculate the expected max text width so it
doesn't overflow with wider fonts, specially in some languages
like pt_BR

BUG: 438193
FIXED-IN: 5.22.1
2021-06-10 23:16:31 +02:00
Ömer Fadıl Usta
dc73d622c0 Guard gbm and eglstreams parts for non-gbm or non-eglstreams systems 2021-06-10 20:10:14 +00:00
David Edmundson
bc6eba6114 [xwl] Create a new datasource on offer changes
Offers shoul be set on a source before data_device.set_selection. Doing
so afterwards appears to be against the spec and as such we may not pass
the update to wayland clients / klipper.
2021-06-10 17:18:50 +00:00
Vlad Zahorodnii
f280423b92 kwineffects: Remove PaintClipper
PaintClipper worked only with the XRender backend, which is gone now.
2021-06-10 15:58:33 +00:00
Vlad Zahorodnii
3ae400772b kwineffects: Remove dead code
AnimationEffect sets the clip region to clip windows, so this code can
be safely removed.
2021-06-10 15:58:05 +00:00
Xaver Hugl
40c485f2a6 platforms/drm: fix EglStreamBackend init
BUG: 438363
2021-06-10 13:06:43 +00:00
Xaver Hugl
3d6659b0d7 platforms/drm: on NVidia do pageflips with QPainter
Otherwise it's just gonna display a static black screen

CCBUG: 438363
2021-06-10 11:19:07 +00:00
Aleix Pol
a24e92d0b7 blur: Use a custom projection matrix when passing to copy sample
The screen projection matrix doesn't necessarily apply to that
framebuffer, so we can't use it.
2021-06-10 10:06:35 +02:00
Aleix Pol
fffd41b32e Only create the viewport as needed
So far, we were creating a model view with the complete scene rendered
(even if we didn't render the windows themselves). This required us to
have a big glPerspective spanning the entire scene and we were just
cropping it as we rendered it into a smaller texture.

This changes our scenes so we have the correct matrix set up at all
times.

Specifically in the case of the Pinephone, this solves the following
issue where we were unable to connect external displays because it
exceeded GL_MAX_VIEWPORT_DIMS:
https://invent.kde.org/teams/plasma-mobile/issues/-/issues/11
2021-06-10 10:06:35 +02:00
Aleix Pol
bec50eaec0 deform effect: Use the provided matrix instead of creating a new one 2021-06-10 10:06:35 +02:00
Aleix Pol
059b78337f Add Q_ENUM to enum classes 2021-06-10 10:06:35 +02:00
Aleix Pol
09f99df1a3 inputmethod: Be more assertive towards the input panel visibility
If a new input client has taken over, don't override the trackedClient's
geometry.
Only consider the input geometry of a visible keyboard.
2021-06-10 03:33:36 +00:00
Aleix Pol
6fa96852dc inputmethod: Reconsider what a hidden input method is
When the panel disappears, just reconsider the panel's state but don't
just stop sending updates to the input method.
Some input methods are just helpers that show and hide as necessary.
2021-06-10 03:33:36 +00:00
Nate Graham
66661a9ddc [kcmkwin/kwindecoration] Re-phrase awkward message
BUG: 438189
FIXED-IN: 5.23
2021-06-09 14:22:09 -06:00
Vlad Zahorodnii
a06690021d Remove OpenGL2Compositing enum
OpenGLCompositing and OpenGL2Compositing enums mean de-facto the same
thing, it's confusing to have them both.
2021-06-09 15:24:22 +00:00
Nicolas Fella
1e36e79fa3 Remove unused KIO dependency 2021-06-09 16:18:41 +02:00
Marco Martin
ada29cfc9a don't place windows with invalid geometry
if a window has a size of 0x0, doesn't have its final place yet, so it can't be reliably
placed centered yet
2021-06-09 12:42:12 +00:00
Vlad Zahorodnii
811beb94e0 Remove Xrender backend
The Xrender backend was added at the time when OpenGL drivers were not
particularly stable. Nowadays though, it's a totally different situation.

The OpenGL render backend has been the default one for many years. It's
quite stable, and it allows implementing many advanced features that
other render backends don't.

Many features are not tested with it during the development cycle; the
only time when it is noticed is when changes in other parts of kwin break
the build in the xrender backend. Effectively, the xrender backend is
unmaintained nowadays.

Given that the xrender backend is effectively unmaintained and our focus
being shifted towards wayland, this change drops the xrender backend in
favor of the opengl backend.

Besides being de-facto unmaintained, another issue is that QtQuick does
not support and most likely will never support the Xrender API. This
poses a problem as we want thumbnail items to be natively integrated in
the qtquick scene graph.
2021-06-09 11:21:57 +03:00
Vlad Zahorodnii
3c2ca184e3 effects: Remove Desktop Cube Animation effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
47ef0b5a3c effects: Remove Desktop Cube effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
3722c21660 effects: Remove Cover Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Vlad Zahorodnii
bcff948e39 effects: Remove Flip Switch effect
With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
2021-06-09 08:21:27 +00:00
Xaver Hugl
4ee3f69dd5 platforms/drm: only allocate two dumb buffers for the swapchain 2021-06-08 21:11:39 +02:00
Vlad Zahorodnii
35e37f7347 Fix loading of window rules
We need to call KCoreConfigSkeleton::load() otherwise window rule
objects will not be created.
2021-06-08 15:58:48 +00:00
Vlad Zahorodnii
5929147ee1 Remove unused include 2021-06-08 15:58:21 +00:00
Xaver Hugl
19f92d731a platforms/drm: fix modifiers detection
CCBUG: 437893
2021-06-08 16:38:52 +02:00
Andrey Butirsky
471d635f0c [tabbox] fix non-working global shortcuts overrides
static cuts[] array was initialized only once with copies of non-const
objects, so when new shortcuts are configured, the old objects were still
referenced.
Fixed by having non-static array instead, so actual objects are copied
on the init every time.

BUG: 359141
2021-06-08 11:50:02 +00:00
Vlad Zahorodnii
52eabd064d Remove unused define preprocessor directive
IN_KWIN is unused.
2021-06-08 11:43:46 +00:00
Vlad Zahorodnii
9d1db97f05 Make kwin friendlier for static code analysis tools
Some static code analysis tools break when analysing kwinbindings.cpp.

This change moves the contents of kwinbindings.cpp file in useractions.cpp
to make those tools happier. It also makes code more readable.
2021-06-08 11:43:46 +00:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Ismael Asensio
b5a58f83ee kcm/kwinrules: Manage RuleSettings instead of Rules objects
The KCM now manages the RuleSettings config objects directly,
instead of using a list of `Rules` objects as an intermediary.

This highly reduces the overhead, improving loading and saving
times, and also enables a better use of KConfig capabilites.

The config state is now automatically tracked by KConfigXT
objects. Whenever the user edits either the rule list, or any
specific property within a rule, the `needsSave` state is
updated accordingly.

BUG: 421564
FIXED-IN: 5.23
2021-06-07 21:03:29 +02:00
Ismael Asensio
61c2055da7 rulebooksettings: Add accesors to the rules settings list
Previously, the only way to access the rules list was via
the `rules()` and `setRules()` methods, so the actual
settings objects were not accesible.

This commit adds methods to retrieve, insert, remove or reorder
the rules within the list.

Since every individual rule is stored as a KConfig group, and
they are not designed to be dynamically renamed, using consecutive
numbered groups and store only the total count is problematic.

So we also add a new stringlist setting to store the rules group
names and their order.

Now any group name is valid. To avoid collisions use random QUuids
as group names for newly created rules.
2021-06-07 21:03:29 +02:00
Vlad Zahorodnii
d4f75f3e64 scripting: Add clientArea() overload that takes mutable client
Even though there is a clientArea() overload that takes const abstract
clients, QJSEngine seems to be unable to find the right clientArea()
overload if a mutable abstract client has been passed.

BUG: 437507
2021-06-07 18:08:30 +00:00
Alexander Lohnau
9c689d7ddb plugins: Port away from deprecated version checks
Task: https://phabricator.kde.org/T14302
2021-06-07 15:01:19 +00:00
Xaver Hugl
3c10398104 screencast: only use glGetTextureImage where supported 2021-06-07 14:11:07 +02:00
Xaver Hugl
0208f78336 platforms/drm: make context current for direct scanout 2021-06-07 13:45:50 +02:00
Xaver Hugl
cfd7af0179 platforms/drm: support NVidia as secondary GPU with CPU copy
BUG: 431062
2021-06-07 09:23:06 +02:00
Vlad Zahorodnii
605f00d03a effects/backgroundcontrast: Properly handle empty regions set by internal windows 2021-06-07 06:03:19 +00:00
Vlad Zahorodnii
cade5064c3 effects/blur: Properly handle empty blur regions set by internal windows
The task switcher has a valid empty blur region and the blur effect
misdetects that, which results in no blurred background.

BUG: 433131
2021-06-07 06:03:19 +00:00
Aleix Pol
34bfc25759 inputmethod: Don't move the clients around when the input panel is an overlay
It's meant to be floating around the cursor, if we do this we just get a
weird tiny screen.
2021-06-05 23:33:32 +00:00
Ömer Fadıl Usta
8fc3b024be Update dumb_swapchain.cpp 2021-06-05 04:59:02 +00:00
Vlad Zahorodnii
8c8098a61c Move X11Client::wantsShadowToBeRendered to AbstractClient
Otherwise only X11 windows will lose server-side drop-shadows when the
maximized mode changes.

BUG: 434213
2021-06-04 17:57:21 +03:00
Vlad Zahorodnii
5498b37938 scenes/opengl: Delegate viewport setup to backend
Only the backend knows what the right viewport rect is. Furthermore,
setting up the viewport before rendering is less error-prone.
2021-06-04 16:18:34 +03:00
Vlad Zahorodnii
d3f4da370b Prevent emitting Scene::frameRendered more than once per frame
Currently, the frameRendered() signal is emitted every time an effect
calls paintScreen(). This means that the frameRendered() signal can be
emitted more than once when effects such as slide are active. However,
we'd like if it's emitted only once before buffers are swapped.
2021-06-04 07:49:32 +00:00
Vlad Zahorodnii
8b3e999fbf scenes/opengl: Properly destroy backend if initialization fails
SceneOpenGL takes the ownership of the backend. So, if the scene fails
to initialize, the backend will be deleted twice.
2021-06-04 07:39:51 +00:00
Bhushan Shah
2b1d709b04 inputmethod: hook the key and modifiers functions 2021-06-04 00:14:34 +02:00
Aleix Pol
454425b43f inputmethod: Allow input methods to grab the keyboard
This allows different input methods to get information about what's
beign typed from the actual hardware. This is especially useful for
non-latin script languages.
2021-06-03 19:13:21 +02:00
Xaver Hugl
c5ea99cbe5 AbstractEglBackend: only clean up OpenGL context if primary 2021-06-03 14:44:14 +02:00
Aleix Pol
74724065ae inputmethod: Don't disable them by default if there's a connected keyboard
If the user has chosen to have a virtual keyboard (i.e. prefered maliit
over none in the KCM) they should get it. If it's too annoying it should
either be disabled or we can fix it so it gets less in the way.

This is especially important since some hardware registers itself as a
keyboard even if it's not a fully functional keyboard.
2021-06-03 10:51:01 +00:00
David Edmundson
4a16e18808 Remove Wayland::Client usage in wl->xwl drags 2021-06-03 09:04:26 +00:00
Ömer Fadıl Usta
6c97cd118d fix include 2021-06-02 17:41:10 +00:00
Xaver Hugl
b88b6f3bc3 platforms/drm: log when direct scanout starts and stops 2021-06-01 13:02:13 +02:00
Vlad Zahorodnii
de3b7a96db effects/blur: Ignore xshape region
EffectWindow::shape() doesn't fit the item based design. This change
ports the blur effect away from the shape() function to the rect()
function. The XShape extension was introduced when windows with an alpha
channel wasn't really a thing. Setting a shape served as a way to clip a
window, the most notable example is xeyes.

If an application relies on the xshape extension to actually clip the
window and not to force the window manager not to put the server-side
deco, it most likely doesn't support translucency and therefore it
shouldn't set the blur region to begin with.

This change makes the blur effect ignore the xshape region similar to
the background contrast effect. It allows us to decouple a bit more
effects from the rest of rendering machinery and thus make it easier for
us to move forward with the scene redesign goal.
2021-06-01 06:26:17 +00:00
l10n daemon script
c1aa1c6c09 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-06-01 01:16:32 +00:00
Aleix Pol
aba3335ea6 Fix weird decoration glitch when using a scaled display
We used to get a weird line around the window decoration because the
clamping would hit the outside of the rendered decoration.
To make sure we fall inside take the displayPixelRatio into account.
Also on non-integer scales, make sure we are actually falling inside.
2021-05-31 13:01:25 +00:00
Xaver Hugl
7bf79090cf platforms/drm: add outputs on EglGbmBackend initialisation
BUG: 437761
2021-05-31 13:15:16 +02:00
Vlad Zahorodnii
33bb146861 scenes/opengl: Remove unused render node leaf type 2021-05-31 09:35:52 +03:00
Vlad Zahorodnii
048c732a4e scenes/opengl: Remove half-pixel correction workaround
It was needed to work around visual glitches in the wobbly windows
effect. Since the wobbly windows effect renders the animated window into
an offscreen texture, we don't need this workaround anymore.

Furthermore, rather than using half-pixel correction, it is more
desirable to use an offscreen texture as it results in simpler design.
Performance-wise, it's not that bad that we need to start looking for
other ways to get rid of the seams between window contents and deco.
2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
8d378cd4cd effects/fallapart: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
61d3134aa5 effects/magiclamp: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
ab706e53dc effects/wobblywindows: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
5255ebf8d0 kwineffects: Introduce DeformEffect
DeformEffect is the base class for effects that transform the window
quad grid, e.g. wobbly windows or magic lamp. The main difference
between normal effects and offscreen effects is that the latter renders
animated windows into offscreen textures which are later deformed.

The offscreen texture approach is superior to the half-pixel correction
approach as it produces more visually appealing results. Even with
half-pixel correction, you're still going to see jagged lines between
the main surface and the server-side decoration or drop-shadow.

It is also needed to reduce the number of usages of WindowPaintData::quads
which is needed to move forward with the scene redesign goal.
2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
d4ade78aac kwineffects: Add parent argument to Effect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
b0042a30c1 x11: Pick better names for geometries before blocking
The new names express better what "geometries before update blocking" are.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
c3978f197b x11: Properly detect the case where client window moves inside frame window
If the window borders change in such a way that the buffer geometry
doesn't change, but the client geometry does change, we need to configure
the wrapper window and maybe the client window so there are no black
borders, etc.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
ce0edde906 x11: Remove irrelevant comments
The relevant code the comment talks about was removed long time ago.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
308cbcc47f x11: Add missing geometry checks in moveResizeInternal()
Currently, there is an assumption in the moveResizeInternal() method
that if the buffer geometry changes, then the client geometry will also
change. However, as it turns out, it's not completely true. For example,
if the window is maximized while its geometry already matches the
maximize area, the buffer geometry won't change, but the client geometry
will change.

This change adds missing geometry checks. *geometryBeforeBlocking
corresponds to the old geometry. We can use it to decide if the geometry
has changed.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
eaca921e01 x11: Remove window rule geometry mismatch debug message
If the geometry window rule must be forced, the move resize method has
to force it, but similar to size constraints, we assume that the caller
of the move resize function will do the right thing. So, remove the
debug message to be consistent with other client types.
2021-05-31 05:20:57 +00:00
Nicolas Fella
f910b0de97 Use version-less qt DBus macros
They work with both Qt5 and Qt6
2021-05-31 01:00:35 +02:00
Vlad Zahorodnii
eb27d312a3 effects/desktopgrid: Clip windows differently
Similar to the slide effect, the desktop grid can use the clip region to
clip windows when needed. This will improve performance because the desktop
grid effect will do less work. Currently, it clips quads on its own in
prePaintWindow, copies them over in a temporary list, and lets the opengl
scene clip the window quads again.

We can clip windows differently by just passing a custom region to the
paintWindow() function down the effects chain, which the desktop grid
effect already does.

The old behavior and the old bugs are preserved. The Xrender code path is
unaffected.
2021-05-28 16:48:17 +00:00
Vlad Zahorodnii
2b88fab8c1 effects/screenshot: Add support for HiDPI window screenshots
In general, on Wayland, there is no such a thing as "window scale factor"
because sub-surfaces can have different buffer scales. However, we know
the scale factor of the output where the window is considered to be on. So
we can use the screen's scale factor as the window's scale factor. In
most cases, it will produce the correct result.
2021-05-28 17:36:56 +03:00
Vlad Zahorodnii
a8d702ba30 effects/screenshot: Port away from window quads
For the scene redesign, window quads need to be removed from the effects
api. This change ports the screenshot effect away from quads.

In order to exclude the server-side decoration from the window
screenshot, the effect will render the contents of the client geometry
into the offscreen texture. If the window is client-side decorated, the
entire window will be rendered as before.

The good thing about this approach is that the screenshot effect will do
less work, it won't loop over window quads to compute the bounding rect
or filter out the deco quads.
2021-05-28 14:03:42 +03:00
Vlad Zahorodnii
b814b3c985 kwineffects: Add client geometry property
This property can be useful for the screenshot effect.
2021-05-28 11:05:38 +03:00
Xaver Hugl
2742e5b422 Rearrange wayland startup sequence
The backend can now optionally wait for the scene to be created before
it updates its outputs, which is necessary for better atomic tests in
the DRM backend.
2021-05-27 13:41:40 +00:00
Vlad Zahorodnii
1d906169d8 Discard SurfaceItemXwayland's quads when shape changes
The SurfaceItemXwayland has to re-build quads if the shape changes.

The SurfaceItemX11 doesn't need a similar fix as it already discards
quads whenever the shape region changes.
2021-05-26 18:27:55 +00:00
Nate Graham
20b8d606e1 [kcmkwin/kwindesktop] Add explicit action to apply a rename
The rnew name is applied when the user hits the return or enter key to
finish renaming, but this is an invisible UI and the user might not
think to do that. This commit replaces the "Rename" button with a
"Confirm new name" button while the text field is editable, so that it's
visibly clear how to finish renaming.
2021-05-26 17:44:02 +00:00
Nate Graham
324480570b [kcmkwin/kwindesktop] Allow renaming desktops with double-click
Similar to the feature to allow inline renaming in file managers, you
can now trigger renaming for a desktop by double-clicking on its list
item.

BUG: 421882
FIXED-IN: 5.23
2021-05-26 17:43:30 +00:00
Aleix Pol
644dcbe173 screencasting: do not attempt to copy a null texture
It seldom happens, but it does happen.
2021-05-26 12:56:59 +00:00
Vlad Zahorodnii
870c1e5557 scenes/qpainter: Clean up includes
Wayland-specific code in the qpainter renderer was removed long time ago.
2021-05-26 09:36:20 +03:00
Vlad Zahorodnii
7cbd459caf Remove unused includes in DecoratedClient and DecorationBridge 2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
f46c7bae8d Move decoration renderer to decoration item
Currently, the implementation of the DecoratedClient and the decoration
renderer are strongly coupled. This poses a problem with the item based
design as the ultimate goal is to have scene items construct paint nodes
which are then fed to the renderer. The DecorationItem has to have
control over the decoration texture. Another issue is that the scene
cannot smoothly cross-fade between two window states if the decoration
is removed, e.g. from fullscreen mode to normal and vice versa.

This change moves the decoration renderer to the decoration item. With
the introduction of a generic scene texture atlas, we hope to get rid of
the decoration renderer altogether.
2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
7f32594692 Port decoration renderers to Decoration::damaged signal 2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
fa66c3d238 Make Toplevel::isClient() return true for internal and wayland windows
It's needed to merge Toplevel and AbstractClient. Previously, we
couldn't do it because Toplevel::isClient() was somewhat widely used.
2021-05-25 19:06:17 +03:00
Vlad Zahorodnii
93d95ffbc4 Replace AbstractClient::doPerformInteractiveMoveResize() with a simpler solution
AbstractClient::doPerformInteractiveMoveResize() is only used by the
X11Client to reset a boolean flag when the client doesn't support sync
counters.

X11Client can call performInteractiveMoveResize() only in two cases: the
sync request timer expires or the client increments the sync counter.

This change removes the AbstractClient::doPerformInteractiveMoveResize()
function and adds a function to handle the case where the sync timer
expires explicitly. This removes a virtual function in the AbstractClient
and makes code more readable.
2021-05-25 09:32:55 +03:00
Vlad Zahorodnii
c929d977a7 Move geometry before blocking to X11Client
It's only used by X11Client. Neither InternalClient nor WaylandClient
need buffer/frame/client geometry before blocking.
2021-05-25 06:17:41 +00:00
Vlad Zahorodnii
9a7ab8a62e Rework async geometry updates
Window management features were written with synchronous geometry
updates in mind. Currently, this poses a big problem on Wayland because
geometry updates are done in asynchronous fashion there.

At the moment, geometry is updated in a so called pseudo-asynchronous
fashion, meaning that the frame geometry will be reset to the old value
once geometry updates are unblocked. The main drawback of this approach
is that it is too error prone, the data flow is hard to comprehend, etc.

It is worth noting that there is already a machinery to perform async
geometry which is used during interactive move/resize operations.

This change extends the move/resize geometry usage beyond interactive
move/resize to make asynchronous geometry updates less error prone and
easier to comprehend.

With the proposed solution, all geometry updates must be done on the
move/resize geometry first. After that, the new geometry is passed on to
the Client-specific implementation of moveResizeInternal().

To be more specific, the frameGeometry() returns the current frame
geometry, it is primarily useful only to the scene. If you want to move
or resize a window, you need to use moveResizeGeometry() because it
corresponds to the last requested frame geometry.

It is worth noting that the moveResizeGeometry() returns the desired
bounding geometry. The client may commit the xdg_toplevel surface with a
slightly smaller window geometry, for example to enforce a specific
aspect ratio. The client is not allowed to resize beyond the size as
indicated in moveResizeGeometry().

The data flow is very simple: moveResize() updates the move/resize
geometry and calls the client-specific implementation of the
moveResizeInternal() method. Based on whether a configure event is
needed, moveResizeInternal() will update the frameGeometry() either
immediately or after the client commits a new buffer.

Unfortunately, both the compositor and xdg-shell clients try to update
the window geometry. It means that it's possible to have conflicts
between the two. With this change, the compositor's move resize geometry
will be synced only if there are no pending configure events, meaning
that the user doesn't try to resize the window.
2021-05-25 06:17:41 +00:00
Aleix Pol
e4ed4e5a13 Keep lostLeader code under removeX11Client
The groups concept only applies to X11 clients
2021-05-25 02:29:19 +02:00
Aleix Pol
ae01ed219c workspace: Unify client removal code
We have 2 equivalent code paths for x11 and wayland unnecessarily, unify
them under the same method.
Rename m_clients to m_x11Clients so that it's clear what the difference
is between m_clients and m_allClients.
2021-05-24 23:16:41 +00:00
David Edmundson
5484b846b3 [kcmkwin/kwindesktop] Implement valueFromText in a spinbox
If textFromValue is set, valueFromText must be.

A lot of other implemenetations were using parseInt() which fails at
reading "3,000" due to the comma. Qt's fromLocaleString handles that but
needs any text stripping.

This implementation isn't perfect, but really we need to work on a good
upstream solution.

BUG: 437472
2021-05-24 18:51:07 +00:00
Aleix Pol
27e043920a xdg_activation_v1 implementation 2021-05-24 17:19:25 +02:00
Aleix Pol
3c7290b722 Abstract startup semantics in the startupfeedback effect 2021-05-24 17:19:08 +02:00
Aleix Pol
0f8813671b Split AbstractClient::iconFromDesktopFile into a static function
This way it can be used before we have the window
2021-05-24 17:19:08 +02:00
Felipe Kinoshita
e72a555247
[kcms/virtualdesktops] Change delete icon 2021-05-24 11:40:19 -03:00
David Edmundson
8a699ef187 [xwl] Notify wayland that our data offer is accepted
kwayland-server was updated to follow the result of whether the data
offer was accepted before calling drop.

Our bridge was not updated.

We don't have enough data to know which mimeType the XWayland client
actually has accepted, as that doesn't exist at an X11 level, but it
doesn't have a big actual impact. Despite which mime type gets accepted
any mimetype can be retrieved in the drop event.

Tested against "dropsite" from QtBase widget examples forced into xcb
mode using dolphin as a source.

BUG: 437406
2021-05-24 14:06:57 +00:00
David Edmundson
600c1e0a54 platforms/drm: Make context current before EGLStreams calls
attachStreamConsumer and resetOutput are not called as part of the scene
render and as such the context might not be set.

All credit goes to Simon Spinner for his investigation.

BUG: 437573
2021-05-24 13:51:18 +00:00
Aleix Pol
1e5fae1e91 inputmethod: warn when we're committing strings to noone 2021-05-24 14:16:23 +02:00
Aleix Pol
8fad7aa4f3 inputmethod: Also update the trackingClient when there's none set
Also moves the setting code to a separate method for readability
2021-05-24 14:16:23 +02:00
Aleix Pol
f60b9176da inputmethod: Use the inputmethod's context as the isActive measure
Ensures that m_active and the input context do not get out of sync and
that the right signals are always emitted by always using setActive to
activate.
Uses the context to define InputMethod::isActive.
2021-05-24 14:16:23 +02:00
Aleix Pol
184e53e5c2 inputmethod: Make sure we send a state commit
Detach from the serials that the client send us, since they don't really
matter to the input method and track our own.
Also issue a commit state whenever we adopt a new input context. This
can happen for reasons that don't come from the client, like for example
the input method has just been enabled.
In practice, this solves an issue that we can easily see with maliit
where it would be left in a half-initialised state and would show
autocorrection fields on terminal applications when unnecessary and
possibly similar problems every now and then.
2021-05-24 14:16:14 +02:00
Nicolas Fella
b31ef46576 [kcms/virtualdesktop] Don't offer to remove the last desktop
The current UI allows to remove the last desktop, but:
- If you remove it it will reappear on the next KCM launch
- The Add button does not work then

Prevent removing the last desktop by disabling the action

BUG: 437561
2021-05-24 11:58:49 +00:00
Nicolas Fella
7f36f01247 [kcms/virtualdesktops] Properly track synchronizing state
When the user applies a change like adding a desktop
DesktopsModel::syncWithServer is called and m_synchronizing is set to
true. The server then sends some kind of response (e.g. desktopCreated)
and updateModifiedState is called which sets m_synchronizing to false
again.

However if a setting is changed that does not trigger any server change
(e.g. the show OSD setting) m_synchonizing is never set to false again,
causing problems down the line.

Instead of relying on updateModifiedState to reset m_synchronizing track
the syncronizing state by refcounting the DBus calls

BUG: 437466
2021-05-24 11:53:59 +00:00
Nicolas Fella
99b84a321a Don't show virtual keyboard SNI when no virtual keyboard is selected in the KCM
Not choosing any virtual keyboard is a valid option. In this case do not show the SNI since it isn't very useful then and takes up some space in the system tray.

BUG: 437171
2021-05-24 11:53:30 +00:00
Vlad Zahorodnii
a18cb8998e wayland: Remove direct session
Most distros use either systemd's logind or consolekit for session
management.

The main reason why there's direct session is because up to some point,
kwin had a class called VirtualTerminal which was kind of like a direct
session backend.

The VirtualTerminal was used in the fbdev backend in conjuction with the
logind session backend, which looked odd.

Since the drm backend supported only logind and consolekit for very
long time and we hadn't received any complaints about it, the fact that
direct session is unsupported should not be noticeable.

Given that, this change removes the support for direct session in order
to reduce the amount of platform-specific code and make it easier to
maintain kwin.
2021-05-24 06:23:00 +00:00
Vlad Zahorodnii
1a464530bd scenes/xrender: Remove SceneXRenderShadow::buildQuads()
It's effectively the same as Shadow::buildQuads().
2021-05-24 06:22:28 +00:00
Nicolas Fella
86ce04a7fc [kcms/virtualdesktops] Enable apply button when typing desktop name
Currently the apply button will only be enabled when you press enter or
change focus away from the text field which is somewhat inintuitive.

Instead enable the apply button as soon as the text changed.

BUG: 435014
2021-05-22 13:54:44 +02:00
Nicolas Fella
d8855cc62a [kcms/virtualdesktops] Clip ListView
ListViews in ScrollViewKCMs need to be clipped, otherwise the content
can exceed the frame
2021-05-22 10:50:26 +02:00
David Edmundson
af66f39f19 Support High DPI Aurorae decorations
With high DPI we can't use the image size as a logical size directly.

The other change is use of QPainter::drawImage(QRect target, QImage
image, QRect source)

This slightly confusing method uses logical pixels for the target, but
the source rect is in native pixels of the source.

BUG: 422342
2021-05-21 11:26:53 +00:00
Aleix Pol
22f2e3e43c No need to reset the damage for objects that we already know have none 2021-05-20 13:38:30 +00:00
Aleix Pol
848e9e2076 aurorae: Fix warning at startup
Give an opportunity to the settings to get initialized. Otherwise we set
an null object and qml scripts complain.
2021-05-20 13:36:04 +00:00
Vlad Zahorodnii
bc22b9e59e Fix build 2021-05-20 16:25:13 +03:00
Xaver Hugl
793cc5fa25 platforms/drm: replace pointer to egl backend with QPointer
If the egl backend gets deleted this leaves a dangling pointer. In
order to prevent crashes with QPainter or EglStreams also don't try
to create dmabuf textures without a EglGbmBackend.
2021-05-20 14:37:55 +02:00
Vlad Zahorodnii
39e2387f9f Rename Item::scheduleRepaint()
One can think that Item::scheduleRepaint() will trigger repaint of the
whole item, but it actually only schedules the next frame. If nothing
has changed on the screen, no real painting will be done unless maybe if
the rendering backend needs to repair the back buffer.
2021-05-19 12:50:11 +00:00
Vlad Zahorodnii
e4ec955d88 Remove shadow related bits in Scene::Window 2021-05-19 14:13:47 +03:00
Vlad Zahorodnii
6f39d79d72 Remove Scene::Window::{discard,update}Pixmap
They are used only by X11Client, so make X11Client call relevants
methods on the surface item directly instead. In hindsight, it will be a
really good idea to make SurfaceItemX11 and SurfaceItemXwayland(?)
automatically manage the window pixmap. However, it can be done once
an item freezing api is added and we fix the cross-fade animation.
2021-05-19 11:10:50 +00:00
Vlad Zahorodnii
9be862999e Remove explicit repaint in InternalClient::commitGeometry()
The associated window item will schedule a repaint if needed.
2021-05-19 09:14:02 +03:00
Vlad Zahorodnii
506214a632 Move repaint scheduling logic to Item
Currently, items depend on scene windows for creating pixmaps, repaint
scheduling, and caching quads.

This change moves repaint scheduling from scene windows to items to
make the scene items depend less on scene windows.

In hindsight, we may clean up the repaint scheduling machinery further
by introducing view objects.
2021-05-19 06:06:01 +00:00
Aleix Pol
386814176b drm: Use KScreen's json files to set up the initial output composition
So far we had a composition setup within kwinrc and kscreen. This
produces flickering sometime and makes the state a bit more flimsy.
This patch changes the kwin's behaviour to use the files produced by
kscreen which are anyways available down the line.

THis simplifies our behaviour down to just one format that we write to
and feed from. This also allows us to leverage it further by using this
format for default setups (which consist in the right file in
~/.local/share/kscreen).
2021-05-18 14:18:38 +00:00
Zhang Liang
66377359e1 Add ther layer property in debug console
Add the layer property for debugging window
2021-05-18 13:35:12 +00:00
Xaver Hugl
7de0f1f2ad platforms/drm: CPU copy for multi-gpu
Not all GPUs can scan out linear buffers, so if import with a dmabuf
fails manually copy the data into a non-linear gbm buffer instead.

BUG: 432707
2021-05-18 14:54:05 +02:00
Vlad Zahorodnii
2d9e2f0c70 effects: Fix EffectWindow::shape() for X11 windows
With the introduction of scene items, the Scene::Window::bufferShape()
method was removed as it makes no sense on wayland - a window may have
several sub-surfaces, so a single region to indicate the shape of the
window won't work.

SurfaceItem::shape() returns the shape of a surface. On Wayland, it
corresponds to the rect of the wl_surface. On X11, it corresponds to the
client window rect inside the frame window, or custom shape region if
the client has set one.

On the other hand, EffectWindow::shape() wants a completely different
thing. If the window is decorated, it needs to return the rect of the
decoration. Otherwise it has to return the shape region if there's one.

In the future, the EffectWindow::shape() function must be removed as it
doesn't fit the item based design. The main reason why we have it at
all is because the x server doesn't support translucency, setting a
shape region is a (hacky) way to work around that limitation, xeyes is
a notable example.

BUG: 437138
BUG: 435862
2021-05-18 12:28:27 +00:00
Aleix Pol
a20a4327f5 screencasting: Make sure we don't stream after we've stopped a stream
When doing some (intense) testing I've seen it crash. This will prevent
it for good.
2021-05-18 11:51:05 +00:00
Vlad Zahorodnii
bd4650482e Remove unused class forward declarations in scene.h 2021-05-18 12:24:56 +03:00
Vlad Zahorodnii
0f2f69ad7c Decouple window pixmaps from scene windows
One of the scene redesign goals is to make wayland surface items
re-usable. So we have the same rendering path for drag-and-drop icons,
software cursors, and window surfaces.

The biggest issue at the moment is that window pixmaps are tightly
coupled with scene windows.

This change de-couples window pixmaps from scene windows. In order to
achieve that, some architecture changes were made.

The WindowPixmap class was replaced with the SurfacePixmap class. A
surface pixmap is created by a surface item.

Under the hood, a SurfacePixmap will create a PlatformSurfaceTexture
object, which contains all the information necessary for the renderer.

The SceneOpenGLTexture class was removed. However, the GLX and the EGL
on X11 backends still mess with GLTexture's internals.
2021-05-18 09:11:24 +00:00
l10n daemon script
13189463b0 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-05-18 01:24:15 +00:00
Vlad Zahorodnii
5ece6d55d6 Replace Toplevel::clientContentPos() with a better solution
The Toplevel::clientContentPos() function is needed to map the surface
local coordinates to the global coordinates. But its name is highly
confusing as there's already a function with a similar name. This change
introduces a helper with a better name to fix the readability issue.
2021-05-17 06:32:21 +00:00
l10n daemon script
18793f83d3 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-05-17 01:33:52 +00:00
Vlad Zahorodnii
edb7867ee9 Prepend "Interactive" to interactive move resize methods
This is to improve code readability and make it easier to differentiate
between methods that are used during interactive move-resize and normal
move-resize methods in the future.
2021-05-16 13:50:25 +03:00
Vlad Zahorodnii
3c2e1a71c4 Unvirtualize Toplevel::bufferGeometry()
This makes the implementation of the buffer geometry consistent with the
frame geometry and the client geometry and removes a virtual method call
from a few hot paths.
2021-05-16 10:48:41 +00:00
Vlad Zahorodnii
7c0bb4180a Remove Workspace::updateClientLayer()
It's the same as calling AbstactClient::updateLayer()
2021-05-16 10:48:06 +00:00
Vlad Zahorodnii
4ba249eee5 wayland: Signal about finished move/resize in destroyClient()
We need to emit the clientFinishUserMovedResized signal to notify
effects such as translucency that the interactive move-resize is
finished. Otherwise, the set() animation won't be cancelled and the
window will get stuck frozen.

BUG: 409376
2021-05-16 10:46:57 +00:00
l10n daemon script
b2548fe0a9 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-05-16 01:23:43 +00:00
Alexander Lohnau
8125f9137f
GIT_SILENT Remove obsolete KRunner property 2021-05-15 10:03:33 +02:00
l10n daemon script
1a1a6077c1 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-05-15 01:19:22 +00:00
Vlad Zahorodnii
77a9d38166 Make libdrm required dependency
As is, kwin with the drm backend results in the most pleasant user
experience on Wayland. Given that and the fbdev being about to be
dropped, making libdrm a required dependency seems a reasonable decision.
2021-05-14 18:00:40 +00:00
Aleix Pol
3b05823f1f libinput: bump required version
So we can remove ifdefs and weird cases to support versions that are far
too old to support anyway.
2021-05-14 17:47:46 +00:00
Nate Graham
b29f211fe4 Disable translucency effect by default
Many reasons have been brought up over the years for why this effect is
not appropriate to be enabled by default:
- It was designed to highlight the whizzy technical feature of being
  able to make windows transparent, which is no longer particularly
  impressive today.
- It looks visually dated.
- It can produce a confusing visual soup by blending a window being
  moved or resized with the content below it, which we recently disabled
  for the Highlight Windows effect.
- If one window is covering up another as a way to deliberately hide the
  content of the lower window, this effect will reveal the hidden
  content whenever the upper window is moved or resized at all.

Overall it does not seem to have enough advantages to offset these
issues. Let's disable it by default--but only for the people who did not
modify its configuration at all. We can assume that those people like
it, so let's keep it on for them.

BUG: 384054
FIXED-IN: 5.23

Closes Phab task T7915
2021-05-14 15:21:11 +00:00
Vlad Zahorodnii
c1969afa10 wayland: Port logind session from GetSessionByPID
It's needed to make kwin_wayland properly systemd managed. A service
launched using systemctl --user is per user, not session.

As a consequence, user services run outside the session. Applications
that deal with user session need some quirks to work with systemd boot.

Unfortunately, GetSessionByPID() doesn't work well with systemd boot,
see bug 433364. GetSession(auto) is shown to work better.
2021-05-14 12:59:26 +00:00
Aleix Pol
f4715b9ac5 inputmethod: deactivate the input method when we textinputv3 is committed as disabled
Fixes InputMethodTest::testEnableDisableV3 on my system when running on
Valgrind, should hopefully also fix on CI.
2021-05-14 09:28:57 +00:00
Vlad Zahorodnii
03445424e9 x11: Don't initialize X11Client's geometries to 0,0 100x100
It is actually okay to start with an empty frame geometry because
manage() will compute the frame geometry from the client's window size.
2021-05-14 07:00:20 +00:00
Vlad Zahorodnii
e5799a2131 Remove force geometry flags
With the client-side decoration changes, kwin will properly determine
whether the window needs to be configured even if the frame geometry has
not changed.

This change slightly changes the semantics of the setFrameGeometry()
method. Prior to this, it was possible to force a geometry, i.e. block
other geometry updates, however such a behavior is counter-intuitive and
it exponentially increases the complexity of code.

As far as I know, the force flag was needed to propagate geometry
changes if the frame geometry doesn't change, but the client geometry
does. With the client-side decoration changes, the force flag is not
needed, as kwin now takes into account the client geometry and the frame
geometry when determining whether to send a configure event.
2021-05-14 07:00:20 +00:00
Vlad Zahorodnii
90d60a530f Try to update geometry without checking if it's the same
Even if the frame geometry is the same, the client geometry may not be
the same. We need to call setFrameGeometry() unconditionally.
2021-05-14 07:00:20 +00:00
Aleix Pol
b9b58b6e66 Use preferred QFileInfo::exists API as documented 2021-05-14 01:35:33 +02:00
Aleix Pol
c405877801 Only mark slots as slots 2021-05-14 01:35:33 +02:00
Aleix Pol
f4adff66cc Do not detach when getting a readonly reference 2021-05-14 01:35:33 +02:00
Aleix Pol
b8a355252d Q_ENUMS -> Q_ENUM
It's more useful
2021-05-14 01:35:33 +02:00
Aleix Pol
b6867bcb75 Normalize SLOT() definition 2021-05-14 01:35:33 +02:00
Aleix Pol
d6e8148675 Add missing Q_EMIT when emitting signals 2021-05-14 01:35:33 +02:00
Aleix Pol
5b5ef7f07e Remove unused variables 2021-05-14 01:35:33 +02:00
Aleix Pol
4b3cc58073 Do not override parent's class signals with the same name 2021-05-14 01:35:33 +02:00
Aleix Pol
035ea75ab7 Use qAsConst in fors when there's a risk for it to detach 2021-05-14 01:35:33 +02:00
Aleix Pol
50dd08531e Make sure we do not get references on temporary objects 2021-05-14 01:35:33 +02:00
Aleix Pol
f70256931c --warning: treat unused variables so we are not warned about them 2021-05-14 01:35:33 +02:00
Aleix Pol
2a9a436307 Prefer Q_ENUM to Q_ENUMS
It does more things and it makes clazy complain.
2021-05-14 01:35:33 +02:00
Aleix Pol
a06bf936bc --warning: Remove unnecessay cast 2021-05-14 01:35:33 +02:00
Aleix Pol
1754744297 Add switch case for impossible enum
It's already treated above and the compiler just does not see it.
2021-05-14 01:35:33 +02:00
Aleix Pol
6176a63d76 Remove unnecessary moc files
They are not necessary if there's no QObjects being declared and just
produce a warning from moc
2021-05-14 01:35:33 +02:00
Aleix Pol
edd1ec389b input: Use specific API
No need to construct values that are already provided
2021-05-14 01:35:33 +02:00
Aleix Pol
84200e7e38 EffectWindow::geometry -> EffectWindow::frameGeometry
::geometry is deprecated.
2021-05-14 01:35:33 +02:00
Vlad Zahorodnii
bf2e54fb5e wayland: Make some animations less glitchy
If a minimized window is animated by the AnimationEffect, the final
layer repaint will be ineffective. In order to account for that, the
AnimationEffect adds the layer repaint to data.paint in the
prePaintScreen() hook. The issue with this hack is that it does not
work on Wayland with per screen rendering.

If a window is animated on screen B, but the layer repaint is added
to data.paint when screen A is painted, there will be a ghost of the
window on screen B.

In order to fix this issue, we need to use effects->addRepaint(), but
we cannot use it in prePaintScreen() as it won't have immediate effect.

effects->addRepaint() can be called either from window paint hooks
or from the postPaintScreen() hook. This change goes after the latter
option.

In the prePaintScreen() hook, AnimationEffect will only advance
animations. In the postPaintScreen() function, it will perform final
janitorial chore.
2021-05-13 20:29:41 +00:00
Vlad Zahorodnii
33b2ea2058 wayland: Fix internal connection teardown
The internal EventQueue is a child of the registry object. This means
that after the registry is destroyed, all proxy objects in that event
queue are going to have invalid reference to it, which is not a problem
as long as the wl_display_dispatch() function is not called.

The wl_display_dispatch() function uses wl_proxy's queue reference to
enqueue incoming events to that queue.

Unfortunately, during teardown, the internal ConnectionThread may
dispatch events right after the registry object has been destroyed,
which can lead to a crash.

In order to fix the crash, we need to destroy all proxy objects and only
after that we can destroy the event queue. It's okay if wayland events
are dispatched in between.
2021-05-13 18:51:35 +00:00
Nate Graham
7861c8d389 Expose compositing status to Switcher QtQuick item
This allows Task Switcher visualizations to know whether compositing is
active or not so they can adjust their visual representations
accordingly, if needed.
2021-05-13 18:50:11 +00:00
Vlad Zahorodnii
7d0cad07fb autotests: Fix XwaylandInputTest
For some reason, Xwayland doesn't like starting without outputs. If
outputs are added later, it sends bogus EnterNotify and LeaveNotify
events.
2021-05-13 11:44:41 +00:00
Vlad Zahorodnii
432c617d10 Revert "wayland: Simplify XdgSurfaceConfigure"
This reverts commit 110182b213.

The reverted commit has introduced a regression where interactively
moved windows jump back to their old position. This needs some time for
proper investigation. Due to beta rolling out quite soon, it will be
better to revert the change.
2021-05-13 10:18:10 +03:00
Vlad Zahorodnii
110182b213 wayland: Simplify XdgSurfaceConfigure
Rather than have an error prone way to detect whether a configure event
has good position information, handle the case where the plasma shell
surface has a position hint explicitly.
2021-05-13 06:50:24 +00:00
Vlad Zahorodnii
0e63b4e8cc wayland: Simplify plasmashell surface installation code 2021-05-13 09:20:20 +03:00
Vlad Zahorodnii
7475385c82 Make scale and glide effect ignore lockscreen greeter
On X11, the lockscreen greeter is an override-redirect window so the
scale and the glide effect ignore it.

On Wayland, the lockscreen greeter is a regular window so both effects
try to animate it upon the screen being unlocked, which looks bad.
2021-05-13 05:46:30 +00:00
Vlad Zahorodnii
32848490ba wayland: Call KSldApp::lockScreenShown() for layer-shell lockscreen clients
The lockscreen no longer creates xdg-toplevel surfaces.
2021-05-12 22:14:42 +03:00
Aleix Pol
8e63bd230f InternalWindowEventFilter: Also track pressed ids for touch points != 0
So far we were only tracking the first touch point, meaning that if 2
touch points were applied to the internal window and removed one, the
second's events would then be sent to Wayland, which would assert since
it didn't know it had been pressed in the first place.

This fixes InternalWindowTest::testTouch
2021-05-12 17:38:03 +00:00
Vlad Zahorodnii
e187e766b0 Only promote windows to upper layers if one of the group members is in fullscreen mode
We want panels to be behind fullscreen windows, but osd windows above
them. With the current layer promotion logic, the panel will be promoted
to the osd layer, which is undesirable. This change restores the old
behavior by allowing layer promotion only to ActiveLayer.

BUG: 436985
2021-05-12 17:02:04 +00:00
Vlad Zahorodnii
d031381f19 Fix a typo
We should update stacking_order, not x_stacking_order.
2021-05-12 16:59:08 +00:00
Vlad Zahorodnii
e29dee951d Don't invalidate x stacking order prematurely
Workspace::updateStackingOrder() will mark it as dirty if the stacking
order actually changes due to a constraint being added or removed.
2021-05-12 16:59:08 +00:00
Aleix Pol
0fbde9a2e0 Add a virtual destructor for XdgSurfaceConfigure
It's inherited by XdgToplevelConfigure and we need to make sure that the
object gets destroyed properly.
Alternatively we get a new-delete-type-mismatch error in ASAN and
rightfully so.
2021-05-12 16:14:31 +02:00
Vlad Zahorodnii
eef97904b6 Simplify Workspace::constrainedStackingOrder()
Workspace::constrainedStackingOrder() is a constant source of issues.
This change replaces the current logic that builds the stacking order to
hopefully make constrainedStackingOrder() less crashy.

With the new version, constrainedStackingOrder() doesn't perform layer
caching. On the other hand, it's quite rare to see apps in the wild that
have more than just 1 or 2 members in the window group.

BUG: 436095
2021-05-12 11:50:38 +00:00
Vlad Zahorodnii
0de2b73393 Introduce transient constraints api in Workspace
Currently, the Workspace has no any api to constrain one window above
another. This results in having hacks such as keepDeletedTransientAbove()

This change introduces a basic api to constrain a given window above
another. It can be used for ensuring that transient windows are placed
above their parents. It also can be used for stacking the outline window
below the move-resize window.

Internal windows may also have transient parents. Because of that, this
change makes the workspace add internal clients to the stacking order by
default. The good thing about it is that it allows us unify some input
related code for "external" windows and internal windows.
2021-05-12 11:50:38 +00:00
Vlad Zahorodnii
9b2b450fdd wayland: Use new api to remove globals safely
BUG: 435258
2021-05-12 11:31:36 +00:00
Aleix Pol
2a32e642ed No need to compare values if we know they already changed
Makes for more readable code as well as less code to execute
2021-05-12 10:44:22 +00:00
Aleix Pol
8979f83e38 Unify the code that turns StrutAreas into QRegion 2021-05-12 10:44:22 +00:00
Zhang Liang
837ef14e46 Change the argument name in function declaration
Change the name from "pipewireStream" to "stream",keep it same as definition.
2021-05-12 10:39:03 +00:00
Vlad Zahorodnii
500321f2b5 xwayland: Relax requirements for /tmp/.X11-unix/ ownership
Hopefully, this will fix some tests in CI. It should be fine if
/tmp/.X11-unix/ is owned by the same user as getuid().
2021-05-12 13:02:12 +03:00
l10n daemon script
4269f13e58 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-05-12 01:17:30 +00:00
Andrey Butirsky
e74d8ddfc8 Revert "Register unique service name when wayland keyboard interface is in use"
This reverts commit e6eee5f970
2021-05-11 22:37:42 +03:00
Vlad Zahorodnii
1e6c5a7420 effects/squash: Use cubic easing curve
According to the HIG, the InCubic easing curve should be used if the
animated item changes its state from visible to invisible and the
OutCubic easing curve if vice versa.
2021-05-11 19:25:31 +00:00
Bhushan Shah
6b25335a2b inputmethod: fix coding style
GIT_SILENT
2021-05-11 16:44:01 +05:30
Aleix Pol
64178a0536 textinputv3: activate the input method when textinput says it's enabled 2021-05-11 12:47:27 +02:00
Vlad Zahorodnii
000ed7b122 wayland: Init outputs before emitting WaylandServer::initialized
This shouldn't make any difference, but it makes more sense to emit the
initialized signal after the outputs are added rather than before.
2021-05-11 10:45:28 +00:00
Aleix Pol
1e4b48df2e useractions: Remove redundant logic 2021-05-11 12:38:00 +02:00
Bhushan Shah
4e7c6b57a6 platforms/drm: put double tap timer behind config option
This feature was implemented in commit a66eb1a5b9 earlier

Double tap wake up is not a feature to be implemented at compositor
level but rather at the hardware/kernel level. Double tap timer here
means when screen is turned off, libinput will continue to poll the
touchscreen for new events.

double-tap-to-wakeup is generally interrupt at driver/hardware level
which have ability to wake system up even from the sleep.

Provide a option to disable the double tap timer on kwin side for
devices which makes use of suspend since when in suspend kwin can not
wake device up, and that provides confusing user experience.
2021-05-11 00:47:21 +00:00
Vlad Zahorodnii
9577423dfa Remove most_recently_raised micro optimization
This micro optimization is simply not worth having. raiseOrLowerClient()
is not in any hot path, besides that raiseClient() is not the only place
where a window can be raised above other windows. In addition to that,
the most_recently_raised check in raiseOrLowerClient() doesn't take into
account whether the cached window is on the current activity.
2021-05-10 19:49:34 +00:00
Vlad Zahorodnii
7261bbb230 Fix bad QObject::connect() argument
This fixes the warning that's printed when InputMethod tries to connect
the frameGeometryChanged signal of a null toplevel.
2021-05-09 22:45:27 +00:00
l10n daemon script
213c98213a 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-05-09 01:20:52 +00:00
l10n daemon script
baf3ddea72 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-05-08 01:17:47 +00:00
Aleix Pol
c544d4f297 slide effect: remove redundant code 2021-05-08 00:37:52 +00:00
Vlad Zahorodnii
77091f7fcb Remove manual discardWindowPixmap() calls in InternalClient
SurfaceItemInternal will discard the current pixmap if the buffer size
changes. Also, one of the goal of the scene redesign is to keep things
such as this out of Toplevel subclasses.
2021-05-07 17:34:31 +00:00
Bhushan Shah
119b00f896 inputmethod: use output geometry for positioning keyboard when locked
otherwise it will take the panel strut in account when positioning
inputmethod on lockscreen and that will not be positioned correctly.
2021-05-07 14:18:57 +00:00
Vlad Zahorodnii
aeca1af4ac Propagate correct maximize mode to decorations
When the maximize mode changes from MaximizeFull to either
MaximizeHorizontal or MaximizeVertical, (max_mode & MaximizeFull) will
evaluate to true because MaximizeFull is defined as bitwise OR between
MaximizeHorizontal and MaximizeVertical.
2021-05-07 14:18:04 +00:00
Aleix Pol
b9b349caa2 Mark deprecated API as deprecated
We'll hardly port away from it if it's just on the documentation. At the
moment they're used all over the place.

If they didn't have a replacement, they should be undepreprecated.
2021-05-07 13:11:26 +00:00
l10n daemon script
64b4caae95 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-05-07 01:17:26 +00:00
Vlad Zahorodnii
018177b576 Limit VRR policy in support information only to Wayland session
Adaptive sync is only supported on Wayland.

BUG: 436623
2021-05-05 16:55:18 +03:00
Jan Grulich
caaabf84df Screencast: use dma-bufs only when client explicitly asks for it 2021-05-05 10:01:49 +02:00
Vlad Zahorodnii
a0fc0277a7 wayland: Make fullscreen mode updates async
Currently, the fullscreen state is update synchronously, but it needs to
be done in asynchronous fashion.

This change removes some tests as they don't add any value, testFullscreen()
covers them all.
2021-05-05 06:11:42 +00:00
Vlad Zahorodnii
62500acd1a effects/fullscreen: Rewrite the effect using ES6 features
This is to keep the fullscreen effect in sync with the maximize effect.
2021-05-05 06:08:42 +00:00
Friedrich W. H. Kossebau
7b36c6443e Port away from ECMSetupVersion's deprecated *_VERSION_STRING CMake variable
GIT_SILENT
2021-05-04 23:45:34 +00:00
Aleix Pol
4aefbdd175 --warning 2021-05-04 23:07:16 +02:00
Xaver Hugl
5bd938f0f0 platforms/drm: release gbm buffers before eglDestroySurface
BUG: 436500
2021-05-04 17:36:09 +00:00
Adriaan de Groot
49fcadb185 Fix build on 32-bit systems
The added comment explains it all, really: you can't fit a 32-bit
unsigned into a 32-bit (signed) time_t, but we don't care.
2021-05-04 12:34:07 +00:00
Xaver Hugl
bd4a8be319 platforms/drm: fix DrmOutput::updateMode 2021-05-04 10:01:55 +00:00
Vlad Zahorodnii
073b6efc14 wayland: Fix focus follows mouse policy
We want to update the input focus only if the pointer is moved. Due to
that, AbstractClient::enterEvent() checks the last seen pointer position
to decide whether the window needs to be focused.

The issue is that when the pointer moves from a decoration to a surface,
the cached pointer position will be updated to the current pointer
position, and thus the check in AbstractClient::enterEvent() will fail.

We need to update the cached pointer position only if there is a focused
decoration.
2021-05-04 09:41:22 +00:00
Vlad Zahorodnii
b4987a9100 3rdparty: Synchronize xcursor.c with upstream 2021-05-04 09:40:29 +00:00
Nate Graham
85d9efcec7 [kcmkwin/kwindecoration] Make a bit more room for the decoration buttons 2021-05-03 21:42:05 -06:00
Nate Graham
2157e83bfb [kcmkwin/kwindecoration] Use clearer text for "Menu" decoration button 2021-05-03 21:35:27 -06:00
l10n daemon script
84c2e4662e 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-05-04 01:16:46 +00:00
Vlad Zahorodnii
3af5e9c8c4 effects/screenshot: Fix a typo
grabPointerImage() needs the coordinates of the top left corner of the
screen, not its size.
2021-05-03 20:54:09 +03:00
Xaver Hugl
089134d0bd platforms/drm: GPU power management
When a GPU has no outputs attached we need to release all resources and
close the fd to allow the driver to completely power down the GPU. This
is also required to allow the driver to be unloaded for VFIO.
2021-05-03 18:03:09 +02:00
Vlad Zahorodnii
403a04fe24 wayland: Fix loading of HiDPI cursors
Xcursors don't support hidpi so if a hidpi cursor is needed, kwin will
scale the desired size by the scale factor and ask Xcursor helpers to
load a theme with the given name and the size.

However, the theme loading code doesn't take into account that Xcursor
theme loading helpers may not return cursor sprites of size size * scale
if the theme has no such a size.

For example, if the cursor theme only provides 24, 36, and 48 sizes and
kwin attempts to load cursors of size 48 with a scale factor of 2, we
will get cursors of size 48 instead of 96. Unfortunately, this will
result in the issue where the cursor shrinks when hovering decorations
because kwin doesn't know that the effective scale factor (1) is
different from the requested scale factor (2).

In order to fix loading of HiDPI cursors, we need to approximate the
effective scale factor of every cursor sprite as we load it.
2021-05-03 10:52:25 +03:00
Vlad Zahorodnii
7397364115 scripting: Deprecate WorkspaceWrapper::screenResized
The WorkspaceWrapper::screenResized() signal relies on the QDesktopWidget
class, which is deprecated. Another issue with that signal is that it
uses integers to represent screens. We need to minimize the amount of int
based screen api and prefer more QScreen or AbstractOutput APIs because
the former get completely broken if the output layout changes.

Since we gain not a lot from porting WorkspaceWrapper::screenResized()
away from QDesktopWidget to something else and we don't use this signal
in any of our scripts, this change deprecates the screenResized signal
in favor of manual tracking of QScreen::geometryChanged signal.
2021-05-03 07:50:27 +00:00
Bhushan Shah
d987b94e42 inputmethod: do not deactivate the context when key is pressed
When keyboard_grab is implemented, if we reset the inputmethod context
on any key, input method will not get keyboard input and will not be
able to use it.
2021-05-03 09:44:27 +05:30
l10n daemon script
31cdb8676d 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-05-03 01:21:56 +00:00
Vlad Zahorodnii
a503efad45 Fix a typo
There is no matching opening parenthesis but the effect still works for
some reason.
2021-05-02 14:42:48 +03:00
Vlad Zahorodnii
411443bc05 effects/fade: Add a note reminding to remove FadeWindows option 2021-05-02 11:10:19 +00:00
Vlad Zahorodnii
24a474cb6c effects/fade: Rewrite the effect using ES6 features
This cleans up the code of the effect.
2021-05-02 11:10:19 +00:00
Vlad Zahorodnii
9fb58479b7 effects/scale: Rewrite the effect using ES6 features
Since the scripted effects were ported to QJSEngine, it's possible now to
use ECMAScript 2015 perks such as classes, let and const.

This change ports the scale effect to some ES6 features to make the code
neater.
2021-05-02 11:09:27 +00:00
Vlad Zahorodnii
db020c5614 effects/maximize: Rewrite the effect using ES6 features
Since the scripted effects were ported to QJSEngine, it's possible now to
use ECMAScript 2015 perks such as classes, let and const.
2021-05-02 11:08:13 +00:00
Xaver Hugl
6a9d82eb55 don't set vrr policy on incompatible monitors 2021-05-02 00:06:39 +00:00
Ömer Fadıl Usta
a8d7e99874 [plugins/platforms/drm/drm_backend] Fix build for bsd 2021-05-01 19:43:00 +00:00
Vlad Zahorodnii
8d9e47ee22 platforms/drm: Introduce KWIN_DRM_DEVICES
This allows to instruct kwin what drm devices must be used explicitly.

BUG: 435467
2021-05-01 12:14:34 +00:00
l10n daemon script
23e3a9a86f 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-05-01 01:21:12 +00:00
Aleix Pol
904c48d563 inputmethod: properly report the text_input_v2 overlap information
Call ::updateInputPanelState when necessary (instead of a trimmed-down
refreshFrame version.
Actually provide the overlap information when it's available, there's no
need to send wrong information there.
2021-04-30 17:46:52 +02:00
Xaver Hugl
faddf0bf5f Wayland: variable refresh rate support
BUG: 405912
2021-04-30 16:18:39 +02:00
Nate Graham
2a6fe9748f [kcmkwin] Apply grid delegate KCMs on double-click
To be consistent with plasma-workspace KCMs which we applied this to in
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/606
2021-04-29 20:14:05 -06:00
Vlad Zahorodnii
706eb16b3a Remove Platform::screenGeometries and Platform::screenScales
If you need screen geometries or scales, use AbstractOutput::geometry()
and AbstractOutput::scale(), respectively.
2021-04-29 11:31:31 +00:00
Aleix Pol
cadb13de0e inputmethod: fix how we update to input method changes
Properly notify about changes from the kcm and properly integrate them.
So far it only worked between having and not having a keyboard.
2021-04-29 11:04:19 +00:00
Aleix Pol
baa246fbb7 inputmethod: improve the integration of the SNI
* Adds a context menu to choose virtual keyboards.
* Notifies when there is no virtual keyboard selected.
2021-04-29 11:04:19 +00:00
Aleix Pol
050ce24247 inputmethod: Move the input method process into the InputMethod class
Use the control this gives us for stopping the input method process when
we disable.
2021-04-29 11:04:19 +00:00
Vlad Zahorodnii
ac3c09ba75 Remove Platform::areOutputsEnabled()
This flag is redundant. If an output is disabled, the compositor won't
attempt to perform compositing on it.
2021-04-29 10:47:41 +00:00
Vlad Zahorodnii
f8c00a530f Remove Platform::prepareShutdown()
Platform::prepareShutdown() was introduced to work around the issue
where the platform accesses destroyed OutputDeviceInterface objects.

Since we no longer query OutputDeviceInterface for output info, the
Platform::prepareShutdown() function can be dropped.
2021-04-29 10:47:41 +00:00
Vlad Zahorodnii
2200f4ded9 windowsystem: Fix compilation with no deprecated build of KWindowSystem
Highlight window and present windows API has been deprecated in 5.82.
2021-04-29 10:46:39 +03:00
Vlad Zahorodnii
9e1de4522e platforms/drm: Remove unused defs and includes in drm_backend.cpp 2021-04-29 08:45:27 +03:00
Vlad Zahorodnii
44fc23f6e7 Fix build on FreeBSD 2021-04-29 08:36:26 +03:00
Vlad Zahorodnii
c4c46a089f platforms/drm: Properly detect if there are no DRM devices
If no primary gpu can be found, we need to quit.
2021-04-29 05:34:19 +00:00
Vlad Zahorodnii
9f030ecd40 platforms/drm: Enable atomic modesetting in hot plugged gpus
At the moment, if a gpu is hot plugged, it won't have atomic modesetting
enabled.
2021-04-29 05:34:19 +00:00
Vlad Zahorodnii
03c38e02e9 platforms/drm: Remove DrmBackend::findOutput()
It's unused.
2021-04-29 08:10:37 +03:00
Vlad Zahorodnii
54a034b7cf platforms/drm: Use dev nums to find gpus
This way we don't need to convert strings to ints every time
udev_device_get_sysnum() is called.
2021-04-29 04:58:46 +00:00
Vlad Zahorodnii
fe0039091c platforms/drm: Don't search for gpus on add udev event
If a gpu is added, don't search for it pointlessly in m_gpus.
2021-04-29 04:58:46 +00:00
Felipe Kinoshita
a2ed8cb9da
[effects/presentwindows] add a comment explaining why we are darkening the panel 2021-04-29 01:14:56 -03:00
l10n daemon script
1c6be7e32c 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-04-29 01:20:31 +00:00
David Edmundson
ccc5551ff0 [Input] Unset device group user data on teardown
BUG: 436287
2021-04-28 22:43:57 +00:00
Vlad Zahorodnii
04c3bee803 Remove unused things in drm_backend.h 2021-04-28 22:12:58 +03:00