Commit graph

24738 commits

Author SHA1 Message Date
Vlad Zahorodnii
2ff040a744 plugins/slidingpopups: Fix a crash on compositing restart
The sliding popups effect can be unloaded while there's still an active
animation for a closed window.

If that happens, the EffectsHandler::windowDeleted signal may be emitted
when the EffectWindowDeletedRef objects are destroyed. It happens after
the SlidingPopupsEffect destructor.

The sliding popups effect also has an EffectsHandler::windowDeleted
slot.

So, the problem is that m_animationsData gets destroyed first, then
m_animations is destroyed next. When m_animations is destroyed, the
deleted references will be released and EffectsHandler::windowDeleted
will be emitted. SlidingPopupsEffect::slotWindowDeleted will access
m_animationsData whose memory has been just released.

In order to prevent crashing, this change ensures that animations are
canceled while m_animationsData is still valid.
2023-05-18 06:26:36 +00:00
l10n daemon script
a3bc2abaf1 GIT_SILENT Sync po/docbooks with svn 2023-05-18 02:21:31 +00:00
Ismael Asensio
2449b58974 tiles: Adjust padding between windows
Make the total padding between windows equal to the padding against the
screen borders by applying just half of it on the common borders.

Adjust tests accordingly.

BUG: 469720
FIXED-IN: 5.27.6
2023-05-17 23:18:59 +02:00
l10n daemon script
dde4f5d03c GIT_SILENT Sync po/docbooks with svn 2023-05-17 02:24:12 +00:00
l10n daemon script
f720cf699b 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"
2023-05-17 02:20:11 +00:00
Natalie Clarius
9a3da09899 Refine order of previous/next screens in Workspace::findOutput
A screen should be considered further top, and therefore more previous, only it is strictly above the other with no vertical overlap, and not if only the vertical center is higher while they are horizontally on a line. Otherwise, on a left to right setup with screens of different resolutions aligned at the edges (and thus different vertical centesr), the order will be unintuitive.

BUG: 467996
FIXED-IN: 5.27
2023-05-16 07:54:06 +00:00
Antonio Russo
966416cb60 [script] Find and interact with windows
This patch adds mechanisms to find and interact with windows to the
scripting API:

 - workspace.windowAt provides a way to list the windows at a given
   location on the screen.
 - workspace.stackingOrder provides a list of all windows in the order
   they are stacked on the screen.
 - workspace.raiseWindow provides a mechanism to bring a given window to
   the top of that list, making it visible above all others.

Signed-off-by: Antonio Russo <aerusso@aerusso.net>
2023-05-16 06:29:29 +00:00
Vlad Zahorodnii
ea543ebe14 effects/magiclamp: Improve code readability
Code repetition is not great, but it's extremely hard to read the magic
lamp code because of the SET_QUADS macro.
2023-05-16 06:03:38 +00:00
Vlad Zahorodnii
00a1a506d1 effects/magiclamp: Make it look good with floating panels
The magic lamp literally "squashes" the window through the window icon
in the task manager.

It's assumed that there's nothing below the panel, so the magic lamp
doesn't perform any clipping.

With floating panels, it's not the case. So let's clamp the x or the y
coordinates when the window moves horizontally or vertically,
respectively, in order to ensure that the window is not visible in the
gap between the floating panel and the screen edge.

BUG: 361121
BUG: 466177
2023-05-16 06:03:38 +00:00
l10n daemon script
d13bf01588 GIT_SILENT Sync po/docbooks with svn 2023-05-16 02:35:23 +00:00
Aleix Pol
d6b07b313f libkwineffects: Stop including xcb/xcb.h everywhere
Provide a kwinxcb.h header file instead that offers the xcb-specific bits
from that API. It helps keep kwin effects disconnected from XCB.
2023-05-15 18:59:46 +00:00
Aleix Pol
43291d971a effects: Do not spread the XCB dependency to every effect 2023-05-15 18:59:46 +00:00
Xaver Hugl
afc5567651 Implement initial support for color management and HDR
This is done by converting from the sRGB + gamma 2.2 input from clients
to linear with the color space of the output (BT.709 or BT2020 atm) in
a shadow buffer, and then convert from the shadow buffer to the transfer
function the output needs (sRGB or PQ).
2023-05-15 17:01:03 +00:00
Xaver Hugl
644e31f389 backends/drm: add colorspace, degamma, alpha and pixel blend mode properties
Even if we won't use all of them in the near future, they still need to
be set to avoid issues with other compositors
2023-05-15 17:01:03 +00:00
Xaver Hugl
2fb95eb80c utils/edid: add color and HDR information 2023-05-15 17:01:03 +00:00
Vlad Zahorodnii
124d915408 effects/magiclamp: Improve animation direction heuristic
If the panel is placed between two outputs, the magic lamp can pick
wrong direction and the animation will look bad.

