Commit graph

19490 commits

Author SHA1 Message Date
Ömer Fadıl Usta
8fc3b024be Update dumb_swapchain.cpp 2021-06-05 04:59:02 +00:00
Vlad Zahorodnii
8c8098a61c Move X11Client::wantsShadowToBeRendered to AbstractClient
Otherwise only X11 windows will lose server-side drop-shadows when the
maximized mode changes.

BUG: 434213
2021-06-04 17:57:21 +03:00
Vlad Zahorodnii
5498b37938 scenes/opengl: Delegate viewport setup to backend
Only the backend knows what the right viewport rect is. Furthermore,
setting up the viewport before rendering is less error-prone.
2021-06-04 16:18:34 +03:00
Vlad Zahorodnii
d3f4da370b Prevent emitting Scene::frameRendered more than once per frame
Currently, the frameRendered() signal is emitted every time an effect
calls paintScreen(). This means that the frameRendered() signal can be
emitted more than once when effects such as slide are active. However,
we'd like if it's emitted only once before buffers are swapped.
2021-06-04 07:49:32 +00:00
Vlad Zahorodnii
8b3e999fbf scenes/opengl: Properly destroy backend if initialization fails
SceneOpenGL takes the ownership of the backend. So, if the scene fails
to initialize, the backend will be deleted twice.
2021-06-04 07:39:51 +00:00
Bhushan Shah
2b1d709b04 inputmethod: hook the key and modifiers functions 2021-06-04 00:14:34 +02:00
Aleix Pol
454425b43f inputmethod: Allow input methods to grab the keyboard
This allows different input methods to get information about what's
beign typed from the actual hardware. This is especially useful for
non-latin script languages.
2021-06-03 19:13:21 +02:00
Xaver Hugl
c5ea99cbe5 AbstractEglBackend: only clean up OpenGL context if primary 2021-06-03 14:44:14 +02:00
Aleix Pol
74724065ae inputmethod: Don't disable them by default if there's a connected keyboard
If the user has chosen to have a virtual keyboard (i.e. prefered maliit
over none in the KCM) they should get it. If it's too annoying it should
either be disabled or we can fix it so it gets less in the way.

This is especially important since some hardware registers itself as a
keyboard even if it's not a fully functional keyboard.
2021-06-03 10:51:01 +00:00
David Edmundson
4a16e18808 Remove Wayland::Client usage in wl->xwl drags 2021-06-03 09:04:26 +00:00
Ömer Fadıl Usta
6c97cd118d fix include 2021-06-02 17:41:10 +00:00
Xaver Hugl
b88b6f3bc3 platforms/drm: log when direct scanout starts and stops 2021-06-01 13:02:13 +02:00
Vlad Zahorodnii
de3b7a96db effects/blur: Ignore xshape region
EffectWindow::shape() doesn't fit the item based design. This change
ports the blur effect away from the shape() function to the rect()
function. The XShape extension was introduced when windows with an alpha
channel wasn't really a thing. Setting a shape served as a way to clip a
window, the most notable example is xeyes.

If an application relies on the xshape extension to actually clip the
window and not to force the window manager not to put the server-side
deco, it most likely doesn't support translucency and therefore it
shouldn't set the blur region to begin with.

This change makes the blur effect ignore the xshape region similar to
the background contrast effect. It allows us to decouple a bit more
effects from the rest of rendering machinery and thus make it easier for
us to move forward with the scene redesign goal.
2021-06-01 06:26:17 +00:00
l10n daemon script
c1aa1c6c09 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-06-01 01:16:32 +00:00
Aleix Pol
aba3335ea6 Fix weird decoration glitch when using a scaled display
We used to get a weird line around the window decoration because the
clamping would hit the outside of the rendered decoration.
To make sure we fall inside take the displayPixelRatio into account.
Also on non-integer scales, make sure we are actually falling inside.
2021-05-31 13:01:25 +00:00
Xaver Hugl
7bf79090cf platforms/drm: add outputs on EglGbmBackend initialisation
BUG: 437761
2021-05-31 13:15:16 +02:00
Vlad Zahorodnii
33bb146861 scenes/opengl: Remove unused render node leaf type 2021-05-31 09:35:52 +03:00
Vlad Zahorodnii
048c732a4e scenes/opengl: Remove half-pixel correction workaround
It was needed to work around visual glitches in the wobbly windows
effect. Since the wobbly windows effect renders the animated window into
an offscreen texture, we don't need this workaround anymore.

Furthermore, rather than using half-pixel correction, it is more
desirable to use an offscreen texture as it results in simpler design.
Performance-wise, it's not that bad that we need to start looking for
other ways to get rid of the seams between window contents and deco.
2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
8d378cd4cd effects/fallapart: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
61d3134aa5 effects/magiclamp: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
ab706e53dc effects/wobblywindows: Port to DeformEffect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
5255ebf8d0 kwineffects: Introduce DeformEffect
DeformEffect is the base class for effects that transform the window
quad grid, e.g. wobbly windows or magic lamp. The main difference
between normal effects and offscreen effects is that the latter renders
animated windows into offscreen textures which are later deformed.

