Commit graph

20230 commits

Author SHA1 Message Date
Vlad Zahorodnii
f70c745ac0 Fix placement of windows on disconnected outputs
If an output is disconnected, the Workspace will update the
Toplevel.output property for all windows that are on that output, then
it will call AbstractClient::checkWorkspacePosition() to fix window
position.

That may result in some windows partially sticking outside visible area
because AbstractClient::checkWorkspacePosition() has no idea what output
the window was.

This change addresses that problem by delaying updating the
Toplevel.output property so AbstractClient::checkWorkspacePosition()
could pick better window placement.
2021-10-31 18:20:12 +00:00
l10n daemon script
954151ca97 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-10-31 01:14:25 +00:00
Vlad Zahorodnii
cd018b6ba3 effects/screenshot: Add org.kde.KWin.ScreenShot2.CaptureActiveScreen
The new method can be used to implement the "Current Screen" capture
mode in Spectacle.
2021-10-30 20:50:33 +00:00
Vlad Zahorodnii
d1b2a0e4d4 effects: Fix blur and background contrast metadata
The role of enabledByDefaultMethod was misinterpreted. It exists only
for kcms so they can display undetermined state. EnabledByDefault should
still be set to a valid value.
2021-10-30 23:41:13 +03:00
Vlad Zahorodnii
218db74000 Remove a GeometryUpdatesBlocker in AbstractClient::checkWorkspacePosition()
It was added to work around an async geometry issue on Wayland, which is
no longer actual.
2021-10-30 14:02:32 +00:00
Vlad Zahorodnii
4928f4db5b Try to preserve window position relative to their outputs during hotplug
Currently, if an output is hotplugged, all windows will be scrambled,
which is highly annoying.

With this change, windows will stick to their outputs if an output has
been connected or disconnected.

BUG: 296673
BUG: 378896
BUG: 412703
BUG: 443698
2021-10-30 14:02:32 +00:00
Vlad Zahorodnii
ee41e9b6e7 Fix Workspace::inUpdateClientArea() with auto-hide panels
If there's an auto-hide panel, m_oldRestrictedAreas will be empty, which
will break AbstractClient::checkWorkspacePosition().
2021-10-30 14:02:32 +00:00
Vlad Zahorodnii
6faf4ec3a2 Make mapping between outputs and cached screen geometries in Workspace robust
Integer screen ids are not robust. On the other hand, AbstractOutput
does not change if an output has been connected or disconnected.
2021-10-30 14:02:32 +00:00
Vlad Zahorodnii
bb687ff6f1 Stop abusing AbstractClient::geometryRestore()
Currently, AbstractClient::geometryRestore() is abused to put windows
back on their original screen. It makes window placement more complex
and it breaks restoring initially maximized windows.
2021-10-30 14:02:32 +00:00
l10n daemon script
d4b030b920 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-10-30 01:19:35 +00:00
ivan tkachenko
4a07bab27d
Don't put a trailing dot in set_package_properties
It looks weird given the kind of visualization where this text is
displayed.

Bad:

 * XKB (required version >= 0.5.0), XKB API common to servers and clients., <http://xkbcommon.org>

Good:

 * XKB (required version >= 0.5.0), XKB API common to servers and clients, <http://xkbcommon.org>
2021-10-30 01:51:40 +03:00
Vlad Zahorodnii
09952e1dc7 wayland: Fix wayland windows growing after toggling decorations
After the decoration is destroyed, we need to resize XdgToplevelClient
to ensure that the scheduled configure event will have correct size.

As is, xdg-toplevel configure events are delayed. When it's actually the
time to send a configure event, XdgToplevelClient will compute the
requested client size from the moveResizeGeometry().

If the moveResizeGeometry() still includes window decorations, the
window will get bigger.

BUG: 444119
2021-10-29 14:40:17 +00:00
Vlad Zahorodnii
637d914f9f Use QScopedPointer to store decoration object
This simplifies memory management.
2021-10-29 14:40:17 +00:00
Vlad Zahorodnii
1e634be2f5 effects/slidingpopups: Schedule workspace repaints
For optimization purposes, kwin will ignore repaint regions scheduled by
invisible windows, e.g. hidden docks, minimized windows, etc.

