Commit graph

23977 commits

Author SHA1 Message Date
Xaver Hugl
2525109f1a window: use std::unique_ptr to manage the windowitem 2023-01-07 21:52:10 +01:00
Xaver Hugl
797bcb8bda window: use std::unique_ptr to manage the effectwindow 2023-01-07 21:52:10 +01:00
Xaver Hugl
3c8d2d6f18 window: use std::unique_ptr to manage the shadow 2023-01-07 21:52:10 +01:00
Weng Xuetian
6e87fae7f7 Support XKB_CONTEXT_NO_SECURE_GETENV flag
Since kwin play with CAP_SYS_NICE, secure_getenv will fail for xkbcommon
to load user level xkbmap. This allows kwin to load config under
~/.config/xkb

BUG: 447206
2023-01-07 11:35:42 +00:00
l10n daemon script
d4f847574e GIT_SILENT Sync po/docbooks with svn 2023-01-07 03:04:40 +00:00
l10n daemon script
97041dab12 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"
2023-01-07 02:06:50 +00:00
Vlad Zahorodnii
b0e452563b kcms/effects: Fix effect loading/unloading order
There are effects that are mutually exclusive, e.g. magnifier and zoom.
They both use the same global shortcuts.

When switching from zoom to magnifier, the zoom effect must be unloaded
first, then the magnifier effect can be loaded. Doing so in the opposite
order will break global shortcuts in the magnifier effect because
zooming shortcuts are still bound by the zoom effect.

BUG: 457800
2023-01-06 13:41:38 +00:00
l10n daemon script
ad4d615b23 GIT_SILENT Sync po/docbooks with svn 2023-01-06 02:50:09 +00:00
Nate Graham
6a1552efb6 utils/xcbutils: reduce severity of "precision lost" message a debug
Right now this is marked as critical, but it's not a critical error.
Make it a debug to avoid spamming logs with not-very-actionable
information.

BUG: 463259
FIXED-IN: 5.27
2023-01-05 13:59:43 -07:00
David Edmundson
1651b7d1d7 Include layer postPaint in render loop timings
We need render timings in the journal to be as close as possible to the
entirity of the composite function up until the backend presenting.
2023-01-05 14:41:43 +00:00
Han Young
d57495c8df Remove tablet tool when the tablet device is removed
Explicitly remove the tablet tool device when the corresponding sys event interface is removed.
2023-01-05 14:40:46 +00:00
David Edmundson
0167b7d7b0 libinput: Ignore touch events without outputs
A touch device could have no output object assigned due to the screen
being disabled, queued events or malconfiguration.

Using output would crash. Touch up is guarded so that we have matching
pairs.

BUG: 463385
2023-01-05 08:29:06 +00:00
l10n daemon script
f094b3693c GIT_SILENT Sync po/docbooks with svn 2023-01-05 02:27:57 +00:00
l10n daemon script
8675ee5939 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"
2023-01-05 02:00:53 +00:00
Nicolas Fella
54e384e68e Enable scripted effects to load config translations from the kpackage
By default translations are loaded from /usr/share/locale. This works fine for builtin effects
since we install our translations there.

However, it doesn't work for third-party scripted effects. They only provide a kpackage and can't
install anything to /usr/share/.

This patch allows them to ship translations in contents/locale/$language/LC_MESSAGES/$domain.mo,
where $domain is the X-KWin-Config-TranslationDomain metadata value

This matches what Plasma does for applets since https://phabricator.kde.org/D5209

CCBUG: 317338
2023-01-04 21:35:59 +01:00
Nicolas Fella
a40dd9a158 Only make startup notification change the virtual desktop if requested
Startup notifications optionally contain the target desktop the app should be launched to.

If present the window is sent to that desktop, if not it is sent to the current desktop.

Later in Workspace::activateWindow we check if the window is on the current desktop, and if not
we either move it to the current desktop or switch to the window's desktop depending on user preference.

However, this is broken because the window was already moved to the current desktop. To avoid this
only move the window if specifically requested by the startup id.

BUG: 462996
2023-01-04 12:12:26 +00:00
Vlad Zahorodnii
b549776b68 scene: Avoid creating SurfaceItem for Xwayland's cursor surfaces
SurfaceInterface::scaleOverride() doesn't scale the bufferScale, so if the
scale override is 2, but the buffer scale specified by the client is 1,
bufferScale() will return 1.

Xwayland cursor surface implicitly relied on this behavior.

Porting cursor to SurfaceItem changed that. Now cursor surfaces honor
the scale override, which makes Xwayland cursors too small.

