Commit graph

20773 commits

Author SHA1 Message Date
Vlad Zahorodnii
dcd1e3b87a kwinglutils: Drop GLRenderTarget::setTextureDirty()
It's effectively unused and removing it allows us to get rid of
GLTexture field, which is very useful for abstracting the concept of a
"render target" across OpenGL and QPainter backends.
2022-02-15 13:02:57 +02:00
Vlad Zahorodnii
436187762e kwinglutils: Deprecate GLTexture dirty state tracking
It's currently being used only by the X11 standalone backend. We should
either port the X11 backend to manual dirty state tracking or waiting
until it gets dropped. The main motivation for getting rid of the dirty
state tracking in the GLTexture is that it keeps kwin open for
alternative opengl wrappers, e.g. QOpenGL, and it simplifies GLTexture
code.
2022-02-15 12:58:43 +02:00
Vlad Zahorodnii
e9af67af3e kwineffects: Add GLTexture::render() overload that takes no scissor region
In many cases, we don't care about the scissor region. This change adds
a relevant overload to make code easier to read.
2022-02-15 12:17:59 +02:00
Vlad Zahorodnii
52beb213e7 kwineffects: Make GLRenderTarget and GLVertexBuffer work without global coords and scale
Because the GLRenderTarget and the GLVertexBuffer use the global
coordinate system, they are not ergonomic in render layers.

Assigning the device pixel ratio to GLRenderTarget and GLVertexBuffer is
an interesting api design choice too. Scaling is a window system
abstraction, which is absent in OpenGL or Vulkan. For example, it's not
possible to create an OpenGL texture with a scale factor of 2. It only
works with device pixels.

This change makes the GLRenderTarget and the GLVertexBuffer more
ergonomic for usages other than rendering the workspace by removing all
the global coordinate system and scaling stuff. That's the
responsibility of the users of those two classes.
2022-02-15 12:17:56 +02:00
Vlad Zahorodnii
d92afc849e kwineffects: Forbid most of operations with invalid render targets
This simplifies a lot of things.
2022-02-15 12:06:50 +02:00
Vlad Zahorodnii
383a5cee0b kwineffects: Remove GLRenderTarget::{attachTexture,detachTexture}
They're unused and immutable render targets are easier to handle.
2022-02-15 12:06:50 +02:00
Vlad Zahorodnii
eea94660dc utils: Extract DamageJournal in its own file 2022-02-15 11:38:51 +02:00
Xaver Hugl
dece547a75 backends/drm: refactor surface handling
In order to support layered rendering and tiled outputs KWin needs to be
able to split rendering of outputs into multiple surfaces. This commit
prepares the drm backend for that, by moving most of the code in EglGbmBackend
out to a EglGbmSurface class, which will later be used for overlay surfaces
and rendering to multiple connectors side by side.

In doing that, this commit also cleans up the code a bit, removes a lot of
now unnecessary multi-gpu stuff and potentially makes modesets a little
bit more efficient by re-using resources more often.
2022-02-15 09:12:23 +00:00
Xaver Hugl
9dc4c7309e backends/drm: move damage tracking into DumbSwapchain 2022-02-15 09:12:23 +00:00
Xaver Hugl
5d317641a4 backends/drm: move damage tracking into GbmSurface 2022-02-15 09:12:23 +00:00
Xaver Hugl
cfdb303012 backends/drm: inline renderFramebufferToSurface
And also remove an unnecessary makeContextCurrent
2022-02-15 09:12:23 +00:00
Xaver Hugl
c498d31aa7 backends/drm: move makeContextCurrent into GbmSurface 2022-02-15 09:12:23 +00:00
Kai Uwe Broulik
00f2dc1d88 Remove KIconThemes dependency
It has been unused since 7706e17d but was left in CMakeLists.txt

Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-15 08:43:15 +00:00
Xaver Hugl
4d0998cfed backends/drm: fix legacy dpms 2022-02-15 08:17:17 +00:00
Vlad Zahorodnii
76dbe9e590 effects/desktopgrid: Remove unused include 2022-02-15 07:21:28 +00:00
Vlad Zahorodnii
e1024d38d1 cmake: Specify link libraries per effect target
This allows to track per effect dependencies more precisely. The main
problem with a library and a comment next to it saying who needs it is
that the comment can get easily outdated.
2022-02-15 07:21:28 +00:00
Ismael Asensio
f055efc941 tests/xdgshellclient_rules: Add tests for screen rules
There are two operations failing currently, so we QEXPECT_FAIL
them for now:
- A new client is not moved to the screen set by the rule
   (Wayland only). Affects Apply, Force and Remember