The problem is that it sort of breaks w->addRepaintFull(). If a lot of
animation frames are dropped, for example due to heavy cpu load, the
sliding popups animation can jump from the middle of animation right up
to the end. It will schedule a repaint but it will be ignored.

In order to work around that issue, this change makes the sliding popups
effect schedule workspace repaints in postPaintScreen() to ensure that
the Scene will always repaint dirty regions.

Hopefully, this should fix bugs where auto-hide panels sometimes flicker
on Wayland.

BUG: 444502
2021-10-29 12:08:51 +00:00
Vlad Zahorodnii
b135a1c7b0 effects/screenshot: Add org.kde.KWin.ScreenShot2.CaptureActiveWindow
BUG: 386271
2021-10-29 12:06:43 +00:00
Vlad Zahorodnii
5379b010b4 effects/screenshot: Add API version property to org.kde.ScreenShot2 interface 2021-10-29 12:06:43 +00:00
l10n daemon script
24ad81e91b 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-10-29 01:21:24 +00:00
Kristen McWilliam
f5e598039b dbusinterface: add whitespace to declarations with doc comments
Without spacing it is not immediately evident where a doc comment
ends and a new declaration begins. Adding a line of whitespace
makes everything more readable and easier to scan quickly.
2021-10-28 11:12:54 -04:00
Vlad Zahorodnii
c09a03a927 Drop Platform::touchPointCount()
It can be accessed directly in the touch input device handler.
2021-10-28 10:55:48 +00:00
Vlad Zahorodnii
e83da51844 Simplify input event flow
Currently, input events can flow directly to input device handlers and
sometimes they go through the InputRedirection, which simply forwards
them to the corresponding input device handler.
2021-10-28 10:55:48 +00:00
Vlad Zahorodnii
bbe879988d Remove redundant Workspace checks in ForwardInputFilter
They don't use Workspace, so the workspace check can be removed.
2021-10-28 11:52:08 +03:00
Kristen McWilliam
9660f83e30 dbusinterface: add doc comment for getWindowInfo()
This method was lacking a doc comment, this adds basic context.
2021-10-28 05:56:36 +00:00
Vlad Zahorodnii
da6fbec424 Notify IdleInterface about user activity explicitly
In some cases, kwin may not forward input events to SeatInterface, which
can false trigger idle detection in IdleInterface.
2021-10-28 05:55:59 +00:00
Xaver Hugl
1626d7a51a platforms/drm: only use glDrawBuffer with desktop GL
That function is not available with GLES, and calling it is only necessary
for NVidia.
2021-10-27 11:49:00 +02:00
Kristen McWilliam
a7b833f319 Add class comment for Toplevel
A simple class comment to give the reader an idea what this is for.
2021-10-27 06:05:54 +00:00
Vlad Zahorodnii
9adb5eed02 Use a generic mechanism to watch input device properties
This reduces code duplication and provides a generic way to monitor all
relevant input device properties.
2021-10-27 05:59:49 +00:00
l10n daemon script
f15e6806f3 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-10-27 01:22:49 +00:00
Andrey Butirsky
be35ef6a9a [keyboard kcm] fix lost Locks state on keymap reconfigure
Fixes Num/Caps Locks (do we need Scroll also?)

BUG: 443739
2021-10-26 15:48:43 +00:00
Xaver Hugl
206689874f effects/overview: center drag hotspot 2021-10-26 14:33:35 +02:00
Vlad Zahorodnii
22eb154fa0 platforms/wayland: Allow resizing outputs 2021-10-26 13:31:36 +03:00
David Redondo
60c3b3ddfa Add support for hold gestures 2021-10-26 08:16:52 +00:00
Aleix Pol
1330376220 screencast: Support the creation of virtual displays to cast
In case the user has just the one display but they don't want to show it
in their main workspace when sharing video, allow creating a virtual
display.
This also will allow using remote devices as support displays.
2021-10-25 19:43:41 +02:00
Andrey Butirsky
4395caa256 [wayland] fix ignored keyboard RepeatRate
X11 can take float RepeatRate, Wayland - int only so the setting is to be
rounded.
Should be indistinguishable on usual rates.

BUG: 443721
2021-10-25 14:04:33 +00:00
Vlad Zahorodnii
fda7e150df kwineffects: Fix destruction of s_fbo with shared GLTexture objects
The WindowThumbnail item uses the GLTexture class. In order to destroy
the thumbnail texture, the item will schedule a destroy job.