The offscreen texture approach is superior to the half-pixel correction
approach as it produces more visually appealing results. Even with
half-pixel correction, you're still going to see jagged lines between
the main surface and the server-side decoration or drop-shadow.

It is also needed to reduce the number of usages of WindowPaintData::quads
which is needed to move forward with the scene redesign goal.
2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
d4ade78aac kwineffects: Add parent argument to Effect 2021-05-31 05:27:22 +00:00
Vlad Zahorodnii
b0042a30c1 x11: Pick better names for geometries before blocking
The new names express better what "geometries before update blocking" are.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
c3978f197b x11: Properly detect the case where client window moves inside frame window
If the window borders change in such a way that the buffer geometry
doesn't change, but the client geometry does change, we need to configure
the wrapper window and maybe the client window so there are no black
borders, etc.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
ce0edde906 x11: Remove irrelevant comments
The relevant code the comment talks about was removed long time ago.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
308cbcc47f x11: Add missing geometry checks in moveResizeInternal()
Currently, there is an assumption in the moveResizeInternal() method
that if the buffer geometry changes, then the client geometry will also
change. However, as it turns out, it's not completely true. For example,
if the window is maximized while its geometry already matches the
maximize area, the buffer geometry won't change, but the client geometry
will change.

This change adds missing geometry checks. *geometryBeforeBlocking
corresponds to the old geometry. We can use it to decide if the geometry
has changed.
2021-05-31 05:20:57 +00:00
Vlad Zahorodnii
eaca921e01 x11: Remove window rule geometry mismatch debug message
If the geometry window rule must be forced, the move resize method has
to force it, but similar to size constraints, we assume that the caller
of the move resize function will do the right thing. So, remove the
debug message to be consistent with other client types.
2021-05-31 05:20:57 +00:00
Nicolas Fella
f910b0de97 Use version-less qt DBus macros
They work with both Qt5 and Qt6
2021-05-31 01:00:35 +02:00
Vlad Zahorodnii
eb27d312a3 effects/desktopgrid: Clip windows differently
Similar to the slide effect, the desktop grid can use the clip region to
clip windows when needed. This will improve performance because the desktop
grid effect will do less work. Currently, it clips quads on its own in
prePaintWindow, copies them over in a temporary list, and lets the opengl
scene clip the window quads again.

We can clip windows differently by just passing a custom region to the
paintWindow() function down the effects chain, which the desktop grid
effect already does.

The old behavior and the old bugs are preserved. The Xrender code path is
unaffected.
2021-05-28 16:48:17 +00:00
Vlad Zahorodnii
2b88fab8c1 effects/screenshot: Add support for HiDPI window screenshots
In general, on Wayland, there is no such a thing as "window scale factor"
because sub-surfaces can have different buffer scales. However, we know
the scale factor of the output where the window is considered to be on. So
we can use the screen's scale factor as the window's scale factor. In
most cases, it will produce the correct result.
2021-05-28 17:36:56 +03:00
Vlad Zahorodnii
a8d702ba30 effects/screenshot: Port away from window quads
For the scene redesign, window quads need to be removed from the effects
api. This change ports the screenshot effect away from quads.

In order to exclude the server-side decoration from the window
screenshot, the effect will render the contents of the client geometry
into the offscreen texture. If the window is client-side decorated, the
entire window will be rendered as before.

The good thing about this approach is that the screenshot effect will do
less work, it won't loop over window quads to compute the bounding rect
or filter out the deco quads.
2021-05-28 14:03:42 +03:00
Vlad Zahorodnii
b814b3c985 kwineffects: Add client geometry property
This property can be useful for the screenshot effect.
2021-05-28 11:05:38 +03:00
Xaver Hugl
2742e5b422 Rearrange wayland startup sequence
The backend can now optionally wait for the scene to be created before
it updates its outputs, which is necessary for better atomic tests in
the DRM backend.
2021-05-27 13:41:40 +00:00
Vlad Zahorodnii
1d906169d8 Discard SurfaceItemXwayland's quads when shape changes
The SurfaceItemXwayland has to re-build quads if the shape changes.

The SurfaceItemX11 doesn't need a similar fix as it already discards
quads whenever the shape region changes.
2021-05-26 18:27:55 +00:00
Nate Graham
20b8d606e1 [kcmkwin/kwindesktop] Add explicit action to apply a rename
The rnew name is applied when the user hits the return or enter key to
finish renaming, but this is an invisible UI and the user might not
think to do that. This commit replaces the "Rename" button with a
"Confirm new name" button while the text field is editable, so that it's
visibly clear how to finish renaming.
2021-05-26 17:44:02 +00:00
Nate Graham
324480570b [kcmkwin/kwindesktop] Allow renaming desktops with double-click
Similar to the feature to allow inline renaming in file managers, you
can now trigger renaming for a desktop by double-clicking on its list
item.

