Commit graph

19914 commits

Author SHA1 Message Date
Janet Blackquill
6231699ac1 Lay some groundwork for realtime gestures in Wayland
This lays down some groundwork for realtime gestures in Wayland,
so that gestures that are 1:1 with user motion on a touchpad are
now possible to implement.

Due to earlier commits, this is mostly just glue code to make a
convenient API.

Gestures implemented with this API are four-finger gestures, to
avoid conflicting with apps that may use two or three-finger
gestures.
2021-09-01 19:48:41 -04:00
Tatsuyuki Ishi
81389a6e17 blur: pass projection matrix by const reference
Passing QMatrix4x4 by value can result in copying a non-trivial amount (16)
of floats, so avoid that.
2021-09-01 21:42:56 +00:00
Tatsuyuki Ishi
c193efc962 blur: add noise in perceptual space
The previous implementation added noise in linear space, which resulted in
the effect becoming more pronounced on black backgrounds. This patch
changes the process to be applied in perceptual space, by making the noise
addition pass a separate draw call and disabling GL_FRAMEBUFFER_SRGB during
that.

After this change, noise will look much more suppressed and almost never
grainy. This change also changes the range of the noise from
[-strength..strength) to [0..strength), as blending can only be either
additive or subtractive. As a result, users might need to ramp up their
noise parameter after this change.

v2: Add more explanation around the draw call.
v3: Fix noise not fading out with the fade out effect.
v4: Restore an accidentally removed comment.
v5: Add CCBUG.
v6: Rebase.
v7: Fix a formatting issue.

CCBUG: 409620
2021-09-01 21:42:56 +00:00
Méven Car
0a2c511489 Wayland: Add support for protocol kde-output-device_v2, allow to detect drm mode changes
CCBUG: 407058
2021-09-01 13:37:43 +00:00
Vlad Zahorodnii
03b64331f2 wayland: Remove special input method case in XdgToplevelClient
Input method surfaces have input_panel_surface role, so the special case
for input method windows can be dropped.
2021-09-01 10:26:16 +00:00
Vlad Zahorodnii
99e208e30f wayland: Always setup window management for xdg-shell clients
kscreenlocker uses the layer-shell protocol, so the special lock screen
case can be removed.
2021-09-01 10:26:16 +00:00
Vlad Zahorodnii
1717de8a59 Port XdgToplevelClient::updateShowOnScreenEdge() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
cdd3f96fe1 Port X11Client::fullscreenMonitorsArea() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
26e470b7ff Port screenContainsPos() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
25a6515e05 Port AbstractClient::checkQuickTilingMaximizationZones() to AbstractOutput 2021-09-01 10:10:24 +00:00
Vlad Zahorodnii
8b85fdcedf wayland: Setup window management integration on initial commit
Originally, there was ShellClient class that was the predecessor to
WaylandClient subclasses. If the main surface is unmapped, the
corresponding instance of ShellClient would be kept around. That had
been changed with the introduction of XdgToplevelClient and
XdgPopupClient.

Since ShellClient had been kept alive even if the corresponding surface
were unmapped, it did make sense to setup window management integration
when the surface is mapped.

However, this also means that plasma will not know about initially
minimized windows.

Since unmapped windows are handled differently now, we can setup window
management after the client performs the initial commit. If the main
surface is unmapped, the XdgToplevelClient object will be destroyed and
with it, the window management integration.
2021-08-31 23:42:07 +00:00
Carson Black
63b16cdf9d Increased edge margins 2021-09-01 01:33:51 +02:00
Jan Blackquill
f6005a28cd doc: modernise HACKING -> CONTRIBUTING guidelines and information 2021-08-31 22:10:58 +00:00
Aleix Pol
0b74aa62c9 Support PlasmaWindowInterface::sendToOutput 2021-08-31 21:25:18 +00:00
Xaver Hugl
a3cbaf48dc platforms/drm: fix modifier env variable
Like the name suggests, modifiers were meant to be enabled by default
2021-08-31 16:30:03 +00:00
Vlad Zahorodnii
d70cfadf96 platforms/drm: Fix outputDisabled signal
The outputDisabled() signal must be emitted **after** removing the
output from a list of enabled outputs.
2021-08-31 16:02:19 +00:00
Vlad Zahorodnii
b0c26cc424 effects/overview: Layout window thumbnails in updatePolish()
Currently, ExpoLayout delays layout updates by using a singleshot timer
(primarily due to the author of the effect not being aware of
QQuickItem::polish() and QQuickItem::updatePolish()).

This change makes ExpoLayout schedule layout updates using QtQuick's
native item polish machinery, which gets triggered before rendering and
thus we can batch more geometry updates.

