Commit graph

26112 commits

Author SHA1 Message Date
Niccolò Venerandi
69f8bee0b1 kcms/screenedges: Hardcode the Overview as an option in the touchscreen KCM
You can now select "Overview" in the touch KCM to use it as a touch edge gesture again!
2024-01-18 14:08:34 +00:00
Xaver Hugl
d5ca429627 wayland: consider every commit a "content update" for presentation time
The protocol doesn't have a definition of what it means, but damage is a
flawed interpretation. Color management changes are arguably content updates,
so are viewporter changes, so are blur changes and so on.

Also see https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/36
for an upstream discussion of this
2024-01-18 13:45:18 +00:00
Vlad Zahorodnii
da4f4d7e69 Rename UnmanagedLayer to OverlayLayer
The UnmanagedLayer layer is used for placing overlay content so
rename it to match how it's used in practice.
2024-01-18 13:13:55 +00:00
l10n daemon script
9f10d5d79f GIT_SILENT Sync po/docbooks with svn 2024-01-18 01:20:12 +00:00
Fushan Wen
f79886765d plugins/colorblindnesscorrection: remove duplicate definition in Tritanopia shader 2024-01-17 23:42:58 +00:00
Vlad Zahorodnii
176ae6e692 Drop window type rule
Practically all code assumes that the window type is static and fixing
it would bring extra complexity, which may not be worth given that there
are window rules to control position, focus, layer, etc.

BUG: 466016
2024-01-17 23:05:53 +00:00
Vlad Zahorodnii
5c4acbdddd Introduce layer window rule
The new window rule allows to overwrite the stack layer. It can be
useful on wayland to force picture-in-picture surfaces (which are
xdg-toplevels at the moment) to be placed above fullscreen windows.
Keep above flag is unsuitable because fullscreen windows are placed
higher "above" windows.

CCBUG: 466016
2024-01-17 23:05:53 +00:00
Vlad Zahorodnii
74a193d383 plugins/shakecursor: Use std::deque to store history
It's more suitable for the task. The ShakeDetector constantly adds new
items at the end of the list and pops old items at the front.
2024-01-17 22:00:30 +02:00
Yifan Zhu
597753047d window: use QRect to calculate visiblePixels
If QRectF is used, the exact comparison several lines down will fail.
2024-01-17 18:05:54 +00:00
Yifan Zhu
2dba3d30af window: don't use exact comparison for QRectFs
With fractional geometries, we can only guarantee that
nextMoveResizeGeom eventually is within one unit of
currentMoveResizeGeom.

BUG: 479786
FIXED-IN: 6.0
2024-01-17 18:05:54 +00:00
Nate Graham
e963ae09cc screenedge: reduce default activation delay
Currently there is a 150ms delay before screen edge actions and
hotcorners are triggered; the cursor has to spend that much time there
before they'll activate. This is good for preventing accidental
activations, but also prevents and delays deliberate activations, which
are likely to be more annoying for the user.

To alleviate this, the delay is reduced to 75ms, which still prevents
most of the accidental activations in my testing, while making
deliberate activations faster and easier.
2024-01-17 14:52:05 +00:00
Xaver Hugl
7007599b3f backends/drm: ensure commits are done before vblank
If a commit is applied during vblank, the kernel delays it to the next vblank,
for X11 reasons. To ensure that doesn't happen with KWin, read how long
vblank is for the current mode and adjust the safety margin accordingly.

CCBUG: 477959
2024-01-17 13:47:58 +00:00
David Edmundson
42c61dc6a3 plugins/screencast: Don't recreate the core every stream
Loading pipewire is noticably slow with libpipewire loading a bunch of
internals.

Change from a singleton pattern to being managed by the
ScreencastManager

This is still unloaded if the plugin is explicitly stopped.
2024-01-17 13:27:00 +00:00
Vlad Zahorodnii
9c2f12f98f backends/drm: Provide a way to force color management
It can be handy if kwin runs on a setup not capable of HDR or without an
ICC profile. The output management protocol has not been touched because
the long term goal is to have color management enabled by default. This
is rather for testing purposes.
2024-01-17 13:23:15 +02:00
Xaver Hugl
e9db9cd7d3 plugins/fullscreen: retarget the animation instead of restarting it
BUG: 474488
FIXED-IN: 6.0
2024-01-17 11:18:35 +01:00
Jie Liu
1a1eaee13f Only precompute the geometry restore when m_interactiveMoveResize.initialQuickTileMode is None
If the user wants to move a tiled window but changes their mind and tiles the window back to the previous
position, quickTileGeometryRestore() will return an error value beacause m_electricMaximizing is true and
the m_electricGeometryRestore is the same as the geometry of the window in the last tiled mode.

Now the geometry restore of the tiled window is true when starting interactive move, so we no longer need
to precompute it.

Changes for testQuickTilingPointerMove:

