Commit graph

4579 commits

Author SHA1 Message Date
Xaver Hugl
34aa734c7b plugins: use more std::unique_ptr 2022-11-15 15:28:37 +00:00
Xaver Hugl
738b04a364 libkwineffects: use more modern C++ 2022-11-15 15:28:37 +00:00
Xaver Hugl
0f3ae0216c kcmkwin/kwinscreenedges: use more modern C++ 2022-11-15 15:28:37 +00:00
Xaver Hugl
95599d2ffd ruleitem: use std::unique_ptr 2022-11-15 15:28:37 +00:00
Xaver Hugl
65e886cde2 backends/drm: support the panel orientation property 2022-11-15 13:25:19 +00:00
Vlad Zahorodnii
e58affc71b wayland: Make debug console placeable
Since the debug console has Qt.BypassWindowManagerHint flag set, it
won't be placed or ensured that it stays in the work area.

On the other hand, unlike X11, kwin won't have problems if the debug
console is managed on wayland.

BUG: 453920
2022-11-15 14:11:18 +02:00
l10n daemon script
16de8cf19c 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-11-15 01:52:24 +00:00
Aleix Pol
ecbe29640c screencast: Fix how we tell pipewire that the stream has been resized
We need to send sizes in a format that param buffers understand.
This fixes some glitches we'd see when sharing a window and resizing it.

Thanks Jan Grulich for pointing me in the right direction!

BUG: 461590
2022-11-14 13:40:13 +00:00
Xaver Hugl
5fd9871fa7 workspace: silence signed unsigned comparison warning 2022-11-13 14:32:16 +00:00
Xaver Hugl
704d1d639a qBound -> std::clamp 2022-11-13 14:32:16 +00:00
Xaver Hugl
d265535f9b qMin -> std::min 2022-11-13 14:32:16 +00:00
Xaver Hugl
b0b7c8b1d3 qMax -> std::max 2022-11-13 14:32:16 +00:00
Vlad Zahorodnii
f1f58a186d plugins/nightcolor: Add a todo note reminding to remove legacy shortcut 2022-11-13 14:24:54 +02:00
l10n daemon script
4cb06a3713 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-11-13 01:51:17 +00:00
Arjen Hiemstra
cd65515ea6 scene: Store renderTargetRect as QRectF
This allows the projection matrix calculation to properly calculate the
screen edges without losing bits due to earlier rounding.
2022-11-11 13:10:41 +00:00
Xaver Hugl
9130b947e0 backends/drm: generate modes even if some common modes are available
Some monitors claim to support some but not all common modes, despite the display
supporting them all.
2022-11-10 16:07:52 +00:00
Vlad Zahorodnii
f1e8ce9456 x11: Rename X11StandalonePlatform to X11StandaloneBackend 2022-11-10 16:21:00 +02:00
Vlad Zahorodnii
b830d408af core: Rename Platform to OutputBackend 2022-11-10 10:10:28 +02:00
Vlad Zahorodnii
72883df2aa core: Move workspace bits from Platform to Application
Platform will become OutputBackend so some workspace bits, e.g. the
effects handler, have to move a layer above.
2022-11-10 10:10:28 +02:00
Vlad Zahorodnii
f1369a40f9 core: Drop Platform::supportsNativeFence()
Use Scene::supportsNativeFence() directly.
2022-11-10 10:10:28 +02:00
Vlad Zahorodnii
4610aaf614 plugins/idletime: Adjust the poller to deprecation of simulateUserActivity()
Wrap the implementation of the simulateUserActivity() function in an
BUILD ifdef and make it noop since there are valid usecases in the real
world.
2022-11-10 07:27:20 +00:00
Vlad Zahorodnii
e91b621d53 x11: Stop requesting XCB_EVENT_MASK_COLOR_MAP_CHANGE
It's unused.
2022-11-09 11:52:14 +00:00
Vlad Zahorodnii
af39185a9a wayland: Avoid selecting unused X11 events
We don't use input events on Wayland so Xwayland doesn't need to report
them back to us.
2022-11-09 11:52:14 +00:00
Vlad Zahorodnii
9f345d4dd3 autotests: Fix remaining "using namespace KWayland::Client" 2022-11-08 23:15:17 +02:00
David Edmundson
dadfd7aec8 Drop isCompletelyOpaque optimisation
With the floating geometry this becomes a non-trivial check, at some
point this will cost more than the gl blend itself.
2022-11-08 15:04:48 +00:00
David Edmundson
bcd9f1e958 Provide SurfaceItem::shape as a floating vector
Our logical co-ordinates for shape can be floating. The shape is used to
determine final vertices on screen.

The commit appears to introduce some new loops but they're mostly what
QRegion would be doing internally so it shouldn't impact performance.
For most cases we just have a single rectangle in our shape anyway.

opaqueRegion is unchanged for now.
2022-11-08 15:04:48 +00:00
Zhiyi Zhang
68d1ee8f08 x11window: Don't send a final ConfigureNotify event in leaveInteractiveMoveResize()
With 74eb0d8, ConfigureNotify events are always sent when moving windows. It's no longer necessary
to send a final ConfigureNotify event after a window is moved.
2022-11-07 21:16:06 +08:00
Zhiyi Zhang
74eb0d861b x11window: Send ConfigureNotify events when moving windows
This removes the optimization that sends only one ConfigureNotify event after moving is completed.
However, other windows may depend on ConfigureNotify events to adjust their position in a timely
manner. For example, the shadow window surrounding the main login window of WeChat on Wine.

BUG: 449302
2022-11-07 16:11:23 +08:00
l10n daemon script
163c36595e 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-11-07 01:51:06 +00:00
Vlad Zahorodnii
5762b9a4cc core: Drop Platform::supportsGammaControl()
If the platform doesn't support setting gamma ramps, let the request
fail. In long term, we need a software fallback too so this property is
not that relevant.
2022-11-05 09:03:39 +00:00
Vlad Zahorodnii
084f92bd7a backends/x11: Make OverlayWindow factory function private to the backend
The concept of an overlay window is specific to X11 and it's not present
on other platforms.
2022-11-05 08:44:58 +00:00
Vlad Zahorodnii
1f7bfc7902 backends/x11: Move OverlayWindow handling to standalone backend 2022-11-05 08:44:58 +00:00
Aki Sakurai
62af17617f Screencast: Fix inverted screencast on OpenGLES and memfd
The output of glReadPixels is in inverted when GLTexture is not inverterd.
2022-11-04 23:19:42 +00:00
Marco Martin
a8d0d7f8a5 Option for WindowHeap to not alter the layout
Bring back the DesktopGrid option to not alter window position
so that the grid look like perfect screenshots of each desktop

BUG:455350
2022-11-04 12:15:50 +01:00
Vlad Zahorodnii
432d1f9d31 Remove unused include 2022-11-03 20:30:06 +02:00
Vlad Zahorodnii
af0d39c118 Remove some commented out code 2022-11-03 17:55:46 +00:00
Aleix Pol
fee348d147 buttonrebindsfilter: Add bracesbuttonrebindsfilter: Add braces 2022-11-03 16:41:44 +01:00
Aleix Pol
baac63ca13 buttonrebinds: Fix infinite loops with RebindScope
This way it's possible to assign A to B and B to A (i.e. swap buttons)
without getting it crash in your face.
2022-11-03 16:41:44 +01:00
Aleix Pol
6bcedf3aad buttonrebinds: Allow sending tablet tool button events
Makes it possible to trigger button events from your tablet tool.
2022-11-03 16:41:44 +01:00
Aleix Pol
609065528e buttonrebinds: Allow configuring tablet tool rebinds
Makes it possible to assign an action to one of the tablet tool buttons.
2022-11-03 16:39:53 +01:00
Aleix Pol
d0da1cf751 buttonrebinds: Allow binding mouse button actions
Makes it possible to assign a pointer button event as the trigger to a
button rebind. This would make it possible to make a mouse click the
outcome of such actions.
2022-11-03 16:39:53 +01:00
Vlad Zahorodnii
d257da0a00 Use StrutRects to represent restricted areas
This saves us some StrutRects -> QRegion conversions and it might be
useful for floating point struts.
2022-11-03 13:53:41 +00:00
Vlad Zahorodnii
78ed1e2add Move OpenGL safe point handling to Compositor/CompositorX11
It's not something that output backends care about, so move it to
Compositor.
2022-11-03 12:09:16 +00:00
Vlad Zahorodnii
364c2f3a14 Drop Platform::requiresCompositing()
It doesn't seem to be used elsewhere other than
Options::isUseCompositing(), which is quite X11-specific.
2022-11-03 12:09:16 +00:00
Vlad Zahorodnii
632c3508a7 build: Move libkwineffects specific ecm_setup_qtplugin_macro_names to src/libkwineffects 2022-11-03 11:46:41 +00:00
Vlad Zahorodnii
c76563b174 core: Drop Platform::warpPointer()
It's odd to manipulate host cursor position and it's not highly
important, for example we haven't had a need to warp the cursor on
wayland.