In addition to that, this change simplifies the initialization code in
ScreenView by making the fact that ExpoLayout is arranged right before
rendering internal to the WindowHeap type.
2021-08-31 12:51:29 +00:00
Vlad Zahorodnii
683bf20168 Port ScreenEdges away from Screens 2021-08-31 11:17:46 +03:00
Vlad Zahorodnii
543145e76f autotests: Port common screen check preamble to AbstractOutput 2021-08-31 08:16:27 +00:00
Vlad Zahorodnii
cbaf39e270 Port the remaining usages of Screens::geometry(i) in Workspace to AbstractOutput 2021-08-31 09:45:20 +03:00
Vlad Zahorodnii
9bf6e2bd68 Port Workspace::supportInformation() to AbstractOutput 2021-08-31 09:41:22 +03:00
Vlad Zahorodnii
1b2e8437ac Use precomputed workspace geometry in Workspace::initializeX11()
When initializeX11() is called, the workspace geometry is known, so it
doesn't need to be computed again.
2021-08-31 09:35:27 +03:00
Vlad Zahorodnii
e198727e15 Drop Toplevel::isOnScreen()
It's unused. Its replacement is Toplevel::isOnOutput().
2021-08-31 05:45:55 +00:00
Xaver Hugl
93ec5d8ea9 tests: fix GestureTest 2021-08-31 01:45:27 +00:00
Xaver Hugl
5b87c24568 tests: fix TestBuiltInEffectLoader 2021-08-31 01:45:27 +00:00
Xaver Hugl
36f01ba7fe tests: fix TestVirtualDesktops 2021-08-31 01:45:27 +00:00
l10n daemon script
96c6f964e6 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-31 01:29:11 +00:00
Xaver Hugl
85a6dc3cad platforms/drm: correct multi-gpu mistake
As all outputs from secondary GPUs are in the same map as the ones from
the primary GPU, EglMultiBackend::findBackend always returned the
primary backend. To fix that, search in secondary backends first
2021-08-30 23:00:19 +02:00
Vlad Zahorodnii
89d49b4d5d platforms/virtual: Add new outputs before removing old outputs
This is to prevent hitting the case where there are no any outputs.
Ideally, it shouldn't matter in which order outputs are added or
removed, but the Workspace and AbstractClient subclasses don't work
with true headless mode. If there are no outputs, kwin can crash.
2021-08-30 15:08:52 +00:00
Vlad Zahorodnii
f8ad513648 Unvirtualize property getters in Screens
MockScreens is gone so property getters in Screens can be regular
methods now.
2021-08-30 14:46:00 +00:00
Vlad Zahorodnii
8fd1914f83 Port Edge to Platform::outputAt() 2021-08-30 14:46:00 +00:00
Vlad Zahorodnii
901e479482 autotests: Rewrite testScreenEdges as an integration test
Due to the screen edges test not being an integration test, it's very
hard to change output related code in libkwin. screens.cpp needs to have
a few ifdefs to successfully compile.

This change rewrites the screen edges test as an integration test in
order to allow us using other components of kwin in screens.cpp and
screenedge.cpp without ifdef guards.

It's not a one-to-one port.
2021-08-30 14:46:00 +00:00
Xaver Hugl
42b516b567 fix drag and drop raise with Xwayland windows
They shouldn't be raised immediately. The same strategy as with
Wayland native clients should be used.

BUG: 440534
2021-08-30 16:31:28 +02:00
Xaver Hugl
f4d63bb8ed platforms/drm: first emit outputDisabled, then remove output
The current behavior is in contradiction to the description of
Platform::outputDisabled
2021-08-30 16:24:25 +02:00
Xaver Hugl
dbf4a59527 platforms/drm: prevent having zero outputs at any time
Instead of updating all outputs first, create the placeholder output
before the last output gets removed.
2021-08-30 16:24:08 +02:00
Vlad Zahorodnii
2696030b00 Port AbstractClient::setQuickTileMode() to output() 2021-08-30 13:58:52 +00:00
Vlad Zahorodnii
8a93a33b96 x11: Make sure that outputs are stored in xinerama order
With the new output query algorithm, position of an output may not align
with its xinerama index. This can be problem on x11 as some protocols,
e.g. startup feedback, use xinerama indices to identify outputs.

Technically, the RandR specification doesn't say that CRTCs are stored
in the xinerama order, it only mentions that the first CRTC corresponds
to the primary output. However, such assumption was made by kwin prior
to output query changes, this change merely restores that behavior.
2021-08-30 13:28:53 +00:00
Vlad Zahorodnii
7016da39c8 Move active output tracking to workspace
Active output is a window management concept. It indicates what output
new windows have to be placed on if they have no output hint. So
Workspace seems to be a better place for it than the Screens class, which
is obsolete.
2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
16bc522bfc Rename Workspace::setCurrentOutput() to switchToOutput() 2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
b08807cc36 autotests: current abstract output 2021-08-30 13:28:23 +00:00
Vlad Zahorodnii
813804d5a0 x11: Port X11Output::setGammaRamp() to Application::x11Connection()
It's faster.
2021-08-30 12:16:24 +00:00
Vlad Zahorodnii
96830d2295 x11: Simplify X11Output::geometry()
There is a separate type for placeholder x11 outputs, so X11Output can
return its geometry without performing any checks.
2021-08-30 12:16:24 +00:00
Vlad Zahorodnii
9dfccfc95c Port some of kwin to Workspace::geometry() 2021-08-30 12:26:16 +03:00
Vlad Zahorodnii
71aeb5528a Cache workspace geometry in Workspace
This allows us to drop obsolete Screens class.

Currently, the Screens class is a thin wrapper around platform outputs +
some extra tracked state, e.g. active output, workspace geometry, etc.
2021-08-30 12:26:14 +03:00
Vlad Zahorodnii
d9686a0caa Avoid using Screens in Workspace::updateClientArea()
Use AbstractOutput for consistency sake.
2021-08-30 12:17:08 +03:00
Vlad Zahorodnii
acb5c04fae Drop Workspace::clientArea(clientAreaOption opt, const Toplevel *window, int screen)
It's unused.
2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
b80fbe6fb0 Merge WindowRules::checkScreen() and WindowRules::checkOutput() 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
a1f1039b58 Store AbstractOutput in Toplevel
Since AbstractOutput is used more than int screen ids in kwin, it's
worth storing AbstractOutput for better performance.
2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
6ca411a84a Port AbstractClient::sendToScreen() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
22649137d6 Port FocusChain to AbstractOutput 2021-08-29 21:55:07 +00:00