We need to attach a new image after the tiling window, so that updateElectricGeometryRestore can obtain
the same framegeometry as the framegeometry obtained during actual runtime.

Now testQuickTilingPointerMove can detect the error:If the user wants to move a tiled window but changes
their mind and tiles the window back to the previous position, quickTileGeometryRestore() will return an
error value beacause m_electricMaximizing is true and the m_electricGeometryRestore is the same as the
geometry of the window in the last tiled mode.

Signed-off-by: Jie Liu <liujie01@kylinos.cn>
2024-01-17 01:03:27 +00:00
Xaver Hugl
fd2e77317f wayland/surface: store subsurface transaction in a unique_ptr 2024-01-17 00:12:38 +00:00
Xaver Hugl
6ab8f179a7 backends/drm: apply the ICC profile without premultiplication
As a side effect, this ensures that when alpha is zero, rgb is zero as well.
This is needed because the ICC profile may contain transformations where zero
brightness gets mapped to a non-zero value.

BUG: 479380
2024-01-16 19:42:12 +01:00
Xaver Hugl
ed339de953 opengl/glshadermanager: add missing newline
BUG: 479279
2024-01-16 14:42:27 +01:00
David Redondo
203c4998bc Make sure window thumbnails and Qt Quick resources are destroyed properly
Drops the doneCurrent as it was preventing proper cleanUp
because no context was current when textures were deleted.
Also avoid manipulating the context when Qt has the current
one, as various Qt classes have guards around their cleanup
handlers which rely on a current Qt context.
Despite the comment the order of render control and view destruction
needs to be switched as the QQuickWindow destructor calls into
the render control to notify if of window destruction.
BUG:478770
BUG:479846
FIXED-IN:6.0
2024-01-16 13:45:52 +01:00
l10n daemon script
3dd18a543b GIT_SILENT Sync po/docbooks with svn 2024-01-16 01:21:56 +00:00
Xaver Hugl
4433fb48dc backends/drm: make icc profiles work with OpenGL ES
OpenGL doesn't support 1D textures, and has some special requirements in
the shaders, like no implicit conversion from int to float
2024-01-15 18:56:54 +00:00
Joshua Goins
c3d3d83b56 Add missing find_dependency for epoxy
This is required by the KWin target, but was missing a find_dependency
call. If any downstream project tried to link to the KWin::kwin target,
it would fail because epoxy couldn't be found.
2024-01-15 18:02:44 +00:00
David Edmundson
2e6619f3d0 screencasting: Resume streams after buffer renegotiation
When we start renegotiation the stream is pasused. This is not restarted
when the format has been renegotiated.

This occurred when a streaming window was resized
2024-01-15 16:53:01 +00:00
Vlad Zahorodnii
f665dda192 scene: Remove warning message about older presentation timestamps
Outputs present frames at different pace, some can present new content
later, some sooner. If the scene gets a slightly older presentation
timestamp, it's okay.
2024-01-15 15:55:06 +00:00
Vlad Zahorodnii
af39179446 Break show desktop mode if a new window is added
BUG: 479424
2024-01-15 15:41:57 +00:00
Vlad Zahorodnii
359f36d6ab autotests: Add a test to verify that show desktop mode quits after activating a window 2024-01-15 15:41:57 +00:00
Vlad Zahorodnii
3b67edf20d backends/drm: Fix a crash in VirtualEglGbmLayer::texture()
If nothing has been rendered yet, m_currentSlot will be null.

BUG: 475296
BUG: 479558
2024-01-15 15:07:39 +00:00
Vlad Zahorodnii
72c391ebc8 effect: Remove const refs in EffectFrame
It's a micro optimization.
2024-01-15 14:42:27 +00:00
Vlad Zahorodnii
09f97c8037 plugins/mouseclick: Fix glitches
Effect frame geometry is not properly synchronized with the quick
scene geometry.

BUG: 477892
2024-01-15 14:42:27 +00:00
Vlad Zahorodnii
b98607c689 Fix cleanup of forced window shortcuts
XdgToplevelWindow doesn't call finishWindowRules(). It creates a problem
for Workspace::removeWindow() because it calls setShortcut() to release
the window shortcut.

While one way to fix the bug would be to add a finishWindowRules() call
in XdgToplevelWindow, it would perhaps be not the best one because it
would change the appearance of decoration when the window is closed.

Instead, this change makes the workspace release the shortcut when the
window is closed. It has a couple of advantages: the appearance of the
decoration won't change, shortcut cleanup is better encapsulated.