The main motivation behind this change is to slim down the Platform to
make it more output oriented.
2022-11-03 10:35:30 +00:00
l10n daemon script
0c1f5c20e0 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-11-03 01:54:29 +00:00
Aleix Pol
6ab6d3124a screencasting: Make sure we are reporting properly scaled damage values
It should be in stream pixels rather than logical
2022-11-02 20:18:27 +01:00
Aleix Pol
ea4741cbcc screencasting: Polish region case
- By scaling: make sure we are scaling by the feed size rather than the
output size, which is irrelevant in this case.
- By positioning: properly position the outputs on the feed if the feed
scale is != 1
2022-11-02 20:18:27 +01:00
Aleix Pol
eb7f93002c screencasting: No need to keep calculating the textureSize 2022-11-02 20:18:27 +01:00
Xaver Hugl
d5a2c639a0 window: fix checkWorkspacePosition moveRight/Bottom
With QRectF, moveRight and moveBottom have an effective offset of 1 vs QRect
2022-11-02 17:58:29 +00:00
Xaver Hugl
264ecf40f8 placementtracker: fix some windows not being restored
If a window was moved by the user, it got effectively blacklisted from being
ever restored again. Instead of only tracking the last restore point, compare the
current window state with the state it had when the output configuration was last
seen. If either that or the last restore point match the window, restore the old
window state.
2022-11-02 17:58:29 +00:00
Xaver Hugl
84635c71ec plugins/screencast: centralize format querying into the RenderBackend
BUG: 460563
2022-11-02 17:10:10 +01:00
Vlad Zahorodnii
e73fedf2ae x11: Use moveResizeGeometry() instead of frameGeometry() where appropriate 2022-11-02 11:00:03 +00:00
Vlad Zahorodnii
a235cd6d26 build: Hardcode kwin name
We use KWIN_NAME, KWIN_INTERNAL_NAME_X11 and KWIN_INTERNAL_WAYLAND
properly only in a few places. In other, we use hardcoded names.

Let's not bother and hardcode kwin names everywhere rather than have one
foot in and one foot out, it's simpler.
2022-11-02 10:21:23 +00:00
Vlad Zahorodnii
1801421080 Forward declare Xkb in keyboard_input.h 2022-11-02 09:21:55 +00:00
Vlad Zahorodnii
391c777936 Remove unused keyboard_input.h include 2022-11-02 09:21:55 +00:00
l10n daemon script
33825b2e0a 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-11-02 02:00:07 +00:00
Nicolas Fella
3eb9106466 Expose enabledByDefault of input device to DBus 2022-11-01 18:21:42 +00:00
Vlad Zahorodnii
89607dfebd qAsConst -> std::as_const
We started using std::as_const() in some parts of kwin, so let's use it
everywhere for the code consistency sake.
2022-11-01 16:52:01 +02:00
l10n daemon script
2f7c77af18 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-11-01 01:53:35 +00:00
Weng Xuetian
fda53d8253 Fix blur/contrast for X11 window if Xwayland is not scaled.
X property from X11 window contains X native coordinates. Need to
apply transform to use them in the effects like blur/contrast.

BUG:461021
2022-10-31 22:42:10 +00:00
Xaver Hugl
9fd260c3c9 backends/drm: add logging for adding GPUs
We already log when a GPU gets removed, it only makes sense to also log
when it got added
2022-10-31 20:46:51 +00:00
Nicolas Fella
251e211c5b [effects/windowview] Don't allow setting non-global shortcuts
Only global shotcuts make sense here
2022-10-31 19:46:15 +00:00
Vlad Zahorodnii
29188eb7b2 Move InputDevice::{outputName,setOutputName} implementation to cpp file
Removes the need for Q_UNUSED macro.
2022-10-31 19:07:30 +00:00
Xaver Hugl
b5873ef792 backends/drm: fixes for bitmask drm properties 2022-10-31 17:05:26 +00:00
Xaver Hugl
420358709a backends/drm: don't test hardware rotation if not supported by the driver 2022-10-31 17:05:26 +00:00
Vlad Zahorodnii
d7b710a9a1 Fix -Wunused-variable warnings 2022-10-31 15:50:37 +00:00
Vlad Zahorodnii
7fffe99328 build: Add -Wno-unused-parameter compiler option
Due to being a compositor, kwin has to conform to some certain
interfaces. It means a lot of virtual functions and function tables to
integrate with C APIs. Naturally, we not always want to use every
argument in such functions.

Since we get -Wunused-parameter from -Wall, we have to plumb those
unused arguments in order to suppress compiler warnings at the moment.

However, I don't think that extra work is worth it. We cannot change or
alter prototypes in any way to fix the warning the desired way. Q_UNUSED
and similar macros are not good indicators of whether an argument is
used too, we tend to overlook putting or removing those macros. I've
also noticed that Q_UNUSED are not used to guide us with the removal no
longer needed parameters.

Therefore, I think it's worth adding -Wno-unused-parameter compiler
option to stop the compiler producing warnings about unused parameters.
It changes nothing except that we don't need to put Q_UNUSED anymore,
which can be really cumbersome sometimes. Note that it doesn't affect
unused variables, you'll still get a -Wunused-variable compiler warning
if a variable is unused.
2022-10-31 15:50:37 +00:00
Xaver Hugl
c308a262be kcmkwin/compositing: remove tearing prevention and scaling options
The option are confusing and noone should ever need to touch them.

BUG: 450279
2022-10-31 14:43:54 +00:00
Nicolas Fella
378006cc73 [effects/overview] Don't allow setting non-global shortcuts
Only global shotcuts make sense here
2022-10-31 13:28:15 +00:00
Xaver Hugl
3f3d41f259 backends/drm: fix common mode generation
There were overflows in the bandwidth estimation calculation. To simplify things,
also only generate common modes if the display doesn't advertise them on its own
already.
2022-10-31 12:49:25 +00:00
Aleix Pol
f649363a4e Address warnings
|-operator on bool
Comparison on technically different enums.
2022-10-31 12:23:06 +00:00
Albert Astals Cid
a9f5b56804 Make gettext happier
Seems we can't have a plural with an argument in singular and not in the
plural

a format specification for argument 2, as in 'msgstr[0]', doesn't exist in 'msgid_plural'
msgfmt: found 1 fatal error
2022-10-31 08:17:11 +00:00
l10n daemon script
365dfaa4c0 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-10-31 01:53:33 +00:00
Aleix Pol
8417492781 Include org.freedesktop.locale1 support
Makes it possible to follow the dbus service for locale configuration,
making it possible to have third parties integrate with Plasma.

