Commit graph

22789 commits

Author SHA1 Message Date
Xaver Hugl
13d079cdd7 backends/x11: do less manual memory management 2022-06-21 17:50:49 +00:00
Xaver Hugl
e745577b4c backends: port vsync helpers to std::unique_ptr 2022-06-21 17:50:49 +00:00
Xaver Hugl
4cab9c4fc7 backends: port from QScopedPointer to std::unique_ptr 2022-06-21 17:50:49 +00:00
Aleix Pol
1112c29eb4 drm: Drop wrong assert
It blows out on nvidia proving my assumption was wrong back then
2022-06-21 14:16:46 +00:00
Aleix Pol
7b933abc0f backends/wayland: Don't rearrange outputs every time the window is resized
It makes it very hard to debug any use-case that isn't a strip of
outputs and even then, we should have other mechanisms to arrange
outputs properly (i.e. through kscreen).
2022-06-21 10:33:12 +00:00
Aleix Pol
5490b00117 backends/wayland: Allow outputs to have a name
As expected in many parts of our codebase
2022-06-21 10:33:12 +00:00
Vlad Zahorodnii
d40aec0853 effects/desktopgrid: Allow switching between desktops using digit and function keys
C++ version allowed switching between virtual desktops by pressing
function keys (Fn) or digit keys.

BUG: 455292
2022-06-21 10:43:13 +03:00
Vlad Zahorodnii
48f69146d3 Unvirtualize Scene::paintWindow() 2022-06-20 17:59:02 +03:00
Vlad Zahorodnii
a85960833b effects/screentransform: Do proper cross-fading
At the moment, the effect that animates the screen works as follows:

* render the screen before it's rotated in an offscreen texture
* after screen rotated, paint the offscreen texture in the first half of
  the animation but not the screen contents after rotation and in the
  second half of the animation, paint the live screen contents

This works but it doesn't take into account things such as blur (I can
see that the region around where the panel should be doesn't look as
expected).

This change makes the screen transform effect do proper cross-fading,
i.e. save the screen before it's rotated in an offscreen texture, render
the current screen in an offscreen texture, and produce the final result
by cross-fading between two offscreen textures in a shader.

Besides fixing the visuals of the effect, another motivation behind this
change is to reduce the number of ScreenPaintData transforms, which can
be very handy in simplifying item painting code.
2022-06-20 13:56:04 +00:00
Vlad Zahorodnii
35a3184ea3 Fix computation of effective opaque region of SurfaceItemX11
The value of _NET_WM_OPAQUE_REGION can be out of sync with the geometry
of the window. The NETWM spec suggests to compute the effective opaque
region by taking intersection of _NET_WM_OPAQUE_REGION and the bounding
region set by the shape extension.

SurfaceItemX11::opaque() got broken after refactoring opaque region
handling in wayland surfaces so SurfaceInterface::opaque() always
returns a sane value, the computation of effective opaque region is done
in SurfaceInterface at commit time.

BUG: 455617
2022-06-20 10:18:18 +00:00
Marco Martin
c1a536a527 Fix dragging especially by touch
The drag manager of a window now can take over from anything, so that
the events to initiate a drag are not stolen by the tap handlers
(fixes the drag starts only the second time is tried issue)

On wayland drag by touch was completely broken by the supportsclosewindows check,
now the touch drag handler is always active and the check of the property is done only
when the drag is over

BUG:455268
2022-06-20 10:11:04 +00:00
l10n daemon script
4699f8c0e2 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-06-20 01:54:30 +00:00
Méven Car
4082fdf960 WaylandServer: Add a setting to disable PrimarySelection
CCBUG: 441668
2022-06-19 05:49:20 +00:00
l10n daemon script
d86563a836 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-06-19 01:42:58 +00:00
Aleix Pol i Gonzalez
5338d1a2b0 backends: We need to make current before calling importDmaBufAsTexture
Calls it for the WaylandBackend, ensures the declaration of the pointer
to the EglBackend in the drm case is done in the correct scope.
2022-06-18 20:00:32 +02:00
Weng Xuetian
e25a86bcd1
Fix typo in qml margin
top -> right
2022-06-17 13:58:05 -07:00
Nate Graham
5021464f4b kcmkwin/kwinscreenedges: Add missing colon for "Behavior" label 2022-06-17 13:37:47 -06:00
Xaver Hugl
1966638017 backends/drm: do cross-gpu imports again for test commits
Otherwise all commits will fail without a clear visible reason.

