Commit graph

8 commits

Author SHA1 Message Date
Vlad Zahorodnii
4bfb0acc17 Make Workspace track managed outputs
This change adjusts the window management abstractions in kwin for the
drm backend providing more than just "desktop" outputs.

Besides that, it has other potential benefits - for example, the
Workspace could start managing allocation of the placeholder output by
itself, thus leading to some simplifications in the drm backend. Another
is that it lets us move wayland code from the drm backend.
2022-07-21 08:43:50 +00:00
David Edmundson
7292af3d04 Use floating geometry throughout
With fractional scaling integer based logical geometry may not match
device pixels. Once we have a floating point base we can fix that. This
also is
important for our X11 scale override, with a scale of 2 we could
get logical sizes with halves.

We already have all input being floating point, this doubles down on it
for all remaining geometry.

- Outputs remain integer to ensure that any screen on the right remains
aligned.
 - Placement also remains integer based for now.
- Repainting is untouched as we always expand outwards
 			   (QRectF::toAdjustedRect().
 - Decoration is untouched for now
 - Rules are integer in the config, but floating in the adjusting/API
This should also be fine.

At some point we'll add a method to snap to the device pixel
grid. Effectively `round(value * dpr)  / dpr` though right now things
mostly work.

This also gets rid of a lot of hacks for QRect right and bottom which
are very
confusing.

Parts to watch out in the port are:
 QRectF::contains now includes edges
QRectF::right and bottom are now sane so previous hacks have to be
removed
 QRectF(QPoint, QPoint) behaves differently for the same reason
 QRectF::center too

In test results some adjusted values which are the result of
QRect.center because using QRectF's center should behave the same to the
user.
2022-07-14 10:04:46 +01:00
Weng Xuetian
a521525c4d Delegate updateShadow to event loop.
If PlasmaCore.Dialog resizes while visible, the kwin shadow property
used by InternalWindow may update the shadow during rendering and cause
crash related to current context.
2022-06-23 17:18:08 +00:00
Xaver Hugl
4874066423 port many Qt shared pointers to standard smart pointers
There are a few benefits to using smart pointers from the standard library:
- std::unique_ptr has move semantics. With move semantics, transfer of ownership
can be properly expressed
- std::shared_ptr is more efficient than QSharedPointer
- more developers are used to them, making contributions for newcomers easier

We're also already using a mix of both; because Qt shared pointers provide
no benefits, porting to standard smart pointers improves consistency in
the code base. Because of that, this commit ports most of the uses of QSharedPointer
to std::shared_ptr, and some uses of QScopedPointer to std::unique_ptr
2022-06-04 16:57:29 +00:00
Vlad Zahorodnii
a7d61f7bfa Fully replace SceneWindow with WindowItem
This completes the initial transition to scene items.
2022-05-10 15:45:48 +00:00
Vlad Zahorodnii
2fdb55b199 Rename InternalWindow::internalWindow() to InternalWindow::handle()
internalWindow->handle() reads better than internalWindow->internalWindow()
2022-04-29 17:47:41 +03:00
Vlad Zahorodnii
175037d9d1 Prefer the term "window" over "client" in Workspace 2022-04-25 11:33:55 +00:00
Vlad Zahorodnii
fb4607f5a6 Rename InternalClient to InternalWindow
The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
2022-04-23 07:55:51 +00:00
Renamed from src/internal_client.cpp (Browse further)