This is done opt-in for now, it can be adopted generally in the future,
if necessary.
2022-10-30 23:03:55 +01:00
Yunus Erdem Ergül
96cfc411f0 scripting: Expose cursor position to the API
Added cursorPos property and cursorPosChanged signal to WorkspaceWrapper
2022-10-30 10:34:05 +00:00
Aleix Pol
47c3c2d143 libinput: Support switching the targetted output with a shortcut
I was told it's how artists are used to using these tablets so it makes
sense to support the workflow.
2022-10-29 22:30:03 +00:00
Aleix Pol
77c5198dc8 libinput: Allow setting an empty output name
For tablets, it signifies "follow the active output".
2022-10-29 22:30:03 +00:00
Aleix Pol
a11681918a OSD: Fix OSD::show from the non-main thread
If it's issued from a different thread, pass it to the main one so it's
eventually displayed.
Otherwise, it would just crash kwin.
2022-10-29 22:30:03 +00:00
l10n daemon script
ef60c8e53c 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-10-29 01:52:40 +00:00
Xaver Hugl
b3d0698126 backends/drm: rewrite most of EglGbmLayerSurface
This rewrite ensures that
- formats are tested for multi-gpu transfer
- dmabuf with either 10bpc or 8bpc buffers are preferred to cpu copy
- formats where drmModeAddFB2 fails are skipped
2022-10-28 16:09:10 +02:00
Xaver Hugl
cd6a219961 backends/drm: make the buffer target constant
There's no reason for it to be dynamic
2022-10-28 16:09:10 +02:00
Xaver Hugl
228575f0ae backends/drm: store creation flags in GbmBuffer 2022-10-28 16:09:10 +02:00
Kai Uwe Broulik
0902d91a42 nightcolormanager: Emit timing change only when they have actually changed
Avoids pointless DBus traffic.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-10-28 11:43:46 +00:00
Vlad Zahorodnii
d89feb33b2 Remove some Q_UNUSED
It's weird to wrap a return value in Q_UNUSED macro.
2022-10-28 09:40:08 +00:00
Vlad Zahorodnii
57eb60122b Make Atoms code more readable
It improves readability by making calling getReply() explicit.
2022-10-28 09:40:08 +00:00
Vlad Zahorodnii
b30e81cb22 x11: Keep compositing mode untouched if kwin crashes
kwin can crash for reasons that have nothing to do with compositing. If
that's the case, after two crashes compositing will be permanently
disabled and you would need to go to system settings to reenable it, the
timestamp based check in the x11 backend won't be effective.

CCBUG: 452344
2022-10-28 09:38:38 +00:00
Vlad Zahorodnii
fd978838cc qpa: Geometry handling fixes
We don't need to emit {x,y,width,height}Changed signals ourselves. We
also need to send an expose event otherwise the window can be rendered
incorrectly if it's resized. The logic follows QtWayland implementation.
2022-10-28 08:47:48 +00:00
Vlad Zahorodnii
9774eacbbe Remove ServiceTypes info
Binary plugins don't need it. KPackage packages have "KPackageStructure"
property instead.
2022-10-28 06:58:44 +00:00
Vlad Zahorodnii
61644305f0 wayland: Drop unused field in XdgOutputManagerV1Interface 2022-10-27 11:57:52 +00:00
Vlad Zahorodnii
0c34957625 wayland: Hide XdgOutputV1Interface class
With the pull approach, the XdgOutputV1Interface class doesn't have to
be exposed in the public api and can be made private to simplify the
implementation of the xdg-output-v1 protocol.
2022-10-27 11:57:52 +00:00
Vlad Zahorodnii
b40d76d35c wayland: Prevent matching dnd actions after drop
Currently, kwin will continue matching dnd actions after a drop. This is
mainly needed in order to make "ask" action work.

However, it appears like there are clients in the wild that update offer
actions after receiving wl_data_source.dnd_drop_performed and wl_data_device.drop
events.

One could argue that's a client bug, and perhaps it is, but the spec is
vague about that. In meanwhile, let's make sure that dnd action matching
is active after drop only when the selected data source action is "ask."
2022-10-27 11:03:06 +00:00
Łukasz Patron
a9acef8573 x11: Don't force QT_QPA_PLATFORM=xcb
This is basically a cherry pick of 77ec43d5e (Don't force
QT_QPA_PLATFORM=wayland), except for X11.
2022-10-27 08:03:59 +00:00
Łukasz Patron
c2b4f03f96 x11: Don't force QT_NO_GLIB=1
This breaks certain apps, e.g. KDE System Settings when launched from
overview effect.

BUG: 460980
2022-10-27 08:03:59 +00:00
Vlad Zahorodnii
a9833dc9dd scripting: Prefer metadata.json over metadata.desktop in GenericScriptedConfig
KPluginMetaData in KF 6 doesn't load desktop files anymore. It means
that plasma packages need to come with json metadata files.

This change adjusts the generic scripted config loader so it can load
configuration even for packages with no metadata.desktop files.
2022-10-27 07:35:36 +00:00
l10n daemon script
109bdf8f42 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-10-27 01:50:21 +00:00
Xaver Hugl
2997fb24bb x11window: revert more from 3a28c02f
BUG: 461032
2022-10-26 23:17:36 +00:00
Xaver Hugl
1dcbc3c6f8 backends/drm: fix format sorting
As the drm format number of 10 bit colors is lower, the fallback sorting
preferred those formats, even if KWIN_DRM_PREFER_COLOR_DEPTH=24 was set.
To fix that, prefer 8 bit colors over something random.
2022-10-26 18:46:13 +00:00
Vlad Zahorodnii
8fa1883cd9 effects/invert: Make it fully responsible for inverting the screen
The X11 standalone backend has an obscure fallback to hw screen
inversion if compositing is disabled. While it's great, it conflicts
with existing features such as night color.

In order to make code cleaner and clean up dependencies, this change
moves screen inversion shortcut to the invert effect. While it can
potentially affect users that don't use compositing, I think the number
of such affected people is very small.

In hindsight, preferring hw over sw transform is nice, but I think we
need to analyze it first and then come up with a proper solution that
integrates with color management and works great both on x11 and wayland.
2022-10-26 18:18:36 +03:00
Vlad Zahorodnii
b18c6a4c52 backends/virtual: Drop VirtualBackend::captureOutput()
It's unused. Bring it back when there are usecases.
2022-10-26 14:08:38 +00:00
Arjen Hiemstra
11dc73c6ce effectshandler: Reset iterators when active effects changes
Clearing and resizing m_activeEffects invalidates iterators, so we need
to ensure we reset any iterators that were stored.
2022-10-26 11:50:57 +00:00
Arjen Hiemstra
4c8fd4b8ca OffscreenEffect: Use drawWindow instead of renderWindow when rendering contents
renderWindow bypasses all other effects and simply calls the code that
is responsible for the final render of the window. This means that any
effects that are active on the window are skipped, including things that
may change how the window is rendered like the invert effect. To fix
that, ensure we render the window with all effects applied.

BUG: 459417
2022-10-26 11:50:57 +00:00
Xaver Hugl
580396e377 x11window: partially revert 3a28c02f
In some cases it can cause rather than fix problems with maximization
2022-10-26 12:37:36 +02:00
Xaver Hugl
f6d14f1b44 effects/kscreen: don't stop effect when fade out animation is done
The screen needs to stay black until it gets enabled again, otherwise
slight timing differences can cause the screen to turn on full brightness
again immediately before turning off.

BUG: 460902
2022-10-26 11:52:03 +02:00
Vlad Zahorodnii
a4cb0e7fd8 Forward declare QAction in src/input.h 2022-10-26 07:04:47 +00:00
Vlad Zahorodnii
daa351a398 Remove KGlobalAccel bits from Platform
With the addition of KGlobalAccel::globalShortcutActiveChanged(),
there's a way to monitor all triggered actions without adding any
boilerplate code.

