Commit graph

16 commits

Author SHA1 Message Date
Vlad Zahorodnii
903e18d88c Merge Window::maximize() and Window::changeMaximize() 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
40a4cd13a4 Make Window::changeMaximize() take MaximizeMode 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
b044a7d5ff Drop adjust argument in Window::changeMaximize() 2022-10-11 06:21:15 +00:00
David Edmundson
ad95b495ac Sync activities after kwin restart
Activities are loaded async. During this time any fetch of activity
information is incorrect as we will treat any settings as invalid.

We need to ignore attempts to set activities during this time, but also
refresh Window's concept of activities once we are loaded.

BUG: 438312
2022-09-30 07:10:50 +00:00
Xaver Hugl
3fff256b88 window: make resizeWithChecks not modify any window state 2022-08-31 11:32:30 +00:00
Vlad Zahorodnii
a9d51ab2f3 Refactor geometry handling in interactive move/resize handling func
Window::handleInteractiveMoveResize() calls setMoveResizeGeometry(),
which breaks in a way the encapsulation.

This change refactors geometry handling in handleInteractiveMoveResize()
so the next geometry is computed in a temporary variable and the move
resize geometry is updated either using move() or
doInteractiveResizeSync().
2022-08-31 10:05:21 +03:00
David Edmundson
2854d59da4 Avoid rounding on X11 configure events
As per the comment this is in kwin logical space not X11 space,
therefore results should be floating.
2022-08-09 06:59:13 +00:00
Xaver Hugl
8955a2420e replace all uses of QScopedPointer with std::unique_ptr 2022-08-04 12:30:09 +00:00
Vlad Zahorodnii
4790916fb1 x11: Fix shading with non-zero border
There was a geometry change that fixed mixing the next and current
geometries. While it did fix issues on wayland, it broke window shading
on x11 because of an obscure resize() call.

That obscure resize() had a side-effect that ensures m_clientGeometry
has the right value so the next time the window is unshaded,
implicitSize() will return a good value.

In order to make window size computation more robust, this change makes
X11Window compute the natural frame size based on cached size in
m_client, which shouldn't change when the window is shaded.

However, given how buggy window shading is and how difficult it is to
make it work right, I think that it's better to deprecate window shading
and remove it in some future release.

BUG: 450582
2022-07-18 11:39:06 +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
Emilio Cobos Álvarez
7e1617c280 [x11] Implement _GTK_SHOW_WINDOW_MENU.
BUG: 454756
2022-06-14 06:55:07 +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
Aleix Pol
d1522eb47f Move allowWindowActivation into X11Window
It helps to contextualise the method as it's using several x11-isms,
some of them possible ot abstract.
In any case, the method is only called with X11Window and it's the only
case where it makes sense doing so.
2022-05-05 10:40:27 +00:00
Vlad Zahorodnii
3cec7e63e9 Drop Window::setClientShown()
It's unused.
2022-04-29 19:09:51 +03:00
Vlad Zahorodnii
175037d9d1 Prefer the term "window" over "client" in Workspace 2022-04-25 11:33:55 +00:00
Vlad Zahorodnii
a21aa839b1 Rename X11Client to X11Window
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/x11client.h (Browse further)