Commit graph

24291 commits

Author SHA1 Message Date
Aleix Pol
d34cf36bfa inputmethod: Show the input method even if it was dismissed
Reset the current context in case we receive a show() event from the
client, meaning that they really want to see that virtual keyboard.

BUG: 466969
2023-03-09 14:18:57 +00:00
Vlad Zahorodnii
472b88d02a backends/wayland: Port away from ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT
There are proper abstractions to ask the scene level to render with y
axis inverted so let's use it instead.
2023-03-09 13:22:53 +00:00
Xaver Hugl
ba85512f21 effects: remove rendertarget scale from WindowPaintData
If an effect needs to override the rendertarget scale, it should use RenderViewport
to do that
2023-03-09 13:22:53 +00:00
Xaver Hugl
125c141b7d effects: remove ScreenPaintData
The only purpose ScreenPaintData had was to pass around a copy of the viewport
projection matrix and the effectscreen, which can be handled in a simpler
way separately.
2023-03-09 13:22:53 +00:00
Xaver Hugl
e4938297e6 scene: fix texture inversion with the drm backend
Specify the render target to buffer transformation and take that into
account in effects and when calculating the projection matrix.
2023-03-09 13:22:53 +00:00
Xaver Hugl
2417a0381f backends/drm: port from gbm_surface to a custom swapchain using gbm buffers 2023-03-09 13:22:53 +00:00
Xaver Hugl
9eb8c3fcfb effects/blur: use a texture per screen on Wayland
This simplifies the effect and reduces its VRAM usage with multi monitor
setups
2023-03-09 13:22:53 +00:00
Xaver Hugl
5eb7ad37e5 effects/blur: manage render targets with std::unique_ptr 2023-03-09 13:22:53 +00:00
Xaver Hugl
d737ed6687 effects: introduce RenderTarget and RenderViewport
Instead of calling effects->renderTargetRect() and effects->renderTargetScale(),
pass the actually used render target and viewport in all the necessary methods.
This ensures that if an effect renders a screen with a modified scale or
projection matrix, the modified values get used instead of the "global" ones
2023-03-09 13:22:53 +00:00
Vlad Zahorodnii
c1eca80190 wayland: Remove implicit slide constraint adjustment
Panel sets constraint adjustments so let's remove the implicit slide
constraint adjustment to adhere more closely to the spec.
2023-03-09 13:05:42 +00:00
Vlad Zahorodnii
e38807b282 effects: Use scripting QML engine
Qt would need to allocate fewer "tainted" data objects, and using the
same engine both in effects and in kwin is vital for features such as
QML based effects.
2023-03-09 08:10:42 +00:00
l10n daemon script
2dcea8c19b GIT_SILENT Sync po/docbooks with svn 2023-03-09 02:37:20 +00:00
Natalie Clarius
4f617e90b8 placement: add autotests for cascade if covering 2023-03-08 19:04:57 +00:00
Natalie Clarius
39cea49a8f placement: don't cascade for the sake of windows that are already covered
When checking for overlap with other windows when placing a new window and cascading to avoid complete overlap, ignore those windows that are already covered by other windows further on the top anyway.

The computation of the covered area is not entirely accurate as it uses the bounding rect rather than the combined rects of the windows, but okay enough for our use case imo.

BUG: 466135
2023-03-08 19:04:57 +00:00
Nate Graham
a2bf59005e virtualdesktops: use Meta key for axis shortcuts
These shortcuts currently don't use the Meta key, which allows them to
block app shortcuts (for example, in the Reaper DAW app). In general
it's a good idea for global shortcuts to use the Meta key to avoid
these kinds of conflicts since apps typically don't use the Meta key
for their own shortcuts. Other axis shortcuts set by KWin components
already do this, so let's do the same thing here.