This change removes the KGlobalAccel bits from the Platform class. This
reduces the amount of boilerplate code; currently we need to be careful
about ensuring that Platform::setupActionForKGlobalAccel() is called.
Another reason behind this change is to simplify the api of Platform and
remove things that don't have anything to do with outputs.
2022-10-26 07:04:47 +00:00
l10n daemon script
fcc0b10fee 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-10-26 01:51:34 +00:00
Nicolas Fella
56c2afc749 Bump PlasmaWindowManagement version to 16
Needed for resource name
2022-10-25 15:52:19 +02:00
Vlad Zahorodnii
3de852cd4f wayland: Drop DataDeviceInterface::updateProxy()
It's unused.
2022-10-25 11:13:14 +00:00
Arjen Hiemstra
b637785f49 Replace some manual floored QPointF->QPoint conversion with flooredPoint calls 2022-10-25 08:44:05 +00:00
Arjen Hiemstra
88bc25b376 DecorationInputFilter: Use QPointF instead of QPoint for events
`QMouseEvent::globalPos()` returns QPoint rather than QPointF, which
internally rounds the screen position. This can result in mouse
positions that are outside the screen, leading to problems. Since
screenPos() seems to be the same, use that so we get a QPointF instead.
Additionally, apply similar changes to the other events.
2022-10-25 08:44:05 +00:00
Arjen Hiemstra
6ef2cdc332 Window: Floor rather than round when doing hitTest for the decoration
Otherwise we may end up with coordinates that are outside the decoration
and inadvertantly failing the hittest.

BUG: 460686
2022-10-25 08:44:05 +00:00
Arjen Hiemstra
2f900d84ab Add a helper function to convert QPointF to QPoint using floor instead of round
In a bunch of cases, we want to floor when converting to QPoint rather
than rounding. As it gets tedious to repeat the same code over and over,
add a helper function.
2022-10-25 08:44:05 +00:00
John Brooks
a1191bea18 wayland: Fix missing relative motion events
Use isNull on QSizeF to check for a zero delta instead of comparing it
with a default-constructed QSizeF, which in practice initializes to
(-1.0,-1.0). This caused relative motion events to be omitted if the
delta happened to be equal to (-1.0,-1.0), causing mouse jumping in some
applications.

BUG: 444510

Signed-off-by: John Brooks <john@fastquake.com>
2022-10-25 08:18:45 +00:00
Weng Xuetian
84f54e9ffa Implement a enableRequested signal for text-input-v3
The signal will be emitted if text-input-v3 applies a new enable state
if it's already enabled.

In Gtk's implementation, sending text_input_v3.enable for the second
time has the similar semantics of text-input-v2.showInputPanel. Try to
connect them together and add corresponding test.

See also: a95cfb1c45/gtk/gtkimcontextwayland.c (L555)
2022-10-25 04:34:26 +00:00
jrv ezg
7f7fa69135 kcmkwin/kwindecoration: use Kirigami.ActionToolBar for the footer actions
This way, the footer actions collapse into a menu when there's not enough space
to show them all, instead of being cut off.

BUG: 460793
FIXED-IN: 5.26.2
2022-10-25 02:37:45 +00:00
l10n daemon script
ff3f5d8596 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-10-25 01:47:08 +00:00
Xaver Hugl
314b5327b6 inputpanelv1window: never hide overlay panels
Hiding them never makes sense, and the protocol specifies that the show
and hide requests are about virtual keyboards, not about overlay planels.
2022-10-24 10:53:57 +00:00
Xaver Hugl
f43c39879d inputmethod: reset m_shouldShowPanel when the tracked window changes 2022-10-24 10:53:57 +00:00
Xaver Hugl
75806ecff5 inputpanelv1window: show window when client maps it after setting the mode
BUG: 460537
2022-10-24 10:53:57 +00:00
Vlad Zahorodnii
5a227bf69d Make Compositor responsible for locking compositing type
It's something that Compositor cares, not necessarily the output backend.
2022-10-24 08:02:27 +00:00
l10n daemon script
c67660b0fa 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-10-24 01:51:05 +00:00
Xaver Hugl
3a28c02f28 x11window: don't change size for centering windows with maximization 2022-10-23 20:06:38 +00:00
Xaver Hugl
ceae717500 output: don't round geometry as often
CCBUG: 459373
2022-10-23 20:06:38 +00:00
l10n daemon script
2ecb57b713 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-10-23 01:43:00 +00:00
Vlad Zahorodnii
7c74b7de4a decorations/plastik: Provide metadata.json instead of metadata.desktop 2022-10-22 16:26:23 +00:00
Vlad Zahorodnii
2121ed72be Use correct text encoding when reading WM_CLASS, WM_NAME and WM_WINDOW_ROLE
All these properties have XCB_ATOM_STRING type. From the ICCCM spec
[2.7.1]

    STRING as a type or a target specifies the ISO Latin-1 character
    set plus the control characters TAB (octal 11) and NEWLINE (octal 12).
2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
13d88081d3 Change type of Window.wmCommand and Window.wmClientMachine to QString 2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
adbcb6a1a0 Change type of Window.desktopFileName to QString 2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
aa838e1c02 Change type of Window.resourceName, Window.resourceClass, and Window.windowRole to QString
testDbusInterface fails with Qt 6 build because QCOMPARE detects the
type difference between QString and QByteArray.

Since these properties being byte arrays has caused reasonable amount of
discomfort, let's make them QStrings. It will fix the test and make some
scripted effect code more cleaner.
2022-10-22 13:38:36 +00:00
Volker Krause
346ac6f32b Add Qt 6 FreeBSD CI 2022-10-22 12:34:49 +00:00
Vlad Zahorodnii
f19957bdb2 autotests: Fix testWaylandSeat in Qt 6 build 2022-10-22 15:01:17 +03:00
Vlad Zahorodnii
e665c1c80a autotests: Fix testPointerConstraintsInterface with Qt 6 build
QTEST panics because of type difference (qsizetype vs int).
2022-10-22 11:12:52 +00:00
l10n daemon script
aebbce2f38 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-10-22 10:42:50 +00:00
l10n daemon script
1282d5e331 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-10-22 01:43:48 +00:00
Volker Krause
0ce90f4335 Add Qt 6 Linux CI
The CI now has the ability to limit the passing unit test requirements
to more specific platform configurations, so the not yet working Qt 6
unit tests shouldn't block this anymore.
2022-10-21 20:25:10 +00:00
Weng Xuetian
90df07157b Fix potential race condition when text input state change and focus change happened at the same time
In some cases, stateCommitted may fire after a new surface being focused
and in correctly set input method to be inactive. This can be reproduced
by switch client between an active text input v3 client and text input
v2 client.
2022-10-21 19:14:41 +00:00
Xaver Hugl
a587e426f8 add autotest for the drm platform 2022-10-21 17:54:55 +02:00
Arjen Hiemstra
85d46016a2 If SurfaceItem does not have a pixmap, return an empty WindowQuadList
Otherwise the caller needs to ensure that we're not calling on an item
without pixmap and if we don't, things crash.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
bb7f627acc Introduce RenderGeometry class and use it for clipping in device coordinates
RenderGeometry is a list of vertices that should be rendered. It's
needed so we can convert WindowQuadList to device coordinates and do
clipping in device coordinates. The intention is also to use it to
replace arbitrary float arrays in effects eventually.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
250d271b26 Add WindowQuad::bounds() as a convenience method to get a QRectF from it 2022-10-21 14:49:22 +00:00
Arjen Hiemstra
2ad497c8f9 Round buffer positions when calculating normalised UV coordinates
Otherwise we end up with UVs that are slightly off as the position is
fractional while the size is integer.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
64e42bbd04 Round window and geometry positions in OpenGL scene
This rounds the position of geometry in the OpenGL scene, which means
things that are fractionally scaled and end up between pixel boundaries
are instead aligned to pixels. This doesn't fully solve the fractional
scaling blurriness, as we still need the application to provide a buffer
with the correct size. If we do have a buffer with the correct size, we
will now render properly aligned. For example, internal clients should
now be correct.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
b8b9236ec4 Add "roundVector" function as convenience for rounding a QVector2D
Otherwise we constantly need to construct and deconstruct vectors.
2022-10-21 14:49:22 +00:00
Xaver Hugl
49ad013295 backends/drm: remove Wayland bits for drm leasing 2022-10-21 13:33:42 +02:00
Mouse Zhang
fcaf0cad9e effects/backgroundcontrast: Fix backgroundcontrast stripes when rounded window scaling 2022-10-21 10:01:17 +00:00
Mouse Zhang
8468eeafdd effects/blur: Fix blur stripes when rounded window scaling
BUG: 460412
2022-10-21 10:01:17 +00:00
l10n daemon script
c57b3750e7 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-10-21 01:56:05 +00:00
Volker Krause
3a4b8f65ce Don't rely on implicit 2D to 3D vector conversion
That is explicit with Qt 6.
2022-10-20 20:00:52 +00:00
Xaver Hugl
ed8d696698 backends/drm: use #pragma 2022-10-20 21:10:46 +02:00
Xaver Hugl
629a32a802 backends/drm: rename drm object files 2022-10-20 21:08:51 +02:00
ivan tkachenko
e489ad9a16
UserActionsMenu: Add "Move &To Current Desktop" action from task manager for X11
Task Manager has this option, so let's keep them consistent.
Surprisingly, when a window is set to "All Desktops", choosing "All
Desktops" again clears that flag, i.e. sets the window back to only
single desktop. But it is not intuitive at all. So let's have this
separate action to pin a window to current desktop.