- Disabling and enabling an output will not move the client
   to the Forced screen (On X11 and Wayland, BUG:409979)
2022-02-14 17:15:19 +00:00
John Zimmermann
9c65d61b98 utils/serviceutils: compare executablePath against canonical path of exec fields in .desktops
/proc/%/exec always points to the canonical/real path of a binary,
the exec field of a .desktop might contain a symlink and therefore
differ from canonical path.
Explicitely canonicalizing the path in exec prevents this mismatch.
2022-02-14 15:50:24 +01:00
Vlad Zahorodnii
8e05732670 x11: Fix shrinking window size after toggling no border multiple times
The first move() in X11Client::createDecoration() will alter the client
size, which will result in the subsequent resize() incorrectly resizing
to a smaller window size.

In order to fix that issue, this change makes X11Client adjust the
frame geometry atomically after creating or destroying window decoration.

BUG: 449988
2022-02-14 14:00:14 +00:00
Vlad Zahorodnii
c76855520c wayland: Fix maximize mode propagation to decoration
If the window is initially maximized, there won't be any current
decoration when XdgToplevelClient changes the maximize mode, we need to
use m_nextDecoration.

BUG: 450053
2022-02-14 13:41:39 +00:00
Albert Astals Cid
5ddd43958d HighlightWindowEffect: Use the duration parameter 2022-02-14 13:51:02 +01:00
Kai Uwe Broulik
4c0c2cebe6 effects/overview: Add translation domain 2022-02-14 11:36:51 +00:00
Kai Uwe Broulik
2fbc821899 effects: Extract messages from QML files 2022-02-14 11:36:51 +00:00
Vlad Zahorodnii
6182744a2b Add support for xdg_toplevel.configure_bounds()
With the xdg_toplevel.configure_bounds event, the compositor will be
able to indicate the client the maximum desired surface size.

It can be used to prevent mapping too big application windows, etc.
2022-02-14 10:42:32 +00:00
Kai Uwe Broulik
88e36d0b04 Fix build without Qt session manager
Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-14 07:58:47 +00:00
Kai Uwe Broulik
7beb3f6ec6 Fix build without tabbox
Signed-off-by: Eike Hein <eike.hein@mbition.io>
2022-02-14 07:58:47 +00:00
Vlad Zahorodnii
3da9e017a0 cmake: Use target-based ecm_qt_declare_logging_category()
This makes CMakeLists.txt code depend less on variables.
2022-02-14 07:29:15 +00:00
l10n daemon script
ead073b0cc 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"
2022-02-14 01:42:49 +00:00
Aleix Pol
ad0a35882e inputmethod: Also open the inputm method panel with a pen
BUG: 449888
2022-02-14 00:24:30 +00:00
Nicolas Fella
a2ebad760f Implement services in our QPA
This is required for QDesktopServices to work.

Use QGenericUnixServices like the xcb and wayland QPA

BUG: 446144
2022-02-13 00:41:10 +01:00
Nicolas Fella
77ec43d5e1 Don't force QT_QPA_PLATFORM=wayland
We're setting this env variable because earlier we used it to force kwin to use its special QPA so we need to change that back to something sensible.

However setting it to Wayland breaks apps that ship their own Qt with missing or broken Wayland support.

Set it to be empty instead. Well-behaved Qt apps will use Wayland regardless because of XDG_SESSION_TYPE.

BUG: 450000
2022-02-12 13:57:19 +00:00
Vlad Zahorodnii
a4bb3896bf Schedule workspace repaint when window leaves current desktop
When a window leaves the current virtual desktop, we need to schedule a
workspace repaint so the compositor repaints the old region of the
window on the current desktop.

In hindsight, the scene graph must schedule a repaint, but it's not
doable with the current effects api, it will be changed with future
refactoring changes.

BUG: 444172
2022-02-12 12:06:00 +00:00
l10n daemon script
d7ee3f1221 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"
2022-02-12 01:43:02 +00:00
Aleix Pol
c9715a828d Initialize the KSldApp after we connect
In some cases, initialize() will emit an aboutToLock() signal that we
need to catch. Otherwise LockOnStart finds its m_waylandFd=-1
2022-02-11 16:35:17 +00:00
Alexander Lohnau
e70ec569e3 Fix loading of effect if plugin defined X-KDE-Library
Otherwise we get the filename to the library and not the KPackage.

The plugin having this set is most likely a leftover, because KPackage plugins
to not need to define a library.