BUG: 454086
2022-06-17 17:45:18 +02:00
Marco Martin
13e3630127 effects/windowview: Search on all screens
use a property of the effect itself to store the search text
so all the views will search for the same thing at the same time.

BUG: 455353
FIXED-IN: 5.25.1
2022-06-17 14:55:39 +00:00
Vlad Zahorodnii
a6b5efd43d effects: Improve gesture handling in some effects
At the moment, it's possible to activate a qtquick effect while another
qtquick effect is already active, we have code that prevents fullscreen
effects overriding each other, yet that still happens.

The reason for that behavior is that the gesture recognizer will mark
all gestures as started when user starts swiping on touchpad and cancel
gestures as more swiping occurs. This can mistrigger toggling logic in
the window view effect and the desktop grid effect, etc.

In order to make handling of gesture cancellation correct, we could
check whether user has swiped enough to deactivate window view, or
desktop grid. This change tries to implement exactly that.

As a side-effect, it also allows toggling the effect with the same
gesture. However, we should make cancellation gestures opposite of
activation gestures, i.e. if 4 swipe up gesture is used to activate an
effect, then 4 swipe down gesture should be used to deactivate the
effect.
2022-06-17 11:30:56 +00:00
Marco Martin
32e6632d13 Make gbm_bo_create_with_modifiers2 inline
needed to link some tests

APPROVED-BY: vlad.zahorodnii@kde.org
2022-06-17 11:16:19 +02:00
Vlad Zahorodnii
24bc3fed6c qpa: Fix a crash in EGLPlatformContext::swapBuffers()
After internalWindow->present() is called, we cannot guarantee that the
current opengl context hasn't changed. If kwin changes the current opengl
context, bindContextFBO() can crash because there may not be current
QOpenGLContext.

BUG: 455435
2022-06-17 08:27:02 +00:00
Xaver Hugl
34ce3dde87 backends/drm: use GBM_BO_USE_SCANOUT when importing buffers for multi gpu
The gbm surface may not have the scanout use flag, and if the buffer is imported
without it, creating the framebuffer may fail

CCBUG: 454086
2022-06-16 17:02:16 +02:00
Marco Martin
c61f0ad158 Don't use the plasma theme for icons in overview
don't attempt to use icons meant for the systray

BUG:455368
2022-06-16 13:55:25 +00:00
Aleix Pol
cd2567a838 drm & wayland: Remove unnecessary close() 2022-06-16 13:18:32 +00:00
Aleix Pol
1d5c803ce0 drm: Change where we call makeCurrent when creating dmabufs
We only need to call it before issuing opengl calls, so it's not
necessary when testing or when gbm fails to create the Buffer Object.
2022-06-16 13:18:32 +00:00
Aleix Pol
538b848f80 backends: Split out a DmaBufParams class
Instead of using a DmaBufAttributes instance to communicate the settings
to create a new dmabuf, use a smaller DmaBufParams class that only
contains the information we need after destroying the BO.
2022-06-16 13:18:32 +00:00
Aleix Pol
56ab74a143 backends: Share gbm create implementations between drm and wayland 2022-06-16 13:18:32 +00:00
Aleix Pol
f50f519370 EglDmaBuf: reuse implementation in AbstractEglBackend to import an EGLImage 2022-06-16 13:18:32 +00:00
Aleix Pol
aa59344be7 Platform: Improve our infrastructure to support dmabufs in backends
Allows creating buffers with modifiers.
Lets the windowed wayland backend support it, which makes testing
everything else much simpler.
2022-06-16 13:18:32 +00:00
Marco Martin
e04542995e fix windows dragging in desktop grid
Don't disable the main drag handler when canclosewindows is disabled,
that one is not used to close windows but to drag them on other desktops or screens