BUG: 478647
2024-01-15 14:24:59 +00:00
Vlad Zahorodnii
4f8c941bff scripting: Fix a crash in useGlThumbnails() when compositing is off
BUG: 479791
2024-01-15 14:07:51 +00:00
Vlad Zahorodnii
2d71d7cada plugins: Hide "Drag Down to Close" when using a pointing device
BUG: 479802
2024-01-15 15:35:03 +02:00
Vlad Zahorodnii
0ddcc85f68 plugins/shakecursor: Ignore motion events with at least one pressed button
It reduces the chances of false triggering the plugin, for example if
the user presses a mouse button and chaotically moves the pointer
because they navigate in 3D space and what not.
2024-01-15 08:24:29 +00:00
Yifan Zhu
1f74e9a5c5 scene/cursordelegate_opengl: undo ortho() flip y
Flip y axis before and after applying renderTarget.transform to undo
ortho() flipping the y axis. Otherwise the cursor is invisible on
rotated screen.

BUG: 479764
FIXED-IN: 6.0
2024-01-14 20:48:58 -08:00
Joshua Goins
e00a26d72d Fix link to Frameworks Coding Style in CONTRIBUTING
The double parenthesis may trip up certain markdown viewers, and the
location of the wiki page has changed too.
2024-01-14 21:15:26 +00:00
Weng Xuetian
1fd5a6555e
inputmethod: Ensure InputPanelV1Window is always within the screen
Currently when input panel is using overlay mode and the cursor rectangle
is below or above the screen area, the input panel may be placed off the
screen. The change ensure it is always placed within the screen area
using similar math like xdg_popup's slide_y constrain.
2024-01-13 22:39:15 -08:00
l10n daemon script
4f512c6571 GIT_SILENT Sync po/docbooks with svn 2024-01-14 01:37:02 +00:00
Yifan Zhu
faab23e914 kcms/options: port to KCModule methods
Remove code that duplicates functionality of KCModule.

Previously the various config items were not fully ported to using
KCModule methods, and kept custom versions of isSaveNeeded and
isDefault. When called from KWinOptions::updateUnmanagedState, these
methods incorrectly reports that there are still changes to be saved.
This patch set ports all configs in window behavior to methods provided
by KCModule, solving the problem.

BUG: 477940
2024-01-13 10:04:52 -08:00
Ismael Asensio
3353ed87ef kcms/tabbox: Mock-up closeable role for previews
Fixes a qml warning and wrong representation when trying to
access this model property
2024-01-13 15:26:13 +01:00
Ismael Asensio
3572e6f0e7 kcms/tabbox: Add mock-up object for KWin.DesktopBackground
The window switcher previews don't use the actual quick components
the KWin plugin provides, but mock-up objects of those.

Add a mock-up component for `KWin.DesktopBackground`, which is just
a thumbnail of the desktop default image but stretched to cover the
whole parent size.

This fixes the previews for flip&cover window switchers.

BUG: 479552
FIXED-IN: 5.93.0
2024-01-13 15:26:13 +01:00
Xaver Hugl
c1e09f65c9 opengl/glshader: use gamma 2.2 for sRGB render targets
The sRGB global colordescription uses gamma 2.2, so this function also has to do
it, or the shader will end up doing a colorspace conversion where there shouldn't
be one.
This also meams that HDR content will be wrongly encoded, but fixing that while
also dealing with sRGB content correctly requires a lot more invasive changes, in
KWin and in the screenshot and screencast APIs.

BUG: 478967
2024-01-13 13:28:03 +00:00
Ismael Asensio
20bee00681 kcms/tabbox: Fix preview for show desktop option
Use the correct config option to decide whether to show the desktop
thumbnail on preview. "DesktopMode" refers to filter by desktop.
2024-01-13 13:32:50 +01:00
Alexander Lohnau
7d1db53f6b Remove unneeded includes from headers and cpp files 2024-01-13 11:34:45 +01:00
Alexander Lohnau
d8012cf00c decorationbridge: Slight code cleanup 2024-01-13 10:59:17 +01:00
l10n daemon script
24168aebdb GIT_SILENT Sync po/docbooks with svn 2024-01-13 01:27:27 +00:00
l10n daemon script
2a07aa238f 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"
2024-01-13 01:15:23 +00:00
Ismael Asensio
b08a4a1896 kcms/tabbox: Fix tabbox preview not getting dismissed
On X11 we would dismiss the tabbox preview when clicking outside
of the switcher. This doesn't work on Wayland because the popup
cannot globally grab the mouse and doesn't get notified.

Use `QEvent::FocusOut` instead which works on both platforms.

We also get rid of a warning message.

BUG: 374971
FIXED-IN: 5.93.0
2024-01-12 23:10:06 +01:00
Xaver Hugl
427ce522a2 opengl/glshader: print the shader source if compilation fails
The shader log is almost entirely useless without the source

CCBUG: 479279
2024-01-12 20:42:05 +00:00
Xaver Hugl
d4a3d6689e backends/drm: wait for the pageflip to be done with the condition variable
...instead of busy looping, which is causing several percent CPU usage in some cases

BUG: 479126
2024-01-12 19:15:25 +01:00