Commit graph

26204 commits

Author SHA1 Message Date
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
Xaver Hugl
56fc8f83ac backends/drm: don't call QThread::currentThread in a loop
We're always in the same thread, so there's no need to check it
2024-01-12 17:00:01 +01:00
Xaver Hugl
a89d1f8058 opengl/openglcontext: require support for RGBA16F framebuffers
It's effectively already required, this just checks it earlier
2024-01-12 15:19:25 +01:00
Vlad Zahorodnii
c59f385996 wayland: Fix handling of unminimization for not fully initialized xdg-toplevels
If setMinimized(false) is called for a not fully initialized
XdgToplevelWindow, we don't want to emit the windowShown signal.

BUG: 479234
2024-01-12 12:29:33 +00:00
Vlad Zahorodnii
1c15a6dd88 Fix software cursor stucking on old monitor
When the software cursor leaves an output, its RenderLayer is marked
as invisible and the area corresponding to the layer is scheduled to
be repainted in the output layer. However, the composite function only
checks whether the root RenderLayer needs a repaint, not the output
layer too.

BUG: 479668
2024-01-12 14:14:53 +02:00
Xaver Hugl
260bc0a61d input: remove the terminate server shortcut
Accidentally pressing any shortcut shouldn't take down the whole session.
If KWin isn't reponsive but can still process shortcuts for some reason,
you can still switch to a different virtual terminal to explicitly kill
it from there
2024-01-11 23:21:22 +00:00
Xaver Hugl
451b878bb9 backends/drm: don't allow implicit modifiers for multi gpu transfers
As we translate DRM_FORMAT_MOD_LINEAR to implicit modifiers + linear flag, the
egl import path should still work without implicit modifiers too.

BUG: 478921
2024-01-11 19:07:51 +00:00
Vlad Zahorodnii
36222adb25 scene: Fix software cursor clip region
The dirty region is in the output local coordinate space.

BUG: 479583
2024-01-11 18:10:04 +00:00
Vlad Zahorodnii
571e4026ac core: Add Output::rectF 2024-01-11 18:10:04 +00:00