This means that the GLTexture can be alive during or after graphics
reset.

On the other hand, as an implementation detail, GLTexture::clear() may
allocate a framebuffer object, which is going to be destroyed together
with the last texture.

Given that window thumbnail textures can be still alive after a graphics
reset and the fact that GLTexturePrivate::s_fbo gets destroyed when the
last texture is destroyed, kwin can end up trying to clear a decoration
texture with now defunct s_fbo.

Since the old old s_fbo is inert, the glBindFramebuffer() function will
fail and the glClear() operation will affect the default framebuffer,
thus leading to black flickering visual artifacts.

In order to fix that issue, this change makes GLTexture destroy s_fbo
unconditionally in GLTexturePrivate::cleanup() which is called whenever
OpenGL stuff is about to tear down, e.g. due to graphics reset, etc.

BUG: 443951
2021-10-25 13:00:55 +03:00
Vlad Zahorodnii
bd3d275293 wayland: Port away from deprecated legacy virtual desktop api in plasma window management 2021-10-25 06:35:35 +00:00
Nate Graham
4605fdcaa5 effects/overview: Give the "Delete desktop" button a tooltip
Icons-only buttons always need tooltips, even when they use a completely
recognizable icon.
2021-10-24 12:20:09 -06:00
Nate Graham
6d7d8ea699 effects/overview: only show "Delete desktop" button with >1 desktop
It doesn't make sense to let the user try to delete their only desktop.
2021-10-24 12:20:09 -06:00
Xaver Hugl
ca58ee875f WaylandOutput: schedule update on mode change
Without this there can be a mismatch between what clients expect and what
KWin actually uses, causing for example stutter in video players.

BUG: 444303
FIXED-IN: 5.23.2
2021-10-24 14:01:52 +02:00
l10n daemon script
839293f987 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-10-24 01:16:44 +00:00
Vlad Zahorodnii
99b38096ca platforms/drm: Fix a typo in DrmCrtc::setLegacyCursor()
bufferDirty should be reset so the legacy cursor is set after switching
between VTs or turning outputs back on.
2021-10-23 16:56:20 +00:00
l10n daemon script
0c6bf857be 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-10-23 01:16:55 +00:00
Xaver Hugl
49afd18018 platforms/drm: fix direct scanout check 2021-10-22 15:49:30 +02:00
David Edmundson
566bfbff5b Fix focus loss on decoration destruction
InputDeviceHandler keeps track of which client has focus, and whether
the decoration or main window has focus.

Should the decoration get destroyed whilst the decoration has focus we
don't update correctly. This can happen when
"BorderlessMaximizedWindows" is set, or if you use key presses whilst
above the decoration.

cleanupDecoration (which is an odd name) is called whenever a decoration
gains or loses focus. Here we can connect for the decoration destruction
and force a focus change.

BUG: 411884
2021-10-22 09:47:28 +00:00
Andrey Butirsky
e4e920d895 [testBorderlessMaximizedWindow] add touch to the test
BUG: 411884
2021-10-22 09:47:28 +00:00
Andrey Butirsky
83ece2e2a8 unit test for focusing loss problem on maximize
BUG: 411884
2021-10-22 09:47:28 +00:00
Vlad Zahorodnii
252ba9e005 autotests: Use less Screens::size(int)
The same info can be retrieved from AbstractOutput::geometry().size().
2021-10-22 09:15:48 +00:00
Vlad Zahorodnii
15520888d9 kwineffects: Drop numScreens property
The screen count can be retrieved by checking the number of items in the
EffectHandler.screens property.

The replacement for the numberScreensChanged signal are the screenAdded
and the screenRemoved signals.

The main motivation behind this change is to clean up the screens api
and reduce the number of usages of the Screens class.
2021-10-22 09:14:52 +00:00
Xaver Hugl
0c7d97853e input: fix crash on touch quicktile
If the filter filters out touchDown it also has to always filter out the
matching touchUp
2021-10-22 09:08:27 +00:00
Vlad Zahorodnii
1a10718f6c Remove unused stuff in Screens 2021-10-22 08:29:57 +00:00
l10n daemon script
a04a134a7a 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-10-22 01:20:47 +00:00