Note: Wayland allows for multiple but not all desktops to be assigned to
a window, so it works differently there. Should we have a similar
option there too?

BUG: 458415
2022-10-20 17:08:09 +03:00
ivan tkachenko
d477b31842
UserActionsMenu: Remove duplicated code block 2022-10-20 17:08:07 +03:00
Vlad Zahorodnii
624886f0de wayland: Drop ScopedGlobalPointer 2022-10-20 12:27:51 +00:00
Vlad Zahorodnii
7115ea75a4 Drop WaylandOutput 2022-10-20 12:27:51 +00:00
Vlad Zahorodnii
c3f970b3c3 wayland: Make XdgOutputV1Interface pull information from Output 2022-10-20 12:27:51 +00:00
Xaver Hugl
e9e97e49bf backends/drm: set drm content type when available 2022-10-20 13:46:58 +02:00
Xaver Hugl
b99ae81b08 wayland: implement the content-type protocol 2022-10-20 13:46:58 +02:00
Vlad Zahorodnii
f0376367b1 Add explicit POSITION_INDEPENDENT_CODE 2022-10-20 09:37:00 +00:00
Vlad Zahorodnii
de3aa69c1e Fix some tests not building with Qt 6
Client-side wrappers for input-method-unstable-v1 fail to build because
wl_keyboard_interface is referenced in the header file generated by
wayland-scanner.

Unfortunately, qt6_generate_wayland_protocol_client_sources() forces
--include-core-only argument, this is addressed in Qt 6.4.1, but in
meanwhile let's ship a copy of Qt6WaylandClientMacros.cmake file until
the required Qt version is out.
2022-10-20 09:37:00 +00:00
Arjen Hiemstra
cc4787500d Allow specifying a render target scale for windows
This allows overriding the render target scale when rendering windows
and makes use of it in the screencasting plugin.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ec6b9ed67e Convert WindowPaintData's translation to device coordinates when rendering
Otherwise we're using a translation in logical coordinates as a
translation in device coordinates, which means we're not translating
enough.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ada87dbc60 Properly scale cursordelegate_opengl to device geometry
Rather than converting to logical to then later on convert back to
device.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
642bd06cef glide: Convert to device coordinates when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
40e7dadbfe offscreeneffect: Convert to device coordinates when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
154dd33857 touchpoints: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
0133de12c3 zoom: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
9e7a7afccc snaphelper: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
846f612fcc trackmouse: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
8d93ef0221 screencast: Account for output scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
dea0383719 mousemark: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
b730308e2f mouseclick: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
cb093bfae4 screenedge: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
f791eb8fa7 screenshot: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
239bbf93f4 magnifier: Account for output scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
6cfeb3e3e8 Require GLTexture::render() to provide an output scale
This ensures we render the texture at the right scale while providing
geometry information in logical coordinates.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
74ff3bf082 Account for render target scale when rendering a WindowThumbnailItem
Otherwise we get too large and cut off window thumbnails.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
5a85ecd8c4 Convert to device pixels when rendering an offscreen quick view
Rendering a texture needs to be done in device pixels, not logical
pixels.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
8a69432d76 EffectsHandler: Use QRectF for mapToRenderTarget 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
2609458c8b screentransform: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
78d2c1f7e0 showpaint: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
5ab9008ca6 blur: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
9b28744de0 backgroundcontrast: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
822e6da569 Use a perspective matrix again for the Glide and Sheet effects
Since we now use an orthographic matrix as main projection matrix, the
glide and sheet effects don't really work as intended anymore. To fix
that, copy over the old perspective matrix and use that as base rather
than the current orthographic matrix.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
6ae32076f8 Use device coordinates for geometry in the OpenGL Scene
It is quite a bit easier to reason about the conversion to device
coordinates when we actually have code that does that, instead of
implicitly assuming OpenGL handles it. Additionally, it means we don't
need to convert back to logical coordinates again when we're rounding
pixel values.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ebc5a6c638 Add scaledRect as a helper function to scale a QRectF by a scalar
I have no idea why QRectF doesn't have this...
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
3922f468b4 Only recalculate renderTargetMatrix if it is needed
If there's no changes then there's no need to recalculate the projection
matrix.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
695cc7c010 Use an orthographic projection matrix for rendering the scene
Rather than a perspective matrix, which is rather unexpected when coming
from something like QtQuick. Generally, when doing 2D you want an
orthographic matrix so Z values do not matter.

Apparently this was originally done for 3D effects, but there are only
two of those remaining (glide and sheet) and for those, the effects
themselves can set up a perspective projection matrix.
2022-10-20 08:20:51 +00:00
Vlad Zahorodnii
085e44cdf9 scripts: Convert desktop metadata files to json metadata files 2022-10-20 07:12:31 +00:00
Vlad Zahorodnii
acc2336833 effects: Convert desktop metadata files to json metadata files 2022-10-20 07:12:31 +00:00
Vlad Zahorodnii
0c28de5b42 wayland: Add support for ext-idle-notify-v1
Wayland protocols MR: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
2022-10-20 06:36:58 +00:00
Vlad Zahorodnii
28c19c8215 wayland: Make output subpixel info static
subpixel info cannot change.
2022-10-20 06:18:30 +00:00
Vlad Zahorodnii
146bed14bc wayland: Make OutputInterface pull information from Output
It's a necessary step towards killing src/waylandoutput.{h,cpp}. Besides
that, it makes OutputInterface more reusable and less error prone.
2022-10-20 06:18:30 +00:00
l10n daemon script
665b7bb989 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-10-20 02:05:10 +00:00
Nicolas Fella
f3471293bf [desktopchangedosd] Port from KQuickControlsAddons.QIconItem to PlasmaCore.IconItem 2022-10-19 19:51:04 +00:00
Vlad Zahorodnii
187f556f85 Drop Screens 2022-10-19 13:29:39 +00:00
Nicolas Fella
9cf60224e6 [aurorae] Port from KQuickControlsAddons.QIconItem to PlasmaCore.IconItem 2022-10-19 11:55:23 +00:00
Gabriel Karlsson
02145bddce Fix wording in action 'Switch to Screen'
This erroneous "Window" instead of "Switch" apparently broke stuff.