In order to properly fix, plasma has to scale Xcursor.size in xrdb. The
problem is that plasma also sets XCURSOR_THEME and XCURSOR_SIZE envvars
that take precedence. Plasma must stop setting those envvars, but it's
doable only with Qt 6.5, which got MouseCursorTheme and MouseCursorSize
hints in QPlatformTheme.
2023-01-04 11:10:32 +00:00
Vlad Zahorodnii
c10b35facb backends/wayland: Pass linux-dmabuf buffers for cursor layer
This lets us avoid reading fbo data back.
2023-01-04 09:19:12 +00:00
Vlad Zahorodnii
9f100e8292 core: Make Output::setCursor() take CursorSource
It decouples the contents of the cursor from QImage.
2023-01-04 09:19:12 +00:00
Vlad Zahorodnii
d8e6992512 tiling: Fix invalid sender object in connect()
RootTile is a CustomTile and it has no parent because it's the root.
Therefore the sender object in connect() will be null and it's going to
produce a warning.
2023-01-04 09:00:44 +00:00
Oliver Beard
7b714bdecb plugins/nightcolor: Use Night Color icon for preview OSD 2023-01-04 04:26:40 +00:00
l10n daemon script
953f497386 GIT_SILENT Sync po/docbooks with svn 2023-01-04 03:01:41 +00:00
l10n daemon script
824ef8a74e 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"
2023-01-04 02:02:56 +00:00
Xaver Hugl
885e3712fc useractions: add "Move to Activity" entries
This mirrors the menu in the task manager and makes it a lot more convenient
to send windows to the correct Activity

BUG: 440036
2023-01-03 23:12:18 +00:00
Xaver Hugl
6e13e21a08 workspace: take touch and tablet into account for active output follows mouse
While not technically fitting for the name of the option, the behavior is what a user
would expect and it also matches with X11 (where the cursor goes to the touch position).
2023-01-03 20:01:11 +00:00
Vlad Zahorodnii
fb1a6ecd8d backends/drm: Fix buffer centering with active hardware transform
Prior to beb6cca65d, the drm backend used
to specify QRect(0, 0, modeSize.width(), modeSize.height()) CRTC rect,
so we didn't have to care about buffer transforms, but now that we
compute the CRTC rect from the buffer size, we have to take the buffer
transform into account.

It fixes squashed output contents when the output is rotated 90 or 270
degrees and it uses hardware transforms.
2023-01-03 17:36:21 +00:00
Vlad Zahorodnii
88563cbc8e scene: Remove addDamage() in SurfaceItem::discardPixmap()
Scene::Window::discardPixmap() used not to add damage. No idea how it
got in SurfaceItem::discardPixmap(). Perhaps a mishap when introducing
window items.

From logical point of view, adding damage when discard a pixmap is not
necessary too because a new pixmap is going to be created.
2023-01-03 11:55:36 +00:00
Vlad Zahorodnii
3725d67ee1 scene: Introduce cursor item and scene
The cursor scene contains the contents of the cursor. It contains a
CursorItem. The CursorItem either creates a SurfaceItem or an ImageItem
based on the currently attached CursorSource.

The cursor item is rendered by the cursor scene. For now, wherever the
cursor must be rendered, a dummy scene delegate is constructed. It's not
nice but it's a pretty cheap operation. There's a lot of potential for
clean up by moving cursor layer handling from output backends to
compositor. The main reason why there are no persistent scene views is
that it's just easier than tracking when they are actually used, e.g.
after switching between hw and sw cursor.

The software cursor fallback is a bit tricky case. It made to work by
constructing a scratch fbo. The cursor scene is rendered in the scratch
fbo, which is then rendered on the screen. Similar to the case above,
there's space for improvements, but I don't think it has to block the
effort for reusing Items to render the cursor.
2023-01-03 09:33:17 +00:00
Vlad Zahorodnii
dda77f5942 scene: Introduce ImageItem
The ImageItem provides a way to integrate an image in the scene graph.
2023-01-03 09:33:17 +00:00
Oliver Beard
036a66f996 plugins/nightcolor: Use Night Color icon for OSD
This makes the OSD message for Night Colour inhibition use the same icon as the tray applet.