This change improves the direction heuristic by making it analyze the
position of the center point of the screen where the window is relative
to the center point of the icon in the task manager.

The screen center is used instead of the window center in order to
properly handle edge cases such as where the window center is offscreen.

For example, if the panel is vertical (e.g. it's attached to the left
side of a monitor), the magic lamp will pick the following directions:

- if the window is to the left side of the panel, the window will be
  animated so it moves to the right hand side
- if the window is to the right side of the panel, the window will be
  animated so it moves to the left hand side

Without this change, the window will always move to the left hand side.

BUG: 463581
2023-05-15 19:31:06 +03:00
Vlad Zahorodnii
223b01f9e7 wayland: Reevaluate layer shell window layer
Currently, if the layer shell surface's layer changes, the Window's
layer is not synchronized with it.
2023-05-15 08:32:37 +00:00
Vlad Zahorodnii
ad402510d3 wayland: Don't deduce layer shell window layer based on window type
It seemed like a good idea at the time, but it conflicts with the client
side wishing to change the layer.
2023-05-15 08:32:37 +00:00
Vlad Zahorodnii
5ccb543e89 Use flooredPoint() in pointer constraint tests
.toPoint() doesn't work as expected when the pointer has fractional
coordinates and it's near constraint region boundaries.
2023-05-15 07:36:26 +00:00
Vlad Zahorodnii
6c71b87200 wayland: Fix null pointer constraint region handling
If the pointer constraint region is null, the input region must be used
instead. If the pointer constraint region is valid, it should be
intersected with the input region.

BUG: 457021
2023-05-15 07:36:26 +00:00
l10n daemon script
825abf1ca3 GIT_SILENT Sync po/docbooks with svn 2023-05-15 02:21:00 +00:00
l10n daemon script
aa5e8612d0 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"
2023-05-15 02:17:59 +00:00
l10n daemon script
5a287fe37c GIT_SILENT Sync po/docbooks with svn 2023-05-14 02:48:15 +00:00
l10n daemon script
02df2c54a2 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"
2023-05-14 02:42:46 +00:00
Vlad Zahorodnii
e217fda7f0 Fix KScreenIntegration::connectedOutputsHash()
We want to ignore non-desktop outputs, not normal outputs.
2023-05-13 13:28:51 +00:00
Aleix Pol
7580f74d95 aurorae: Fix build with KWIN_BUILD_KCMS=OFF
Moves the KCM into a separate file
2023-05-13 13:48:52 +02:00
Aleix Pol
52a96996f3 Do not look up kcm dependencies if KWIN_BUILD_KCMS=OFF
We are not going to use them anyway...
2023-05-13 13:48:52 +02:00
l10n daemon script
3bfaac45aa GIT_SILENT Sync po/docbooks with svn 2023-05-13 02:21:07 +00:00
David Edmundson
f054ac3d41 Fix build against qt dev 2023-05-12 10:16:39 +00:00
Vlad Zahorodnii
467a1b3b49 Move cursor delegates to scene/
They've been overlooked.
2023-05-12 07:01:35 +00:00
Vlad Zahorodnii
07da1796b8 Revert "wayland: Avoid pointer warp if constraint region is invalid"
This reverts commit 7c91c4bad9.

It created regressions in some video games. After a closer look at the
pointer constraint region handling, there are some issues, but it might
be safer to fix them in master.

In meanwhile, let's revert 7c91c4bad because it breaks more things than
it fixes.