BUG: 449881
2022-02-11 15:40:42 +00:00
Vlad Zahorodnii
712dbc4122 wayland: Fix mispositioned decoration tooltips
QPlatformScreen::virtualSiblings() must return a list of screens on the
virtual desktop, otherwise QToolTip will use
QGuiApplication::primaryScreen() instead of looking up the screen where
the decoration tooltip must be shown using QDesktopWidget::screenNumber().

BUG: 432860
2022-02-11 10:08:19 +00:00
David Edmundson
12427932de Make openGL context current when recording frame triggered by cursor move
recordFrame requires an openGL context. This is typically done after a
frame is rendered, but when we send a frame after a cursor move this is
not guaranteed.

BUG: 448162
2022-02-11 09:24:12 +00:00
Jan Blackquill
c0cb349cb8 effects/DesktopGrid: use delta, not absolute time for MotionManager
Despite the argument naming, the input for WindowMotionManager::calculate is supposed to be a
delta, not an absolute time. Giving it a delta fixes the PresentWindows in the DesktopGrid.

BUG: 443971
2022-02-11 09:04:30 +00:00
Julius Zint
43bcd57853 Fix window decoration quads in OpenGL scene
The quads for the left and right window decorations were broken in
3b4d55837. The problem is only visible for window decorations with more
than one color.
2022-02-11 08:15:37 +00:00
l10n daemon script
97dde989c3 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"
2022-02-11 01:45:31 +00:00
Aleix Pol
725d61877c screencast: have our streams provide SPA_META_Header
It can be useful for clients to know what's going on in a specific
stream.
2022-02-10 23:57:09 +00:00
Vlad Zahorodnii
0574a7534a wayland: Make the launcher not restart kwin_wayland if it crashes at shutdown
Currently, if kwin_wayland crashes at shutdown, the launcher can
potentially spawn it again. This change addresses that issue by making
the wrapper ignore the QProcess::finished() signal.
2022-02-10 12:29:54 +00:00
Tobias C. Berner
feffa184fb Add missing errno.h include 2022-02-10 10:14:02 +01:00
Vlad Zahorodnii
c54937b2ad Avoid mixing current and next state
Mixing of current and next state can create all sorts of undefined
behavior, e.g. windows not moving to the desired location or
experiencing issues when tiling a maximized window.

BUG: 449541
2022-02-10 08:43:17 +00:00
Vlad Zahorodnii
3fb6901646 effects/overview: Hide selection rect during dnd
BUG: 448573
2022-02-10 08:15:00 +00:00
Vlad Zahorodnii
ed670377c8 effects/overview: Don't show minimized windows in desktop thumbnails
BUG: 448850
2022-02-10 07:23:30 +00:00
Vlad Zahorodnii
0ad239a92d Fix mouse pointer disappearing after using zoom effect on X11
Currently, the Cursors::currentCursorChanged signal is wired to the
updateCursor() function which calls xcb_xfixes_hide_cursor() or
xcb_xfixes_show_cursor() depending if the cursor is hidden. However, the
currentCursorChanged signal can be emitted if the cursor changed, e.g. a
new pixmap attached, or its visibility status changes.

The zoom effect hides the pointer, but when user hovers ui elements, it
will most likely change and result in more than one xcb_xfixes_hide_cursor()
calls.

It appears like xcb_xfixes_hide_cursor() is implemented as a reference
counter, i.e. if xcb_xfixes_hide_cursor() is called two times, then you
must call xcb_xfixes_show_cursor() two times as well.

This change adds a dedicated signal to indicate whether the cursor is
hidden to avoid calling xcb_xfixes_hide_cursor() multiple times while
the screen is scaled.

BUG: 448537
2022-02-10 07:07:03 +00:00
Michail Vourlakos
bc145b614c support kdecoration2 blurregion
--use kdecoration2 blurred regions to adjust blur effect appropriately when
needed

CCBUG:395725

Requires: https://invent.kde.org/plasma/kdecoration/-/merge_requests/17
2022-02-09 21:00:07 +00:00
Vlad Zahorodnii
c0d0fab049 x11: Prefer kwinApp()->x11RootWindow() over rootWindow() 2022-02-09 19:10:58 +00:00
Vlad Zahorodnii
ec7198ee33 x11: Prefer kwinApp()->x11Connection() over connection()
With connection(), we will look up the x11 connection property on
kwinApp() object, which is less efficient than just calling a method on
the app object.
2022-02-09 19:10:58 +00:00