BUG: 466915
FIXED-IN: 6.0
2023-03-08 17:43:21 +00:00
Vlad Zahorodnii
02fd869106 xwayland: Prevent potential file descriptor leak 2023-03-08 17:21:45 +00:00
Vlad Zahorodnii
1e0d5bba71 wayland: Prevent leaking --wayland-fd and --xwayland-fd to child processes
fcntl() expects FD_CLOEXEC instead of conventional O_CLOEXEC.
2023-03-08 16:55:49 +00:00
Vlad Zahorodnii
0e3bf29e3b helper: Don't leak lock file to kwin_wayland
The wrapper owns the socket, so kwin_wayland doesn't need to care about
the lock file.
2023-03-08 17:55:00 +02:00
Vlad Zahorodnii
1260e63305 backends/wayland: Don't leak renderD128 fd 2023-03-08 17:21:17 +02:00
Vlad Zahorodnii
318d126664 backends/wayland: Don't leak WaylandEventThread's pipe fds 2023-03-08 17:21:10 +02:00
Weng Xuetian
06ed58cb31 Fix text-input-v1 compatibility with 111.0.5563.64-1
While the documentation is not clear, it seems that preedit_cursor is
always required for every preedit_string event. Send preedit_cursor for
the preedit_string event we generate upon commit_string.
2023-03-08 12:30:00 +00:00
Vlad Zahorodnii
bc79d76ef6 effects/wobblywindows: Don't mess with clip region
Scene used to use the clip region as is even if the window is
transformed. That's no longer the case, so stop mutating the clip region
in favor of a more declarative approach to handling window painting.
2023-03-08 09:20:04 +00:00
l10n daemon script
73c58d6fb9 GIT_SILENT Sync po/docbooks with svn 2023-03-08 02:47:33 +00:00
Xaver Hugl
f2417a8523 backends/drm: support CTM for simple color transformations
In order to work around hardware and drivers that aren't capable of applying
a LUT, calculate a per-channel factor for brightness and color temperature
modification. While this ignores color calibration, this makes night color
work until a proper shader based color pipeline is implemented.

BUG: 455720
2023-03-07 17:03:40 +01:00
Vlad Zahorodnii
f4a35ed619 libkwineffects: Remove window tabbing leftovers 2023-03-07 14:46:45 +00:00
Vlad Zahorodnii
c0ff9526f9 Remove leftover from old times in PopupInputFilter
The windowShown connection is leftover from the times when kwin used to
not destroy the window object if the associated wl_surface has been
unmapped.
2023-03-07 14:15:18 +00:00
Vlad Zahorodnii
9ed1f28d0f scripting: Drop registerShortcut() function in QML API
Use ShortcutHandler type instead.
2023-03-07 13:57:38 +00:00
Vlad Zahorodnii
c121253d10 scripting: Introduce ShortcutHandler
The ShortcutHandler type provides scripts QML idiomatic way to register
global shortcuts.

There's one caveat about this API though. Since KGlobalAccel does not
allow to change the shortcut by repeating KGlobalAccel::setShortcut(),
the ShortcutHandler requires the default shortcut to be set before it's
constructed.
2023-03-07 13:57:38 +00:00
Vlad Zahorodnii
c191902026 wayland: Setup compositing when window is mapped ready for painting
This prevents creating a WindowItem until we know that the window is
actually going to be visible on the screen.
2023-03-07 13:44:03 +00:00
Vlad Zahorodnii
5cd99b27fd Apply 1 suggestion(s) to 1 file(s) 2023-03-07 13:23:52 +00:00
Xaver Hugl
ca78157a2d Apply 2 suggestion(s) to 1 file(s) 2023-03-07 13:23:52 +00:00
Vlad Zahorodnii
42e05def40 effects/screenshot: Port to QPromise
QFutureInterface is technically internal Qt API and the screenshot uses
it solely because we knew that there won't be any future Qt 5 releases
and it won't be removed in 5.15 patch releases.