CCBUG: 457021
BUG: 469555
2023-05-11 22:56:32 +03:00
l10n daemon script
16ee683a64 GIT_SILENT Sync po/docbooks with svn 2023-05-11 02:22:17 +00:00
l10n daemon script
fd67dd7b89 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"
2023-05-11 02:19:09 +00:00
Xaver Hugl
8229573e63 autotests/drm: add a test for doing modesets
And fix an issue preventing it from working
2023-05-10 16:29:54 +00:00
Vlad Zahorodnii
9af9e93ef6 backends/{wayland,x11}: Remove unused args 2023-05-10 17:41:03 +03:00
Vlad Zahorodnii
37aef0c015 Take cursor surface offset into account
From the spec

    On surface.attach requests to the pointer surface, hotspot_x
    and hotspot_y are decremented by the x and y parameters
    passed to the request. Attach must be confirmed by
    wl_surface.commit as usual.

In practice, I don't think it matters that much as most toolkits use
wl_pointer.set_cursor to change the hotspot.
2023-05-10 13:09:49 +00:00
Vlad Zahorodnii
1541e35362 Don't assume SurfaceCursorSource has wl_shm buffer
The SurfaceCursorSource assumes that the cursor surface has a wl_shm
buffer attached to it, which is a bad assumption, as the client can
attach a buffer of any type to the surface. Furthermore, the cursor
surface can have custom transforms applied to it, for example a
wp_viewport, which current code fails to handle.
2023-05-10 15:40:59 +03:00
Vlad Zahorodnii
dbce106031 wayland: Grab the contents of cursor scene 2023-05-10 15:40:59 +03:00
Vlad Zahorodnii
76e911d2cc Drop ImageCursorSource
The ImageCursorSource used to be primarily a porting aid. That is, if we
couldn't port some code to SurfaceCursorSource or ShapeCursorSource, the
ImageCursorSource was used in interim. Now, all parts of kwin have been
ported to ShapeCursorSource and SurfaceCursorSource, so the image cursor
source can be dropped.
2023-05-10 15:40:59 +03:00
Vlad Zahorodnii
3d5b5844d0 Drop Cursor::image()
Use CursorSource::image() instead.

Cursor caching in the ScreenCastStream has been changed so
QImage::cacheKey() is not being used. This is rather a preparation for
making kwin grab the contents of the cursor scene.
2023-05-10 11:56:20 +00:00
Vlad Zahorodnii
af7c1db43b backends/drm: Drop DrmAbstractOutput::regionToRects() 2023-05-10 11:07:23 +00:00
Vlad Zahorodnii
b7a9d00752 backends: Prefer Output::modeSize() over Output::pixelSize()
Output transforms are handled differently, so let's use modeSize() to
pick the buffer size consistently.
2023-05-10 11:07:23 +00:00
Xaver Hugl
a48c98f5ab xcbutils: fix nativeFloor
The floor was not done in the X-native coordinate space but with double
scaling

BUG: 459373
2023-05-10 10:52:51 +00:00
Nicolas Fella
dd604c8e42 [plugins/stickykeys] Unlatch keys when deactivating sticky keys
Otherwise when deactivating sticky keys while a modifier is latched
it will stay latched forever with no way to unlatch
2023-05-10 10:37:26 +00:00
Nicolas Fella
1187f3c624 [plugins/stickykeys] Fix config group check
We are comparing the wrong group name, breaking reacting to config changes
2023-05-10 10:14:29 +00:00
Vlad Zahorodnii
04a592ff66 plugins/screencast: Remove "frame dropped" log messages
They can be safely ignored, so remove them to avoid spamming the logs.
2023-05-10 09:11:42 +00:00
Vlad Zahorodnii
00e536f22a Drop EglDisplay::supportsSwapBuffersWithDamage()
It's unused.
2023-05-10 11:34:19 +03:00
l10n daemon script
920165c187 GIT_SILENT Sync po/docbooks with svn 2023-05-10 02:26:41 +00:00
l10n daemon script
47cb5c144e 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"
2023-05-10 02:21:31 +00:00
Vlad Zahorodnii
75f79618e9 backends/x11: Remove GLFramebuffer::pushFramebuffer()
It's unbalanced and the scene is responsible for pushing the fbo now.
2023-05-09 16:42:15 +00:00