BUG: 421882
FIXED-IN: 5.23
2021-05-26 17:43:30 +00:00
Aleix Pol
644dcbe173 screencasting: do not attempt to copy a null texture
It seldom happens, but it does happen.
2021-05-26 12:56:59 +00:00
Vlad Zahorodnii
870c1e5557 scenes/qpainter: Clean up includes
Wayland-specific code in the qpainter renderer was removed long time ago.
2021-05-26 09:36:20 +03:00
Vlad Zahorodnii
7cbd459caf Remove unused includes in DecoratedClient and DecorationBridge 2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
f46c7bae8d Move decoration renderer to decoration item
Currently, the implementation of the DecoratedClient and the decoration
renderer are strongly coupled. This poses a problem with the item based
design as the ultimate goal is to have scene items construct paint nodes
which are then fed to the renderer. The DecorationItem has to have
control over the decoration texture. Another issue is that the scene
cannot smoothly cross-fade between two window states if the decoration
is removed, e.g. from fullscreen mode to normal and vice versa.

This change moves the decoration renderer to the decoration item. With
the introduction of a generic scene texture atlas, we hope to get rid of
the decoration renderer altogether.
2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
7f32594692 Port decoration renderers to Decoration::damaged signal 2021-05-26 06:35:03 +00:00
Vlad Zahorodnii
fa66c3d238 Make Toplevel::isClient() return true for internal and wayland windows
It's needed to merge Toplevel and AbstractClient. Previously, we
couldn't do it because Toplevel::isClient() was somewhat widely used.
2021-05-25 19:06:17 +03:00
Vlad Zahorodnii
93d95ffbc4 Replace AbstractClient::doPerformInteractiveMoveResize() with a simpler solution
AbstractClient::doPerformInteractiveMoveResize() is only used by the
X11Client to reset a boolean flag when the client doesn't support sync
counters.

X11Client can call performInteractiveMoveResize() only in two cases: the
sync request timer expires or the client increments the sync counter.

This change removes the AbstractClient::doPerformInteractiveMoveResize()
function and adds a function to handle the case where the sync timer
expires explicitly. This removes a virtual function in the AbstractClient
and makes code more readable.
2021-05-25 09:32:55 +03:00
Vlad Zahorodnii
c929d977a7 Move geometry before blocking to X11Client
It's only used by X11Client. Neither InternalClient nor WaylandClient
need buffer/frame/client geometry before blocking.
2021-05-25 06:17:41 +00:00
Vlad Zahorodnii
9a7ab8a62e Rework async geometry updates
Window management features were written with synchronous geometry
updates in mind. Currently, this poses a big problem on Wayland because
geometry updates are done in asynchronous fashion there.

At the moment, geometry is updated in a so called pseudo-asynchronous
fashion, meaning that the frame geometry will be reset to the old value
once geometry updates are unblocked. The main drawback of this approach
is that it is too error prone, the data flow is hard to comprehend, etc.

It is worth noting that there is already a machinery to perform async
geometry which is used during interactive move/resize operations.

This change extends the move/resize geometry usage beyond interactive
move/resize to make asynchronous geometry updates less error prone and
easier to comprehend.

With the proposed solution, all geometry updates must be done on the
move/resize geometry first. After that, the new geometry is passed on to
the Client-specific implementation of moveResizeInternal().

To be more specific, the frameGeometry() returns the current frame
geometry, it is primarily useful only to the scene. If you want to move
or resize a window, you need to use moveResizeGeometry() because it
corresponds to the last requested frame geometry.

It is worth noting that the moveResizeGeometry() returns the desired
bounding geometry. The client may commit the xdg_toplevel surface with a
slightly smaller window geometry, for example to enforce a specific
aspect ratio. The client is not allowed to resize beyond the size as
indicated in moveResizeGeometry().

The data flow is very simple: moveResize() updates the move/resize
geometry and calls the client-specific implementation of the
moveResizeInternal() method. Based on whether a configure event is
needed, moveResizeInternal() will update the frameGeometry() either
immediately or after the client commits a new buffer.

Unfortunately, both the compositor and xdg-shell clients try to update
the window geometry. It means that it's possible to have conflicts
between the two. With this change, the compositor's move resize geometry
will be synced only if there are no pending configure events, meaning
that the user doesn't try to resize the window.
2021-05-25 06:17:41 +00:00
Aleix Pol
e4ed4e5a13 Keep lostLeader code under removeX11Client
The groups concept only applies to X11 clients
2021-05-25 02:29:19 +02:00
Aleix Pol
ae01ed219c workspace: Unify client removal code
We have 2 equivalent code paths for x11 and wayland unnecessarily, unify
them under the same method.
Rename m_clients to m_x11Clients so that it's clear what the difference
is between m_clients and m_allClients.
2021-05-24 23:16:41 +00:00
Nicolás Alvarez
975945677d Fix typo in TESTING.md
test suit -> test suite
2021-05-24 16:22:25 -03:00
David Edmundson
5484b846b3 [kcmkwin/kwindesktop] Implement valueFromText in a spinbox
If textFromValue is set, valueFromText must be.

A lot of other implemenetations were using parseInt() which fails at
reading "3,000" due to the comma. Qt's fromLocaleString handles that but
needs any text stripping.

This implementation isn't perfect, but really we need to work on a good
upstream solution.

BUG: 437472
2021-05-24 18:51:07 +00:00