I'm not sure where the original icon `preferences-desktop-display-nightcolor-off` is, but it would seem a good idea to remove it?
2023-01-03 09:00:32 +00:00
l10n daemon script
699e060d37 GIT_SILENT Sync po/docbooks with svn 2023-01-03 03:22:19 +00:00
Xaver Hugl
d49cb64231 scene: ensure OpenGL texture is updated after direct scanout
While direct scanout happens, the damage of the SurfaceItem is reset, which
can cause the OpenGL texture to not be updated once direct scanout ends,
and leave the texture outdated until the surface is damaged again.
In order to fix that, make sure the texture is always fully updated after
the SurfaceItem has been used in direct scanout.
2023-01-02 12:57:13 +01:00
Steve Leung
501a45a869 scripting: log callDBus errors at warning level
If `callDBus` hits a problem, KWin will log a debug message saying that an error occurred, but it does not log the actual error message.  This makes troubleshooting KWin scripts more difficult.

Since the call failed, log the message at warning level to make it more visible.
2023-01-02 09:25:13 +00:00
Vlad Zahorodnii
58916aac4e tabbox: Remove Xcb::sync()
TabBox::hide() used to contain the following code

    QApplication::syncX();
    XEvent otherEvent;
    while (XCheckTypedEvent(display(), EnterNotify, &otherEvent))
        ;

The purpose of XSync() is to flush any pending requests and wait until
the X server processes them. After that, we can go through event queue
to find relevant events.

Why did tabbox go through the event queue to find the EnterNotify
events? It's unclear. So it was removed in
b4c957b617. However, the XSync() call was
left out. It doesn't make sense on its own. So remove it too.
2023-01-02 08:28:47 +00:00
l10n daemon script
d91e288672 GIT_SILENT Sync po/docbooks with svn 2023-01-02 03:05:37 +00:00
l10n daemon script
8e140db62e 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"
2023-01-02 02:31:51 +00:00
l10n daemon script
3aa3b98033 GIT_SILENT Sync po/docbooks with svn 2023-01-01 03:04:22 +00:00
l10n daemon script
752f565521 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"
2023-01-01 02:21:02 +00:00
Andreas Cord-Landwehr
ee87e8699d Include missing cmath header for std::round
Fixes compilation on Yocto Kirkstone.
2022-12-31 12:18:27 +00:00
Parag W
6352173651 Fix compile failure without XINPUT
Declare and reference m_xinputIntegration only if HAVE_X11_XINPUT is defined and enabled.
2022-12-31 11:19:45 +00:00
l10n daemon script
133315267b GIT_SILENT Sync po/docbooks with svn 2022-12-31 02:21:03 +00:00
Xaver Hugl
beb6cca65d backends/drm: support hardware scaling with direct scanout 2022-12-30 18:16:26 +00:00
Niklas Stephanblome
39612ade13 effects/overview: allow entering spaces in search field
In the Overview effect, pressing the space bar doesn't always insert a
space character into the search field as one would expect; when the text
in the search field matches any windows, it instead activates the
highlighted window. At other times, it does insert a space as expected.

This behavior is unpredictable and unintuitive, so this commit fixes the
issue by intercepting the key input event and inserting a space when the
search field has focus. In this state, the highlighted window can be
activated using the enter/return key. When the search field doesn't have
focus, a press of the space bar will continue to activate the selected
window.
2022-12-30 17:44:48 +00:00
Xaver Hugl
00c0f29f8e autotests/drm: add test that verifies extending output lifetimes works 2022-12-30 14:53:45 +00:00
Xaver Hugl
239207c5ee backends/drm: extend connector lifetime to match their outputs
As disconnected outputs outlive DrmGpu::updateOutputs, the DrmConnector
and DrmPipeline must also be kept valid for that time

BUG: 463334
2022-12-30 14:53:45 +00:00
Nicolas Fella
ccaf0210d1 Ignore critical notifications in window heap effects
We filter out regular notifications, but critical notifications are their own window type, so we need to explicitly filter them too

BUG: 463437
2022-12-30 10:47:09 +00:00
l10n daemon script
87cd6bda4e GIT_SILENT Sync po/docbooks with svn 2022-12-30 10:04:38 +00:00
l10n daemon script
04b7c79329 GIT_SILENT Sync po/docbooks with svn 2022-12-30 02:42:48 +00:00
l10n daemon script
fddd65deda 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"
2022-12-30 02:09:12 +00:00
Joshua Goins
37adc06603 wayland: Send tilt and rotation events, if supported
While tilt is sent on X11, we're currently only sending pressure events and not tilt/rotation events on Wayland. Since Krita is still running in X11, and it's running through XWayland - it's technically a Wayland client and gets no tilt/rotation. This fixes that issue :-)

I saw !3231 which was working on complete Wayland tablet support, but it's been stagnating. I just wanted tilt & rotation support now, so I added a way to query capabilities from the `m_capabilities` variable on the private interface we already fetched.

Tested on Krita using the Tablet Debug Log.
2022-12-30 01:57:25 +00:00