Commit graph

19947 commits

Author SHA1 Message Date
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
Vlad Zahorodnii
02a9457bbc Port Workspace::clientUnderMouse() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
e0c941109c Allow setting current AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
507c5140b7 Port Workspace::topClientOnDesktop() to AbstractOutput 2021-08-29 21:55:07 +00:00
Vlad Zahorodnii
95e5f5fc1a Introduce Toplevel::output()
This is a little helper that can be very convenient with our transition
from int-based screen ids to AbstractOutput.

As is, the main issue with int screen ids is that they are extremely
dynamic.
2021-08-29 21:55:07 +00:00
Ismael Asensio
77325dbb79 kcm/rules: Port KCM loading to KPluginMetadata
Passing just the plugin name to the KCM loader has been
deprecated in 5.85. This just affects the standalone loading of
the KCM via the window menu.
2021-08-29 13:13:33 +02:00
l10n daemon script
216233c2ec 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-29 01:20:37 +00:00
Xaver Hugl
0054d825c4 platforms/drm: directly check for required properties
Instead of crashing because a nullptr property gets accessed, use
an explicit error message and ignore the offending object. This also
acts as documentation
2021-08-27 20:25:18 +00:00
Vlad Zahorodnii
5a1b98d148 Allow passing Toplevel to Workspace::clientArea()
This allows us to re-use the same code path for alive and deleted
windows.
2021-08-27 19:33:47 +00:00
Vlad Zahorodnii
d228829abb Introduce Platform::outputAt()
With AbstractOutput being used more heavily, it makes sense to have
something like Screens::number() in the Platform class. As is, the steps
to get an output for a given point are awkward - first, get the screen
id, then use the screen id to get the output.
2021-08-27 21:51:05 +03:00
Vlad Zahorodnii
1dc749333e Remove desktop argument in AbstractClient::electricBorderMaximizeGeometry()
With the new virtual desktop model, we have an issue where the old
code that uses desktop() needs to be ported to desktops().

However, using no desktop() is better as we don't need to deal with
cases where a window can be on several desktops, which can be annoying
sometimes.

This change removes the desktop arg in electricBorderMaximizeGeometry()
and ports it to a Workspace::clientArea() overload that requires no
desktop.

Under the hood, Workspace::clientArea() still uses desktop(), but it
could also use a different strategy to compute the client area if the
window is on several virtual desktops, e.g. intersect client area on
every virtual desktop.
2021-08-27 15:12:59 +00:00
Vlad Zahorodnii
e5f6039a68 Remove desktop() usage in Workspace::activateClient()
Explicitly make the last virtual desktop current. This improves code
readability and gets rid of a desktop() usage.
2021-08-27 15:12:25 +00:00
Xaver Hugl
d6de38c1d6 platforms/drm: use drm formats instead of gbm formats
There's no need to guard the code, gbm and drm format definitions
are the same. Using GBM_BO_FORMAT_* even caused bugs, as that is
an enum and not a proper format identifier.

BUG: 441253
2021-08-27 11:56:36 +00:00
Xaver Hugl
092660613a platforms/drm: fix legacy mode
CCBUG: 441253
2021-08-27 11:50:02 +00:00
Vlad Zahorodnii
fff32f64e6 effects: Drop EffectsHandler::screenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
ff87b33a8a Port away from EffectsHandler::screenGeometryChanged() to EffectsHandler::virtualScreenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.

This change ports parts of kwin from the screenGeometryChanged() signal
to the virtualScreenGeometryChanged() signal with the main motivation to
drop the former.

The virtualScreenGeometryChanged() signal was chosen as the replacement
for the consistency sake with EffectsHandler's virtualScreenGeometry and
virtualScreenSize properties.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
894ed68ff4 effects: Wire EffectsHandler::screenGeometryChanged() to Screens::geometryChanged()
Currently, the EffectsHandler has two signals that are emitted when the
combined geometry of all outputs change - virtualScreenGeometryChanged()
and screenGeometryChanged(). Having two signals is most likely a
historical artifact.

This change untangles the screenGeometryChanged() signal from the
Workspace and makes it the same as the virtualScreenGeometryChanged()
signal.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
6c62f12bc1 effects/overview: Specify effect chain position
The present windows effect specifies a chain position of 70. Do the
same in the overview effect.
2021-08-27 12:02:35 +03:00