The issue was pointed out on Reddit here: [https://www.reddit.com/r/kde/comments/y78qps/comment/istrj6t/](https://www.reddit.com/r/kde/comments/y78qps/comment/istrj6t/)
2022-10-19 05:33:11 +00:00
Xaver Hugl
850ae0cfe9 backends/drm: don't crash if connector has no modes 2022-10-18 11:21:45 +00:00
David Edmundson
50b4e988a4 [windowthumbnails] Guard against software QtQuick backend
If we are using the software renderer
QQuickWindow::createTextureFromNativeObject returns null. We already
checking for kwin using GL compositing so we can expand to check
QtQuick's usage.
2022-10-18 08:19:20 +00:00
Vlad Zahorodnii
1a87e9c9ac effects: Make WindowHeap try to fill gaps 2022-10-18 07:03:32 +00:00
Aleix Pol
212a19da38 screencast: Don't report damage on the full screen every time
I think this was added as a debug measure and we (I) forgot to remove
it.
While at it, make sure we always send the damage on the cursor changes.
2022-10-17 15:03:01 +00:00
David Edmundson
1df10c3518 Handle scale override in locked and confined pointers
BUG: 460532
2022-10-17 13:40:03 +01:00
David Edmundson
dae7d738a3 Move installPointerConstraint calls into the constraint handlers 2022-10-17 13:36:56 +01:00
David Edmundson
a43ef8ac91 Guard against reconfiguring wayland specific input on X11
reconfigure is hooked up to a config watcher that is applicable on X11
and wayland.

A runtime check is added to reconfigure, if we're not initialised we
have nothing to reconfigure. initialise calls reconfigure at the end of
the method.
2022-10-17 10:00:10 +00:00
Vlad Zahorodnii
28899df485 Make Workspace::outputAt() more robust to extreme values
Since QPointF can have values that exceed INT_MAX, "distance <
minDistance" may not be triggered for the first output.

In order to make Workspace::outputAt() more robust to such extreme
cases, this patch changes the type of minDistance from int to qreal to
avoid truncation and adds an explicit check to initialize bestOutput
when we see the first workspace output.

It would be also great to add size hints sanitization code in kwin, but
it can be done later.

BUG: 460446

---

Should close:

* https://errors-eval.kde.org/organizations/kde/issues/321
* https://errors-eval.kde.org/organizations/kde/issues/341
2022-10-17 09:34:20 +00:00
Vlad Zahorodnii
207e78386a Fix resizing by dragging top-right window corner
The top-right corner case was overlooked when switching from QRect to
QRectF, which results in the window having wrong size.

BUG: 460501
2022-10-17 08:07:26 +00:00
l10n daemon script
0f8ec3fcd2 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-10-17 01:50:44 +00:00
Aleix Pol
d454a2981c Prefer invokeMethod on a function pointer
Rather than a char* that needs lookup at runtime.
2022-10-16 22:44:24 +00:00
l10n daemon script
babbf00578 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-10-16 01:57:21 +00:00
Albert Astals Cid
19694fb046 Future proof the code for C++20
warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
2022-10-14 13:30:24 +00:00
Vlad Zahorodnii
186ef5e588 wayland: Fix handling of removed outputs in DpmsInterface
If an output is removed, its handle is invalid, which can lead to a
crash.
2022-10-14 14:53:42 +03:00
Vlad Zahorodnii
71bcbf852e wayland: Sync output device's enabled property
The output can be already disabled when the output device is created.

BUG: 460247
2022-10-14 09:28:52 +00:00
Vlad Zahorodnii
f2df2aa0e1 effects/blur: Fix clipping when sliding virtual desktops
When the slide effect paints a virtual desktop, it translates both
windows and the clip region.

Since the clip region slides too, the blur effect needs to be careful.

At the moment, the blur effect computes the blur region as follows:

- get the value of the blur region hint from client, map it to the
  global coordinate space, and intersect it with the clip region
- apply translation and scale to the blur region
- pass the blur region to doBlur()

However, the translation transform must be applied before intersecting
the blur region with the clip region.

BUG: 460382
2022-10-14 10:17:55 +03:00
Vlad Zahorodnii
c56517eccc backends/drm: Fix leaving dangling dpms input event filter
If the output is turned back on before m_turnOffTimer expires, the
dpms input event filter won't be reset and all input events will go to
the void.

BUG: 460322
2022-10-13 13:00:36 +00:00
Vlad Zahorodnii
f4b32c0580 effects/screenshot: Avoid capturing hidden cursor
BUG: 460358
2022-10-13 15:38:22 +03:00
Vlad Zahorodnii
4f795dee20 Make "switch to screen" and "window to screen" code less error-prone 2022-10-13 10:43:14 +00:00
Vlad Zahorodnii
4340a020d1 Fix "window to screen" and "switch to screen" shortcuts
BUG: 460337
2022-10-13 10:43:14 +00:00
David Edmundson
36440a9d91 Fix scripted shader effect animations
AnimationEffect inherits from CrossfadeEffect as it may do a crossfade,
but it also has to perform non-crossfading activities with a custom
shader.

For crossfades we want to draw the old and new window, but this isn't
needed where the crossFadeProgress remains at 0.

BUG: 460277
2022-10-12 11:28:25 +00:00
David Edmundson
4d0f8e417c Drop shaderTrait adjustment on crossfade
Crossfade is now hanlded by regular scene painting, only by offscreen
effects. There is no need for scene code to have awareness and use a
more expensive shader.
2022-10-12 08:47:56 +00:00
Nate Graham
f56c67698d Wayland: don't allow minimizing applet popups either 2022-10-11 18:49:54 +00:00
Vlad Zahorodnii
35606fd9ee Add TabletEvent QPointingDevice constructor workaround for Qt 6 2022-10-11 18:34:00 +03:00
Vlad Zahorodnii
7f80c47758 Port SwitchEvent from QInputEvent
Otherwise we need to pass a QInputDevice.
2022-10-11 18:33:46 +03:00
Vlad Zahorodnii
c147340878 wayland: Add support for high resolution scrolling
In libinput 1.19, three new pointer axis events were added in order to
provide support for high-resolution scrolling.

LIBINPUT_EVENT_POINTER_AXIS is de-facto deprecated and new users of
libinput should use instead SCROLL_WHEEL, SCROLL_FINGER, and
SCROLL_CONTINUOUS.

Discrete deltas were replaced with v120 delta values. 120 corresponds to
a single discrete delta. Smaller values correspond to "partial" wheel
ticks.

https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72
2022-10-11 14:04:13 +03:00
Xaver Hugl
22e6b944b2 wayland: don't allow maximization of applet popups 2022-10-11 08:33:12 +00:00
Vlad Zahorodnii
459d842772 effects: Drop EffectWindow::hasAlpha()
It's impossible to properly map EffectWindow::hasAlpha() to wayland
abstractions, where a window can have subsurfaces.

The main motivation behind this change is to move Window::hasAlpha() and
Window::depth() to X11Window.

At the moment, EffectWindow::hasAlpha() is used as a micro-optimization.
API and ABI breaking change in libkwineffects.
2022-10-11 07:14:05 +00:00
Vlad Zahorodnii
eedbde464e utils: Drop updateXTime() 2022-10-11 06:43:25 +00:00
Vlad Zahorodnii
f950cbd3d1 Move Platform::updateX11Time() to Application
Platform can be viewed as an output backend and updating X11 time has
nothing common with that.
2022-10-11 06:43:25 +00:00
Vlad Zahorodnii
903e18d88c Merge Window::maximize() and Window::changeMaximize() 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
a1d5849d81 Make X11Window responsible for emitting clientMaximizedStateChanged signal 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
40a4cd13a4 Make Window::changeMaximize() take MaximizeMode 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
b044a7d5ff Drop adjust argument in Window::changeMaximize() 2022-10-11 06:21:15 +00:00
Volker Krause
74ae78d4c6 Adapt to Qt XkbCommon header changes in Qt 6 2022-10-10 17:07:37 +02:00
Vlad Zahorodnii
a119218c8b x11: Move Unmanaged damage initialization hack into SurfaceItemX11
It's unnecessary on wayland and there's a bug in m_isDamaged
initialization. We need to set m_isDamaged to true otherwise
SurfaceItemX11 won't attempt to query the damage.
2022-10-10 13:10:12 +00:00
Vlad Zahorodnii
bcd43ff44d backends/x11: Implement own keyboard interception
At the moment, the keyboard interception code in the effects system
relies on Qt code processing key events. However, since QDesktopWidget
is removed in Qt 6, this is a blocker for Qt 6 port.

This change ports the X11 backend to private xkb keymap as indicates in
the todo comment. It allows us to drop the last QDesktopWidget usage.
2022-10-10 09:16:50 +00:00
Joshua T
b0682129f9 kcmkwin/kwindecoration: Add "Shadow" to list of keywords
Since the window decoration settings includes the size of a window’s shadow,
the word "shadow" should be one of the keywords.
2022-10-09 14:26:00 +00:00
Xaver Hugl
e0120aa387 kwingltexture: port away from manual memory management 2022-10-07 14:50:10 +02:00
Xaver Hugl
7bca6267b0 decorationbridge: wrap factory in a std::unique_ptr 2022-10-07 14:50:10 +02:00
Xaver Hugl
e482556d58 screenedge: modernize some code 2022-10-07 14:50:10 +02:00
Xaver Hugl
1c7eb138ff backends: port more code to std::unique_ptr 2022-10-07 14:50:10 +02:00
Vlad Zahorodnii
cd1def8c55 effects/slide: Remove SlideDocks option
SlideDocks option was added after receiving negative feedback about
sliding docks. SlideBackground option was added to provide smooth
transition path for old users.

In hindsight, adding SlideDocks option was a mistake. It provides
excessive configurability in exchange for more code complexity.
2022-10-07 07:49:49 +00:00
Vlad Zahorodnii
94486e0cc1 backends/virtual: Stop creating a dummy output during backend initialization
With the virtual backend, it makes more sense to create outputs on
demand. It makes code clear, it would be also nice to use the virtual
backend for virtual outputs rather than have every backend implement its
own virtual outputs.
2022-10-06 18:04:35 +00:00
A. Meyer
bf00ab6f94 Change description for window border shortcut
Changes the "Hide Window Border" shortcut description to "Toggle Window
Border", which more accurately describes the feature.

BUG: 348549
2022-10-06 17:40:25 +00:00
Volker Krause
f50046524b Remove public declaration of the KWin::FPx2 debug stream operator
Qt 6 insists on this being exported, which in turns fails as this is
actually not implemented. There seemingly is an implementation, but that's
in a different namespace, so this can never have been used from the
outside anyway.
2022-10-06 16:43:47 +02:00
Vlad Zahorodnii
cddb2177f1 effects: Fix window highlighting in WindowHeap
Currently, windows are not highlighted as expected in the window view
effect if the keyboard focus belongs to another screen view.

In general, it makes more sense to apply "Window.window.activeFocusItem"
constraint only to heap.selected.
2022-10-06 07:35:56 +00:00
Vlad Zahorodnii
7eca5f44db x11: Reset SurfaceItemX11::m_isDamaged when the damage handle is destroyed 2022-10-05 14:17:09 +03:00
Vlad Zahorodnii
b3214db0b7 x11: Make damage region fetching code more robust to errors
With DamageReportNonEmpty damage report level, the x server will
send kwin a DamageNotify when the damage region changes from empty to
not empty.

The damage region will be made empty when SurfaceItemX11 calls
xcb_damage_subtract().

It appears like xcb_generate_id() can return us an already associated
XID, which eventually results in xcb_damage_subtract() failing and
breaking state tracking in SurfaceItemX11. KWin will no longer receive
DamageNotify events and some windows will freeze.

In order to make getting BadIdChoice less catastrophic, this change
makes the SurfaceItemX11 reset m_isDamaged after successfully fetching
the damage region. If xcb_generate_id() returns us a bad id, kwin will
try to fetch the damage again in the next frame.

BUG: 456511
2022-10-05 10:10:25 +03:00
Vlad Zahorodnii
d2899928cd Reset m_delayFocusWindow in Workspace::cancelDelayFocus()
CCBUG: 459860
2022-10-05 06:38:25 +00:00
Vlad Zahorodnii
2bb3299533 effects/fullscreen: Prevent playing animation for invisible windows
It makes no sense to play the animation if the window is invisible. It
can also produce unexpected results if the window is not on current virtual
desktop as animate() will temporarily force the window to be visible.
2022-10-04 14:14:40 +00:00
Xaver Hugl
18a72f7187 backends/drm: also force linear layout for dumb buffer cursors
While it usually shouldn't make a difference, it ensures that the buffer import
always works properly

CCBUG: 456306
2022-10-04 07:33:59 +00:00
Vlad Zahorodnii
6ba44deee4 effects/maximize: Prevent playing animation for invisible windows
If an invisible window is animated, e.g. minimized window, the maximize
effect will temporarily make it visible in order to play the animation,
which is unexpected.
2022-10-04 06:48:43 +00:00
Laurent Montel
1b57b27b76 Use POSITION_INDEPENDENT_CODE for static lib for helping to build against qt6 2022-10-04 08:28:40 +02:00
Xaver Hugl
ae4dd73e99 backends/drm: use linear buffers for multi gpu where necessary 2022-10-03 10:44:51 +00:00
Xaver Hugl
1f92dc5e5d backends/drm: correct test buffer check
There can be situations where the surface fits but there's no test buffer yet
2022-10-03 10:44:51 +00:00
Volker Krause
2bda46d5b9 Don't try to create a QChar from a non-char key enum
Asserts with Qt 6. Instead, check with the static QChar::isLetter, that
handles invalid input properly.
2022-10-03 09:12:19 +00:00
David Edmundson
3649ec474b [x11window] Remove duplicate activities check
We check if activities are valid in Window::setActivities. We don't need
to do it when we read the X11 properties.
2022-09-30 07:10:50 +00:00
David Edmundson
ad95b495ac Sync activities after kwin restart
Activities are loaded async. During this time any fetch of activity
information is incorrect as we will treat any settings as invalid.

We need to ignore attempts to set activities during this time, but also
refresh Window's concept of activities once we are loaded.

BUG: 438312
2022-09-30 07:10:50 +00:00
Méven Car
e60f26e0ab Disable PrimarySelection in seat setPrimarySelection
BUG: 456167
2022-09-29 10:32:03 +00:00
Vlad Zahorodnii
4c07daec3f effects/slide: Increase spring constant
We've got complaints that the animation is too slow.

BUG: 455450
2022-09-28 15:41:04 +00:00
l10n daemon script
b4cd4f645e 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-09-28 01:57:42 +00:00
Nate Graham
5322f32cf0 Set bugReportUrl for all KCMs in this repo
CCBUG: 204364
2022-09-27 12:15:26 -06:00
Vlad Zahorodnii
f343f3fb80 wayland: Use true logical geometry in Display::outputsIntersecting()
Display::outputsIntersecting() computes the logical geometry using the
oriented mode size and the scale factor, but OutputInterface's scale
factor is ceil()ed up, so the resulting logical geometry can be incorrect.

BUG: 459733
2022-09-27 12:07:03 +00:00
David Edmundson
388350f8bf [effects/private] Don't sync natural size to intended sizes
X/Y/Width/Height all get changed in the polish event so this only has
any effect in bindings before the first frame.

It seems this was leftover from development where we didn't have initial
values synced up properly.
2022-09-27 12:03:27 +00:00
Arjen Hiemstra
9a6c1e60e8 X11 backend: Retry enabling compositing when it was disabled a while ago
This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.

BUG: 452344
2022-09-27 10:23:04 +00:00
Xaver Hugl
21b833f9f5 effects: bump minor version 2022-09-27 08:57:20 +00:00
Xaver Hugl
4b82c639e0 effects/contrast: use effect-local data instead of window data 2022-09-27 08:57:20 +00:00
Xaver Hugl
cc0434d34c effects/blur: use effect-local data instead of window data for blur regions 2022-09-27 08:57:20 +00:00
Vlad Zahorodnii
1d8c9c62cf backends/drm: Fix 100% cpu usage after tty switch
The drm fd can get stuck in readable state, in which case the
QSocketNotifier will fire the activated signal as often as it can
leading to high cpu usage.

We need to read() the drm fd in order to make the socket notifier stop
firing QSocketNotifier::activated.

This change removes the m_platform->isActive() check to ensure that
drmHandleEvent() gets called, in general, it should be safe as we only
notify the outputs about completed pageflips.

BUG: 452726
2022-09-27 07:29:05 +00:00
Aleix Pol
2c874fc3e0 tablet: Ensure persistency of the outputName property
With this change, when the specified output is disconnected, it will
just behave as if none were selected but when it's connected again it
will pick it back up.

BUG: 456857
2022-09-27 07:11:38 +00:00
ivan tkachenko
e45cc7a807 effects/windowview: Add ExposeClassCurrentDesktop shortcut to KCM
See also: f2defd1dfa
2022-09-27 06:29:20 +00:00
David Edmundson
105af544c9 Don't accept space and enter key events in empty WindowHeaps
This fixes being able to select an empty desktop.

CCBUG: 457910
2022-09-27 06:26:38 +00:00
David Edmundson
e924b1cb23 Fix clamping in screenContainsPos
QRect.contains(somePointF.toPoint()) will round the values.

This is problematic for the case of a mouse being at -0.4, we will
consider it in bounds for the screen, but obviously this doesn't match
any surfaces.

The detection and confineToBoundingBox need to behave the same and
floor.

BUG: 459328
2022-09-26 10:37:53 +01:00
Andreas Cord-Landwehr
0a22d390d6 Explicitly include cmath 2022-09-25 17:20:33 +02:00
Aleix Pol
95742bf2e5 inputpanel: Do not start a display process while shutting the panel down
The panel is getting destroyed and shouldn't be shown anymore.
2022-09-24 20:21:48 +00:00
Xaver Hugl
b4e9443820 inputpanelv1window: fix showing and hiding
Instead of InputMethod directly calling showClient() on the input panel,
call methods that properly show or hide the panel as needed, with readyForPainting
set appropriately. This removes the cases where it's shown without being ready for
painting, which causes crashes.

BUG: 459404
2022-09-24 20:21:48 +00:00
l10n daemon script
1c6a95bceb 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-09-24 01:48:13 +00:00
David Redondo
16a5831fee Implement xwayland-keyboard-grab protocol
Only XWayland can see and bind to this global.
When a XWayland surface is focused that has a grab, shortcuts
are inhibited.
BUG:455159
FIXED-IN:5.26
2022-09-23 15:49:01 +02:00
Xaver Hugl
3af2d93c2e waylandserver: handle lock state changing properly
BUG: 316734
2022-09-23 14:48:49 +02:00
Vlad Zahorodnii
3546cc0541 wayland: Send wl_data_offer.source_actions before wl_data_device.enter
This makes kwin's behavior consistent with other wayland compositors
(sway, GNOME Shell, etc) and it's reasonable to provide all the
information about the data source before wl_data_device.enter. It also
makes Firefox happier.

Relevant discussion upstream: https://gitlab.freedesktop.org/wayland/wayland/-/issues/322

CCBUG: 445661
2022-09-23 11:43:41 +03:00
Vlad Zahorodnii
7b3ae310e6 Emit clientMaximizedStateAboutToChange when maximized mode is actually about to change
Window rules code can call maximize(requestedMaximizeMode()), in which
case the Window will emit clientMaximizedStateAboutToChange but the
maximize mode may not actually change.

This change moves the emission of of the clientMaximizedStateAboutToChange
signal to Window::changeMaximize(). The reason for doing so is that
window rules have the final decision what the maximize mode will be.

CCBUG: 459301
2022-09-22 12:16:56 +00:00
ivan tkachenko
f2defd1dfa
effects/windowview: Make sure "Toggle Present Windows…" shortcuts are initialized
The last fix was not complete without registering the shortcut from the
start. It worked after changing it in system settings at runtime though.

Amends 984388dba4.
2022-09-22 09:55:36 +03:00
Vlad Zahorodnii
169c784c51 wayland: Bump plasmashell protocol version
See https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/48
2022-09-21 13:46:55 +00:00
l10n daemon script
1680fa1318 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-09-21 01:47:35 +00:00
ivan tkachenko
501136b222
effects/windowview: Animate the placeholder just like the search field
FIXED-IN: 5.26
2022-09-20 12:37:08 +03:00
ivan tkachenko
8ac4901068
effects/windowview: Turn placeholder on when there are actually no visible windows
This may happen when all windows are minimized, and the effect was
started in "Window class on current desktop" mode (Ctrl+F7).

BUG: 459244
FIXED-IN: 5.26
2022-09-20 12:35:24 +03:00
Vlad Zahorodnii
d32aebb747 Lower severity of "Got invalid timestamp" message
BUG: 459405
2022-09-20 10:59:08 +03:00
Vlad Zahorodnii
d6234d0411 effects/windowview: Re-order placeholder text and window heap
This ensures that the proxy thumbnail item is stacked above the
placeholder text.
2022-09-19 19:26:52 +00:00
Vlad Zahorodnii
14513ebcda effects/mousemark: Specify effect chain position
BUG: 457639
2022-09-19 19:10:57 +00:00
Nicolas Fella
fdb40395f0 [kcms/scripts] Make plugin id and translation domain match
KQuickAddons::ConfigModule sets the translation domain based on the plugin id

That is kcm_kwin_scripts. However the translation domain is kcm-kwin-scripts, which breaks loading translations

Also fix Messages.sh to extract from QML

BUG: 458438
2022-09-19 15:01:21 +00:00
Vlad Zahorodnii
4696bdaa05 scripting: Add js object <-> QRectF/QSizeF/QPointF conversion helpers
The js code contains code such as

    window.frameGeometry = {x: 42, y: 42, width: 100, height: 50};

However, QJSEngine doesn't know how to convert js object to QRect. For
that purpose, we need to register conversion functions.

So far, we kept registering converter functions only for integer based
geometry types, i.e. QRect, QSize and QPoint. In 5.26, Window was ported
to QRectF, QSizeF and QPointF, but the corresponding conversion helpers
were not added.

BUG: 459369
2022-09-19 13:58:44 +00:00
Aleix Pol Gonzalez
b81123865d tabbox: Makes sure we are not calling a null pointer
The desktopClient is a weak pointer and therefore can be null. This
makes sure that we are not calling a null instance of it.

It seems likely it was introduced here 45486ce515

This is a blind non-reproduced fix for the issue here:
https://errors-eval.kde.org/organizations/kde/issues/158/
2022-09-19 13:49:14 +00:00
ivan tkachenko
ab79fe47ce
effects/private: Add another guard for multi-screen Drag&Drop
Unlike D&D actions, this method does not return any feedback as to
whether an item drop was accepted by any other screen, and so whether it
is going through destruction process already, so the best we can do is
add another typeof/undefined check after calling that method.

Fixes the following error:

    file:///usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:415:
    TypeError: Cannot read property 'deleteDND' of undefined
2022-09-19 15:13:13 +03:00
Vlad Zahorodnii
d8faf8ab08 Fix multi-screen drag-and-drop in WindowHeap
DND was failing with the following error

file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:96: TypeError: Cannot read property 'mapToGlobal' of undefined
2022-09-19 13:09:29 +03:00
Eric Edlund
6d9f740d6f Better handle windows on all desktops in slide effect
Change the render cycle for slide effect. Now, windows will be drawn on each desktop or not in the paintWindow() loop instead of the paintScreen() loop. This allows us to respect stacking order better by painting all of the same window together instead of per VD.

BUG: 457486
BUG: 458622
2022-09-19 07:00:42 +00:00
Nicolas Fella
3ee921a7a9 [kcms/scripts] Enable Apply button when clicking Defaults
BUG: 459320
2022-09-18 13:20:10 +02:00
ivan tkachenko
d7c6a87f39
effects/overview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:11 +03:00
ivan tkachenko
de6c0289a0
effects/overview: Implement the searchText backing property
It is used in QML code, just like in windowview (Present Windows)
effect, but developers forgot to copy the implementation in C++
backend.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:05 +03:00
ivan tkachenko
a3c6db3ee7
effects/windowview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

FIXED-IN: 5.26
2022-09-17 11:12:18 +03:00
ivan tkachenko
984388dba4
effects/windowview: Fix "Toggle Present Windows (Window class on current desktop)" shortcut
The effect was not turning off when pressing a shortcut again, unlike
other flavors of this effects.

BUG: 156155
FIXED-IN: 5.26
2022-09-17 01:57:35 +03:00