In Qt 6, we have proper public API. Unlike QFutureInterface, QPromise is
not copyable, therefore this change also ports some parts of the screenshot
effect from QVector, which uses copy-on-write, to std::vector.
2023-03-07 13:23:52 +00:00
Vlad Zahorodnii
51a8e486b4 Remove X11 specific properties
Scripts should not rely on X11 or Wayland specific properties, but
rather use common abstractions. So remove X11 window specific properties.
2023-03-07 13:06:06 +00:00
Vlad Zahorodnii
34f46be823 Remove window arg in Window::activitiesChanged signal
This change removes the window argument to make window signals more
consistent. If you need the window, either use QObject::sender() or
capture it using a lambda.
2023-03-07 12:38:43 +00:00
Vlad Zahorodnii
0c0605abb9 Merge Window::minimize and Window::unminimize
Code of Window::minimize() and Window::unminimize() is mostly the same
with the exception of some state checks, so merge the two to tidy the
code.
2023-03-07 12:20:07 +00:00
Aleix Pol
4bc8cd6c54 input: Make sure input backends are initialised when the workspace is set up
The outputs already present upon workspace setup wouldn't signal. This
was easily triggered running a standalone kwin session on a tty, it
would manifest with the touchscreen not working complaining that it
didn't have an output assigned yet.

BUG: 466721
2023-03-07 12:53:05 +01:00
Vlad Zahorodnii
9a4ca5ec2b Drop MoveMinimizedWindowsToEndOfTabBoxFocusChain
Use OrderMinimizedMode option in [TabBox] instead.
2023-03-07 10:02:32 +00:00
Vlad Zahorodnii
9720a6ee84 Remove window argument in Window's maximize signals
Either use QObject::sender() or capture the window using a lambda.
2023-03-07 10:31:25 +02:00
l10n daemon script
cd458d2f1e GIT_SILENT Sync po/docbooks with svn 2023-03-07 02:50:18 +00:00
Vlad Zahorodnii
abaf55b2c4 Remove window arg in Window::{buffer,client,frame}GeometryChanged signals
Remove the window argument to improve the consistency of the signals.
2023-03-06 17:30:27 +00:00
Ismael Asensio
7b187da12a Tabbox: Fix grouping windows by application
When grouping windows by app, the TabBox code uses the on-progress
client list as it is getting constructed to decided whether to add
a new window or not.

So instead of a local variable to construct the client list, let's
use a member one and expose it on the `clientList()` getter.

Amends commit: e89c09a62e
2023-03-06 14:36:43 +00:00
Vlad Zahorodnii
466799819f effects/screenshot: Remove unused KF6::Notifications dependency 2023-03-06 16:30:42 +02:00
Vlad Zahorodnii
869c29c33d effects/screenshot: Drop legacy dbus interface 2023-03-06 13:09:23 +00:00
Vlad Zahorodnii
ae72f61a4a scene: Use correct scale when computing world transform
If render target scale is set in WindowPaintData, use it. Otherwise
window screenshots with logical geometry can look wrong.
2023-03-06 10:36:45 +00:00
Vlad Zahorodnii
fd9504f649 wayland: Fix interactive resize of debug console
The internal window doesn't gravitate the geometry during interactive
resize so it can produce unexpected results when dragging the top-left
window corner.
2023-03-06 10:10:33 +00:00
Vlad Zahorodnii
fdbfd2fd5a effects/screenshot: Introduce CaptureWorkspace
Most screenshot tools provide some way to capture the entire workspace.
Currently, the way to achieve that is to compute the workspace geometry
yourself and use CaptureArea. It's inconvenient and it's also racy.

This change introduces CaptureWorkspace to provide screenshot tools
slightly nicer API to capture the entire workspace.
2023-03-06 09:05:23 +00:00
Vlad Zahorodnii
db55a6f909 wayland: Initialize Window::depth to 32
Window::depth and Window::hasAlpha make no sense on Wayland. The main
reason why we can't rid of them completely yet are X11Window and
Unmanaged.

This change makes WaylandWindow initialize depth to 32 by default to
make wayland window subclasses less boilerplaty.
2023-03-06 07:21:04 +00:00
Vlad Zahorodnii
3b12058135 Move X11 specific logic from DecorationRenderer to X11DecorationRenderer 2023-03-06 07:21:04 +00:00
l10n daemon script
f9b9ca8d1f GIT_SILENT Sync po/docbooks with svn 2023-03-06 02:37:13 +00:00
Xaver Hugl
66b3387a5a kscreenintegration: read global output data
This is per output instead of per output setup
2023-03-05 15:08:08 +01:00