BUG: 455268
2022-06-16 09:50:01 +00:00
Vlad Zahorodnii
c7ba0a2567 effects/blur: Make shader code readable
At the moment, blur shader code is barely readable because the code is
constructed at runtime.

Since ShaderManager handles opengl context profiles when loading shaders
from files, we can improve code readability by splitting shader code in
the corresponding files.

Note that ShaderManager adds "precision highp float;" for convenience
(whether using "highp" is okay is up for debate).
2022-06-16 08:26:28 +00:00
Vlad Zahorodnii
a4b41c84e1 effects/windowview: Redirect key events to search field
Redirect key events to search field so user can search for windows
without manually focusing the search field. It matches the behavior of
the overview effect.

BUG: 455100
2022-06-16 10:26:36 +03:00
l10n daemon script
62b9d03784 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-06-16 01:55:02 +00:00
David Edmundson
f4df25bd87 Require passing unit tests on Linux and BSD 2022-06-15 18:58:47 +00:00
David Edmundson
a74694f6ff [xwl] Restart xwayland regardless of exit value
In the case of an assert, for example a wayland error Xwayland will
exit, but with an exitStatus of "normal exit".

We also trigger a shutdown should kwin encounter an error on the X11
side, this would be a clean exit from an XwaylandLauncher point of view.
It makes sense to try to restart.

Deliberate shutdown is handled by destroying the XwaylandLauncher. This
means it's not an issue for final kwin teardown.
2022-06-15 09:25:32 +00:00
Vlad Zahorodnii
1725e22483 effects/slide: Ensure that there's only one visibility ref per window
If a window is added and then the current virtual desktop changes, we
can encounter the following situation:

 * desktopChanged signal is emitted, and the slide effect starts
   animation. SlideEffect::prepareSwitching() will setup windows; note
   that the new window may be present in effects->stackingOrder()
 * windowAdded signal is emitted, and slide effect tries to ref the
   window again

In order to ensure that there's only one reference, maintain visibility
refs in a hashtable.

BUG: 455237
2022-06-15 06:48:43 +00:00
l10n daemon script
58da3aff46 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-06-15 01:47:02 +00:00
ivan tkachenko
053afea80c
[OSD] Update QML/JavaScript code style 2022-06-14 22:50:13 +03:00
Vlad Zahorodnii
634e032201 Remove redundant initializeX11() in Compositor
Compositor::setupStart() already calls initializeX11(). This fixes
BadAccess warning on startup.

CCBUG: 455167
2022-06-14 19:38:23 +03:00
David Edmundson
1e62fe99bd Remove superfluous area check
If area.contains(geometry.topLeft()) is false this does nothing anyway
2022-06-14 11:34:50 +00:00
Vlad Zahorodnii
411607897f core: Make screen area safer in Workspace::clientArea()
If the given output or desktop is not in m_screenAreas, [] operator can
crash.
2022-06-14 11:09:58 +00:00
Vlad Zahorodnii
ac97e282fc scripting: Handle bad output and desktop ids gracefully
Don't crash if a script has provided bad screen or desktop id to
clientArea().

CCBUG: 449957
2022-06-14 11:09:58 +00:00
Xaver Hugl
3c0ed5643b effects/windowview: do close animation after gesture ended 2022-06-14 08:47:39 +00:00
Rachel Mant
fd18401dbf Introduced a new setting for the task switcher - OrderMinimizedMode - and implemented the tabbox logic for it 2022-06-14 07:57:01 +00:00
Rachel Mant
9e9e05f865 Cleaned up the definition of the stickyClient local 2022-06-14 07:57:01 +00:00
Rachel Mant
0f2fe33ed7 Refactored out the StackingOrderSwitching logic for the tabbox client model 2022-06-14 07:57:01 +00:00
Rachel Mant
93f322d262 Refactored out the FocusChainSwitching logic for the tabbox client model 2022-06-14 07:57:01 +00:00
Emilio Cobos Álvarez
7e1617c280 [x11] Implement _GTK_SHOW_WINDOW_MENU.
BUG: 454756
2022-06-14 06:55:07 +00:00
l10n daemon script
fefd730273 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-06-14 01:52:48 +00:00