Commit graph

4886 commits

Author SHA1 Message Date
Tomasz Paweł Gajc
88cf83554f add support for Lima, V3D, VC4 (based on https://github.com/OpenMandrivaAssociation/kwin/blob/master/kwin-5.21.4-add-support-for-panfrost-driver.patch made by Bernhard Rosenkraenzer) and update list of supported devices for Panfrost 2023-02-15 11:23:02 +00:00
Vlad Zahorodnii
c2fb99d126 x11: Drop xv-related workaround
It creates bouncing glitches in client side decorated windows. Besides
that, it's preferred to avoid adding client workarounds in the wm.
2023-02-15 09:39:12 +00:00
Vlad Zahorodnii
683761ea2d scripts/desktopchangedosd: Port to VirtualDesktop objects 2023-02-15 08:32:07 +00:00
Nicolas Fella
659f4eb555 Remove unneeded KService usages 2023-02-15 07:27:55 +00:00
Aleix Pol
577c031599 screencast: Simplify the region path
No need to render the intermediate texture into a second intermediate
texture.
2023-02-14 14:41:42 +00:00
Aleix Pol
6394bccdcb x11/windowed: Fix screencasting
Properly notify when the output changes.
Make sure we are reading from the correct framebuffer when forwarding
the texture.
2023-02-14 14:41:42 +00:00
Aleix Pol
309c9100fa virtual: fix screencasting by output
Properly notify when the output changes.
Forward the texture that holds the output when requested.
2023-02-14 14:41:42 +00:00
Harald Sitter
1ede84f4fe forward all channels of started subprocesses
there is no practical reason I can see for why this should be limited to
stderr only. we are not reading or otherwise consuming stdout, we should
just pass it on.
2023-02-14 13:11:32 +01:00
Dominique Hummel
0ca7b40da0 tiling: Evacuate tiled windows from custom & quick tiling on output removal
Context: If a display is removed, the corresponding TileManager is removed with it. This in turn removes every one of its Tiles with it, and when a Tile's destructor is called, it attempts to find a new replacement tile for any windows it was previously managing.

However, if the Tile is removed because its corresponding TileManager has been removed, this has the potential to cause a segfault in KWin, causing it to crash (I suspect a possible race condition? but not sure).

This MR correctly evacuates custom tiled windows & migrates quick tiled windows upon output removal.

BUG: 465522
2023-02-14 12:03:40 +00:00
Natalie Clarius
127ae4b556 useractions: rename shortcuts 'window to screen' -> 'move window to screen' 2023-02-13 15:52:38 +00:00
Vlad Zahorodnii
160cc98597 wayland: Fix a typo in DataControlDeviceV1Interface::sendPrimarySelection()
interfaceVersion() is not the same as the resource version.
2023-02-13 13:16:50 +02:00
David Edmundson
d084629f3c wayland: Version check before send_primary_selection calls
This is only in v2

BUG: 465657
2023-02-13 09:38:24 +00:00
Andreas Cord-Landwehr
4c2952a533 Add missing cmath include for std::ceil 2023-02-12 12:12:46 +01:00
Andreas Cord-Landwehr
80b5deb032 Include missing header for std::round 2023-02-12 12:00:37 +01:00
Andreas Cord-Landwehr
484d2da046 Set CXX standard for crossbuilding utility 2023-02-12 08:54:42 +01:00
Vlad Zahorodnii
a1a09e91ab plugins/screencast: Simplify projection matrix code in window source
Split orthographic matrix construction and y inversion in two steps to
improve code readability.
2023-02-11 12:48:24 +00:00
Vlad Zahorodnii
83c38b0907 Drop Window.screen property
Use Window.output instead.
2023-02-11 12:16:46 +02:00
Vlad Zahorodnii
37f4199b19 scripting: Drop clientArea(area, QPoint, VirtualDesktop) overload
Use Workspace.screenAt() to look up the output instead.
2023-02-11 09:49:28 +00:00
Vlad Zahorodnii
fa2b854ee4 scripting: Switch to Output 2023-02-11 09:49:28 +00:00
l10n daemon script
3b391c9f67 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-02-11 01:59:50 +00:00
Vlad Zahorodnii
60db5637b4 plugins/screencast: Simplify y inverted handling
dmabuf buffers have the origin in the top left corner, so a texture with
attached dmabuf must have y inverted.

By correctly specifying the y inverted flag, we could leverage existing
infrastructure in kwin to handle vertically mirrored textures and make
simpler some projection matrix code in screencasting.
2023-02-10 15:16:40 +00:00
David Redondo
cc4d99aea4 Fix button to Qt::MouseButton mapping
Even though the names seem to match, QtWayland maps button values
to enum values in ascendung order (as it does on X11). The wrong
mapping is usually not a problem because we send the native button
events to clients. However when the Qt names or values are used
for communication between KWin and a client this leads to
misunderstandings.
BUG:465463
FIXED-IN:5.27.1
2023-02-10 09:27:37 +00:00
l10n daemon script
9aad886729 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-02-10 02:01:56 +00:00
Xaver Hugl
815269a26f backends/drm: set cursor again after it was hidden
This isn't necessary with atomic modesetting, as moving and setting are
the same thing. With legacy though, if the cursor was hidden, moving it
with the layer visible does not automatically show it again, so that needs
to be done explicitly

BUG: 461181
2023-02-09 22:35:44 +00:00
Ismael Asensio
1b75d4b71a kcms/rules: Change opacity defaults to 100%
This has the benefit of providing a saner default for the values
of `opacityActive` and `opacityInactive` rule properties, both
in the UI and when reading the config.

The side effect is the same we have when changing default values:
if someone would have set a rule with some opacity to 0%, it will
be read as 100% next time kwin starts.

In this case it is a small price, as it is always easier to change
it back when the windows are visible that restoring it when they're
not, specially if it wasn't voluntary.
2023-02-09 22:41:39 +01:00
Natalie Clarius
0b2c442196 kcms/rules: add warning for low opacity
Once upon a time, in a moment of acute stupidity, I accidentally created a window rule making all windows completely transparent. I meant to go for 0% transparency when really the slider said 0% opacity. And once you've made the very window to change this setting invisible, the only way to fix that mistake is to log into a TTY or different DE and find the config file to edit manually. Since I've since seen several KRedditors fall into the same trap:  

Show a warning when active or inactive opacity is set to ~~<= 15%~~ < 25%.

![warning](/uploads/0b1178bf5782bff3b4293a0031bb4fca/warning.png)
2023-02-09 21:36:24 +00:00
Vlad Zahorodnii
e1e9e89f34 wayland: Remove SeatInterfacePrivate::accumulatedCapabilities
The seat no longer posts the relevant protocol error.
2023-02-09 20:15:55 +02:00
David Edmundson
e0c66d42cb Match pointer/keyboard/touch lifespan to Seat lifespan
PointerInterface is a "Server-managed multicasting resource". As in we
have one QObject, managed by the server, but internally it represents
multiple resources from various clients.

We cannot control the lifespan of those resources, they may persist long
after we stop having these capabilities on the seat.

If we delete our pointer object when we stop advertising a pointer
capability we have race conditions with clients calling release, or
potentially even having a seat_get_pointer in flight.

It's easier and safer just to have PointerInterface last as long as the
Seat. If we don't have a mouse no-one should try to bind, and even if
they did or remained bound long after we stop having a mouse it won't do
any harm as there are no mouse events to broadcast.
2023-02-09 16:36:24 +00:00
Aleix Pol
1a9ab2d46e screencast: Fix region screencasts top coordinate
We don't need to invert the top as the ortho already is on the correct coordinate
space.

Thanks to Dominique Hummel for helping debug the issue!
2023-02-09 15:09:19 +01:00
Aleix Pol
4078fcab2b screencast: Error out if we request a region without outputs
It makes for a bad development experience and I don't see a good use case
for it right now. If it existed, we can always make sure it works.
2023-02-09 15:09:19 +01:00
l10n daemon script
88d9a772fc SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-02-09 02:07:11 +00:00
Vlad Zahorodnii
3e9804215f Port Outline to org.kde.kwin 3.0
The outline has been overlooked.
2023-02-08 20:12:20 +02:00
Vlad Zahorodnii
f731a8e9cf x11: Remove unused signals 2023-02-08 14:47:26 +02:00
David Edmundson
fbb71f9c0b XWayland: Don't dispatch xwayland events in QAbstractEventDispatcher sleeps
QAbstractEventDispatcher blocks and waits constantly on every external event
processed; every timer or update from an X or wayland client, mouse
move or DRM event.

Right now every time this happens we go and check Xwayland for new
events, this is a system call (poll) that based on strace will
unsurprisingly immediately return with EAGAIN as there's nothing to read
from X. If there is something to read our socket notifier will fire. On block we do still need to read any events read in the meantime that weren't dispatched.

This cuts down our system calls significantly, which hopefully should have a
noticeable impact on performance especially when the kernel is under
load.

---

Found whilst analysing strace (by accident whilst looking for something else!)

In a simple case of xwayland nested running glxgears we go from 28 calls per frame to 21. With many many clients and more input events it'll be an even higher percentage.
2023-02-08 10:34:20 +00:00
l10n daemon script
608fbbfa32 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-02-08 02:07:04 +00:00
Vlad Zahorodnii
7c1d188747 scripting: Remove unnecessary x11window.h include 2023-02-07 21:54:39 +00:00
Vlad Zahorodnii
6de388c79c scripting: Make workspace.getClient() return Window 2023-02-07 21:54:39 +00:00
Vlad Zahorodnii
09fd29dccc scripting: Remove unrelated signals
The current state is inconsistent. Some window-specific signals are
exposed in the workspace, some not.

This change drops those signals. One should monitor the signals it's
interested in instead.
2023-02-07 21:54:39 +00:00
Vlad Zahorodnii
7fd7c07b30 scripting: Remove noop signals 2023-02-07 21:54:39 +00:00
Vlad Zahorodnii
93c1a610bc scripting: Remove X11 specific signals 2023-02-07 21:54:39 +00:00
Vlad Zahorodnii
452bb20741 Drop Workspace::{oldDisplayWidth,oldDisplayHeight}
They're unused.
2023-02-07 21:34:07 +00:00
Vlad Zahorodnii
77bf51c3b5 effects/overview: Drop "blur background" option
The blur effect is used to improve the contrast. The option was added
thinking "why not? it might be useful." This was perhaps a mistake and
it should have been added with a clear valid usecase in mind.

CCBUG: 457495
2023-02-07 19:36:20 +00:00
Vlad Zahorodnii
a3748b8e48 effects: Drop EffectWindow::(un)referencePreviousWindowPixmap 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
89283c4cc6 effects: Drop support for effect proxy'ing
It's not used by any effect. We use other means to share functionality
between effects now.
2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
66837f7cce effects: Remove deprecated feature enums 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
909e10dace effects: Drop PAINT_DISABLED_BY_TAB_GROUP 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
65f4313e04 effects: Drop EffectWindow::geometry 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
4f44c28032 effects: Drop EffectWindow::isCurrentTab 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
20487c7cda effects: Drop legacy EffectsHandler::desktopChanged overloads 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
522e2ee7c4 effects: Drop EffectWindow::desktop() 2023-02-07 18:10:52 +02:00
Vlad Zahorodnii
9371fc8ae9 scripting: Prefer VirtualDesktop objects 2023-02-07 15:41:43 +02:00
Vlad Zahorodnii
0218a8f3ba scripting: Drop deprecated apis 2023-02-07 14:07:03 +02:00
Ismael Asensio
e504c58286 kcms/tabbox: Manage shortcuts via ShortcutSettings
Leverage the standardized ShortcutSettings config object to handle
the shortcuts config for the tabox (setting default values, reading
and saving to KGlobalAccel, etc).

This way, we can remove the extra methods in TabBoxConfigForm and
improve separation between UI and logic.

It also fixes the actions getting stored untranslated when saving
from the KCM (until next restart of KWin)
2023-02-07 07:59:25 +00:00
Vlad Zahorodnii
d6315bebd0 scripting: Flatten source tree
It makes source tree tidier.
2023-02-07 07:08:04 +00:00
Ismael Asensio
9c2224acb3 kcms/tabbox: Expose shortcuts as a KConfigSkeleton
Provide a new KConfigSkeleton (ShortcutSettings) so that the
KCModuleData knows if any of the shortcuts is non-default.

This improves the UX by showing an "orange dot" in system
settings when just a shorcut has been changed.

We also need to implement a new specific KConfigSkeletonItem
(`ShortcutItem`) that uses KGlobalAccel to retrieve and store
the shortcuts, instead of storing them in a config file.
2023-02-06 21:01:35 +01:00
Vlad Zahorodnii
600de787d8 scripting: Drop org.kde.kwin 2.x
It's superseded by 3.x.
2023-02-06 18:59:10 +00:00
David Edmundson
466f2fe8ba Launch xwayland on demand
This installs a socket notifier onto our xwayland socket, when a user
connects we launch xwayland. The client then connections once kwin has
established itself as the compositor.

For a full desktop plasma session this patch effectively does nothing
too useful as we still start kcminit and make xrdb calls on startup
which in turn will launch X, but for the same reason this patch should
be harmless now as we're still processing the xrdb calls before any
clients will connect.
2023-02-06 16:24:01 +00:00
Ismael Asensio
8507e602f3 kcms/tabbox: Handle config directly within the configuration form
By passing the config object to the TabBoxConfigurationForm, we
can handle it directly instead of bouncing information from and
back between the forms and the KCM main class.

Now the user changes in the UI translate to the config objects,
which can directly provide `isSaveNeeded()` and `isDefaults()` info.

This allows to simplify the logic on both classes, reducing the
coupling between them and minimizing the number of exposed public
methods and some boilerplate.
2023-02-06 14:01:14 +01:00
Vlad Zahorodnii
9807c83929 {x11,wayland}: Fix restoring fullscreen windows
If the window has been originally on another output, make sure that the
window will be properly put back on it.

This logic seem to originate from 7d67380205,
but it's not necessary anymore because geometry restore will be updated
if the window is moved to another output by the user.

BUG: 465358
2023-02-06 11:33:35 +00:00
Ismael Asensio
a648553be0 kcms/tabbox: Improve model initialization
- Add the switchers to the model directly, instead of using
  temporal lists and a second loop over them
- Use the same model for main and alternative forms

This makes this code a little more clear and efficient
2023-02-06 09:11:34 +00:00
Joshua Goins
21dbf0f413 kcm/decoration: Change it to the new frameless style
This now matches other modern KCMs and removes the weird titlebar tab view,
moving it to a separate page.
2023-02-05 02:22:14 +00:00
l10n daemon script
71c9b7db87 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-02-04 02:09:27 +00:00
Vlad Zahorodnii
271de0ccc6 scripts: Port some scripts to org.kde.kwin v3 qml api 2023-02-03 17:22:16 +00:00
Vlad Zahorodnii
d619e0b4d5 tiling: Ensure padding is writen to config
Root tile's padding is not monitored so new padding values are never written to the config.

BUG: 464863
2023-02-03 16:40:41 +00:00
Marco Martin
1332d7de2c Also cancel translucencyMoveResizeAnimations
When a window goes away it was stoppping translucencyWindowTypeAnimation
and translucencyInactiveAnimation but any translucencyMoveResizeAnimations

was hanging there forever, causing ghost windows

BUG:439332
2023-02-03 16:23:05 +01:00
Vlad Zahorodnii
37c4a4536e scene: Sync Window::readyForPainting() to window item visibility
If a window is made ready for painting with some delay, the item won't
schedule an update. To fix that, sync the item visibility state with
Window::readyForPainting(). When the item visibility changes, a repaint
will be scheduled.

BUG: 464955
2023-02-03 14:09:27 +00:00
Vlad Zahorodnii
2babccda04 x11: Fix maximize animation
Window::maximize() used to be split in two halves:

- generic Window::setMaximized() and Window::maximize()
- protocol-specific Window::changeMaximize()

Window::changeMaximize() used to block all geometry updates and
Window::maximize() emit "maximize mode changed" signals. With that,
frameGeometryChanged came always before clientMaximizedStateChanged.

After merging Window::changeMaximize() and Window::maximize(), the order
of the signals has been reversed because of RAII. Unblock geometry
updates explicitly to preserve the old behavior.

BUG: 465157
2023-02-03 10:33:42 +02:00
Xaver Hugl
1746af4b02 gesture: use the global direction enums 2023-02-02 16:21:36 +00:00
Xaver Hugl
a9334cb9c6 unify touchpad gesture APIs
There don't need to be separate functions for real time and not real time
2023-02-02 16:21:36 +00:00
Vlad Zahorodnii
e5901070cc Drop support for _KDE_NET_WM_TEMPORARY_RULES
It's an obscure feature, which perhaps not worth putting an effort to
make it work on wayland and x11.
2023-02-02 15:34:24 +00:00
Vlad Zahorodnii
d18f7efac2 scripting: Remove deprecated properties in WindowThumbnailItem 2023-02-02 15:13:38 +00:00
Vlad Zahorodnii
5de308792f effects/fade: Remove hidden FadeWindows option
Enable/disable the fade effect in system settings instead.
2023-02-02 14:48:12 +00:00
Vlad Zahorodnii
c1fb295cd6 plugins/nightcolor: Drop legacy shortcut with localized key 2023-02-02 13:51:28 +00:00
Vlad Zahorodnii
78e0ff6b97 Avoid resizing the tile until interactive resize is actually active
It's confusing, but handleInteractiveMoveResize() can be called while
interactive move resize is inactive.
2023-02-02 12:07:13 +00:00
Xaver Hugl
6f1b36d3b4 plugins/screencast: make context current later, don't make it current twice 2023-02-02 10:18:38 +00:00
Xaver Hugl
abd59be232 x11window: round framegeometry on moveresize
If this isn't done, the size check in SurfacePixmapX11::create will stop
the window from being updated

BUG: 460934
BUG: 458778
2023-02-02 09:14:50 +00:00
Xaver Hugl
3c059d3a24 scene/surfaceitem_x11: improve size mismatch warning 2023-02-02 09:14:50 +00:00
David Edmundson
c0fa51c784 effects/tileseditor: Drop unused imports
Imports come at a big cost when they're unused.
Also we shouldn't be importing WindowView from a different plugin. If
that effect is disabled it meant tileseditor would fail to load.

BUG: 464970
2023-02-02 09:13:23 +00:00
Natalie Clarius
1b29c5668c point aurorae documentation to develop.kde.org 2023-01-31 00:33:18 +00:00
Xaver Hugl
0ef7d20fde plugins/screencast: fix window recording while no scene rendering happens
This affects direct scanout and when the window isn't triggering desktop
repaints otherwise, like being minimized or on a different virtual desktop
or activity
2023-01-30 14:25:00 +01:00
David Edmundson
99f433641a Add missing includes for KF6
This fixes includes that were implicitly brought in with KF5
2023-01-28 09:16:14 +00:00
David Edmundson
4474f4098a Xwayland: Disable input spy on xwayland teardown
Otherwise we have a potential crash when we send keys to the
non-existent xwayland wayland connection
2023-01-27 16:46:45 +00:00
ivan tkachenko
53591cdfb2
kcms/decoration: Deduplicate event proxying code 2023-01-26 23:04:40 +03:00
ivan tkachenko
5bd748c674
kcms/decoration: Use correct mask to specify that item accepts all buttons 2023-01-26 23:04:40 +03:00
ivan tkachenko
70a2aa644f
kcms/decoration: Don't setFiltersChildMouseEvents when filter method is not overridden 2023-01-26 23:04:40 +03:00
ivan tkachenko
01a7bd14ec
kcms/decoration: Remove suspicious C-style const cast 2023-01-26 23:04:38 +03:00
Vlad Zahorodnii
020b633591 backends/x11: Check whether X server supports shared pixmaps 2023-01-26 15:02:05 +02:00
Vlad Zahorodnii
81b05bd87e Avoid mistriggering quick tiling when using custom tiling
If user has chosen custom tiling, ensure that quick tiling state is
reset.

BUG: 464810
2023-01-26 12:01:46 +02:00
ivan tkachenko
63ff64b094 kcms/decoration: Fix double click behavior over the thumbnail
KDecoration.Decoration eats all the events for the sake of keeping
an illusion of buttons being like the real ones. I didn't find any sane
way to completely turn off event filtering on that level, so instead
let's fix this MouseArea, which is a workaround, but a decent one.

AFAIK this is the last KCM in Plasma to properly support "double-click
to save" behavior. There might be others though: watch out for event
filters inside thumbnail.
2023-01-25 18:05:15 +00:00
Fushan Wen
476509b0fd
effects/windowview: set translation domain for the placeholder text 2023-01-25 21:44:52 +08:00
Vlad Zahorodnii
716f386226 tabbox: Remove unused ShowDelay option
BUG: 420291
2023-01-25 13:48:27 +02:00
Vlad Zahorodnii
671cbcda6b Refactor some custom tiling code
Use already specified global position rather than look it up from the
cursor, which is quite input device specific.
2023-01-25 11:04:44 +02:00
Vlad Zahorodnii
76a039332d Make interactive custom tiling more robust to suboptimal tile configs
If the root tile node contains only one child node, but the child node
has its own children, kwin will fail to show an outline when the user
interactively tiles the window.

On the other hand, there is no reason to have this child count check.
For what it's worth, it also prevents tiling the window if the output
only has one tile, which is odd, but a valid usecase.

BUG: 464379
2023-01-25 07:32:11 +00:00
l10n daemon script
7bd4bd0bf7 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-25 02:03:19 +00:00
Aleix Pol
43586d673a tiles: Don't generate the client area until we know it's necessary 2023-01-24 17:58:26 +01:00
Aleix Pol
96962941e3 QuickTile: register enum to metaobject/QDebug 2023-01-24 17:58:26 +01:00
Xaver Hugl
11327da292 xdgshellwindow: ignore window position rules placing windows outside of all screens
BUG: 464047
2023-01-24 14:40:53 +00:00
Xaver Hugl
9f2ed2083c window: restore special window states on moveresize cancel
BUG: 464507
2023-01-24 11:39:02 +00:00
David Redondo
d6b75907cc Data control: Resend selection when not following through with request
Normal event flow is from a client view is
-> wlr_data_control_device.set_selection
wlr_data_control_device.selection
or
wlr_data_control_source.cancelled
wlr_data_control_device.selection
However when the race mentioned in the comment happens the client
sees
-> wlr_data_control_device.set_selection
wlr_data_control_device.selection
wlr_data_control_source_cancelled
Which can confuse client state thinking the clipboard didn't change
as it associates the selection event with its own request. Resend
the selection event in this case to tell the client the correct
selection.
BUG:464509
FIXED-IN:5.27
2023-01-24 09:35:20 +00:00
Vlad Zahorodnii
e6d2a19857 backends/drm: Fix custom mode generation
maxSizeRefreshRate is uninitialized.

BUG: 463619
2023-01-24 07:15:10 +00:00
l10n daemon script
c8a92f833b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-24 02:04:53 +00:00
Xaver Hugl
7cb4b51d5e inputpanel: ignore requested output
While there's specific hardware where the IM could benefit from requesting to
be shown on a specific output, it effectively never has enough information to
choose a useful output - and the protocol doesn't allow setting a null output
to indicate that the compositor should do the choice.
To avoid showing the OSK on the wrong output, always put it on the active
output and ignore what the IM client requests.
2023-01-23 22:28:41 +00:00
Vlad Zahorodnii
cc5b917de1 tiling: Forbid overlapping quick tiles
It looks weird and it can break Tile::supportsResizeGravity() logic.
2023-01-23 16:50:31 +02:00
Vlad Zahorodnii
826fb1cb29 Fix a crash that happens when resizing quick tiled window
QuickTile::setRelativeGeometry() and QuickRootTile::setVerticalSplit() or
QuickRootTile::setHorizontalSplit() can hit recursion when size
constraints start taking effect.

This change reworks how other quick tiles are resized. With the proposed
design, when relative geometry changes, QuickRootTile will notice that
and start resizing other tiles.

When QuickRootTile resizes horizontal or vertical split, it is going to
ignore QuickRootTile::relativeGeometryChanged() signals (m_resizedTile).
It prevents hitting the recursion and makes moving h/v splits more
predictable.

I do think that in order to make the tile design more robust to this
kind of bugs, it's worth splitting geometry in two kinds though - the
one that indicates the preferred geometry (implicitWidth/implicitHeight
in qtquick lingua) and the current geometry, the parent node then
monitors the preferred geometries and updates the current geometries.

BUG: 464621
2023-01-23 14:58:09 +02:00
l10n daemon script
19f8a724f1 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-23 01:57:54 +00:00
l10n daemon script
0b291dcb36 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-22 02:01:44 +00:00
David Edmundson
bfe837c918 effects/tileseditor: Set translation domain in QML files
BUG: 464572
2023-01-20 23:21:37 +00:00
Vlad Zahorodnii
0d44092db2 wayland: Fix invisible tablet cursor
A cursor source is created but it's not attached to the cursor.

BUG: 464529
2023-01-20 14:47:54 +02:00
David Edmundson
fef1553b90 xwayland: Set parent on XwlDropHandler
A parent is provded to the XwlDropHandler but it doesn't reach the
QObject superclass
2023-01-20 09:41:01 +00:00
Vlad Zahorodnii
e83af181f7 Remove some code duplication in cursor layer code
Move some generic properties to the OutputLayer class and add a cursor
layer getter in the RenderBackend class. That allows us to get rid of
some code duplication. And we could use this work to move more cursor layer
code from backends to Compositor.
2023-01-20 08:22:18 +00:00
John Brooks
a276e6dc10 wayland: Fix high-res scroll events with low-res clients
Sending an axis event for every high-res scroll wheel movement was
causing excessive scrolling on clients that expect low-res (discrete)
scroll events.

Signed-off-by: John Brooks <john@fastquake.com>
2023-01-19 13:06:51 +00:00
Xaver Hugl
52b4ee3338 input: don't trigger titlebar actions on every event with a touchpad
Instead, accumulate the values and only trigger an action when the user
has scrolled far enough

BUG: 444737
2023-01-18 14:14:28 +01:00
Xaver Hugl
b89009f9e1 plugins/screencast: send frame callbacks if the window is otherwise invisible
If we don't send frame callbacks, the application might stop rendering or
throttle to single digit fps.

BUG: 464217
2023-01-18 08:01:45 +00:00
Vlad Zahorodnii
7c58f169e0 Store shadow elements as QImages
At quick glance, it doesn't seem like there's any benefit from storing
the shadow elements as pixmaps. It saves us some QImage <-> QPixmap
conversions too.
2023-01-18 07:27:40 +00:00
Vlad Zahorodnii
d57be742ff effects/diminactive: Ensure that m_activeWindow is always reset
As the FIXME comment says, a window can be deleted without prior
windowClosed signal.

BUG: 442222
2023-01-17 18:41:07 +00:00
Arjen Hiemstra
361aa053e1 kwinquickeffect: Use an asynchronous incubator for view creation
Creating views is the main thing blocking quick effect activation.
Rather than blocking until everything is created, we can use
QQmlIncubator so we create views asynchronously. This allows KWin to do
other things while views are being created. This is mostly relevant for
multiscreen setups where we create a view per screen.
2023-01-17 10:03:37 +00:00
Arjen Hiemstra
39a3b53bfb windowview: Only create PlaceholderMessage when needed
If there's windows and we're not searching, we don't need the
PlaceholderMessage. So only create it when we actually need it to reduce
the time needed to activate the effect.
2023-01-17 10:03:37 +00:00
Arjen Hiemstra
8242584b6e windowview: Use asynchronous instantiators instead of repeaters
We don't need the features of Repeater here and can instead just use an
Instantiator, which allows us to use asynchronous creation for the
window delegates, reducing the time needed to activate the effect.
2023-01-17 10:03:37 +00:00
Vlad Zahorodnii
cf583aa367 Change default latency policy to "Force smoothest animations"
There are some performance differences between X11 and Wayland. Desktop
systems are mostly unaffected by them, but laptops suffer a bit.

On Wayland, kwin always does double buffering. This is great for
reducing latency and avoiding tearing, but if the gpu can't keep up with
the work, you're going to see stuttering.

Another issue is that in order to reduce latency, we need to have very
good frame stats. At the moment, kwin records only cpu render time, but
we also need to record the gpu time. We've already done some work in
this area, but it's most likely Plasma 6 material. (plasma/kwin!1163)

In the meantime, let's change the default latency policy to "Force
smoother animations." It's going to improve frame rate. If people care
about latency, they can change latency policy in system settings; the
option is still there.

CCBUG: 452119
2023-01-17 04:10:30 +00:00
l10n daemon script
03c407cb7d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-17 02:03:45 +00:00
Vlad Zahorodnii
d42442b424 effects: Fix a typo in RenderGeometry::appendWindowVertex()
Only the y coord is scaled, but both x and y coords have to be scaled.
2023-01-16 18:52:50 +00:00
Weng Xuetian
ff092b12b0
Add text-input-v1 support
Main reason to support this old interface is because this is the only
protocol chromium (and effectively all electron app) that supports.

The protocol itself very similar to text-input-v2 with some minor difference.
So not hard to support by just duplicate some existing code. There might be
some unclear protocol design issue if kwin need to support multiple SeatInterface,
but for now it should be ok to assume there is only one seat.

Tested using fcitx5 against weston-editor and chromium with flag
--enable-features=UseOzonePlatform --ozone-platform=wayland
--enable-wayland-ime
2023-01-16 10:34:37 -08:00
Vlad Zahorodnii
5963790b21 kcms/rules: Use window class and role with original casing
The window rules kcm uses lower-case window class and role, but kwin can
use window class and role with other casing, which will break the ExactMatch
match rule.

BUG: 464190
2023-01-16 16:52:02 +00:00
Kai Uwe Broulik
ecf3fa9f10 backends/x11: Remove dependency on GLTexture::toImage
It is being phased out. Instead, read the pixels from the
cursor's framebuffer using `glReadPixels`.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-01-16 15:06:20 +00:00
Vlad Zahorodnii
dedae9e667 effects/morphingpopups: Fix glitch
There's a visual glitch that looks like a random rectangle in the top
left corner of morphing popup. It appears like it's caused by the blur
effect, it produces wrong results when the window is captured in
CrossFadeEffect::redirect().

Make CrossFadeEffect::redirect() unset blur and contrast force roles, so
the backdrop effects are not included in the captured frame.
2023-01-16 13:43:18 +02:00
Vlad Zahorodnii
d32f8df7c8 effects/{blur,contrast}: Move to the front in the effect chain pos
Backdrop effects such as blur and background contrast have to be in the
front of the effect chain because they need to work with background
before the window is painted on top.

Hopefully it's going to fix panel popup blinking visual artifacts.
2023-01-16 10:23:28 +00:00
Arjen Hiemstra
f95eb71173 Remove WindowQuad::makeArrays and WindowQuad::makeInterleavedArrays
RenderGeometry can do all that these methods do and offers some extra
functionality, in addition to having a more explicit API.
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
3118b48650 Disable vertex snapping for Wobbly Windows and Magic Lamp
The subdivided grid used by these effects doesn't account for pixel
alignment. If we force the generated WindowQuads to be rounded, the
quad's sizes no longer match the texture sizes, which results in blurry
rendering.

BUG: 461283

eeffects
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
3ee51e3f21 Allow overriding the vertex snapping mode for OffscreenEffect
Certain effects need vertices that aren't being rounded to device
coordinates. So allow those to explicitly request that.
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
2bff7c5c71 Port OffscreenEffect to use RenderGeometry for geometry
This makes the code more explicit and allows using some of the new
features of RenderGeometry in OffscreenEffect.
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
622114dfb5 Move texture coordinate post processing into a method of RenderGeometry
This allows us to reuse the code in other places.
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
db7283ee5c Add default global vertex attribute layouts for GLVertex{2,3}D
This avoid some duplication when using GLVertex2D for geometry.
2023-01-16 09:51:28 +00:00
Arjen Hiemstra
c9b32afb1c Add a property to RenderGeometry that determines what vertex snapping mode to use
Currently, only two modes are provided, rounding or not rounding, which
allows explicitly disabling snapping. However, should we have a reason
to add more modes it is now fairly simple to change.
2023-01-16 09:51:28 +00:00
l10n daemon script
60d41538b7 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-16 02:00:47 +00:00
l10n daemon script
3b5ea6e798 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-15 01:55:25 +00:00
l10n daemon script
e12d9c1c6b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-14 17:31:49 +00:00
Xaver Hugl
9cd52b4060 backends/libinput: don't multiply v120 value by scroll speed
The value is a representation of the discrete steps a mouse wheel can take.
Multiplying that with a scroll speed destroys the whole purpose of the value.
2023-01-14 13:12:22 +00:00
l10n daemon script
31d20fab92 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-14 02:02:24 +00:00
Aleix Pol
a5aaa9e3c4 org.kde.KWin: Expose a window's UUID
Exposes a Window's UUID so that it can be used with other APIs like
window management or screencasting.
2023-01-13 17:51:36 +01:00
Ismael Asensio
fdd585e44c kcms/tabbox: Fix Reset not disabling Apply
Fix the code to get the actual saved shortcuts on KGlobalAccel
when discerning if they have changed.

Amends commit: 76ac4be316
2023-01-13 09:49:15 +00:00
Nicolas Fella
c9691b5855 kcms/tabbox: Don't offer switcher from global themes that don't actually ship a switcher
Some global themes, e.g. Breeze Dark, don't ship a switcher and instead point to the one from the Beeze global theme

They do show up in the selection though, which is confusing and doesn't actually work
2023-01-13 08:49:04 +00:00
l10n daemon script
392379163a SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-13 02:03:45 +00:00
Ismael Asensio
b11416c396 kcms/tabbox: Highlight non-default shortcuts
This sets the property on the shortcut widgets when they
should get highlighted: the option is selected in System
Settings and the shortcut is not the default.

It requires a change in `KXMLGui/KKeyShortcutWidget` to
actually paint the highlihgt ring.
(commit 47572c26, KF103)

CCBUG: 459318
2023-01-12 19:58:08 +01:00
Vlad Zahorodnii
73005fcd72 kcms/compositing: Improve wording of "allow tearing" option
When reading "allow tearing in fullscreen", I expect something after the
word "fullscreen". Either "windows" or "mode".
2023-01-12 13:30:58 +00:00
Ismael Asensio
76ac4be316 kcms/tabbox: Make shortcuts config save on apply
Currently, tabbox shortcuts are directly saved to KGlobalAccel
when they change, which is inconsistent with the rest of the
KCM and leads to confusion regarding Defaults and isSaveNeeded
status.

Let's instead manage the changes internally and just save them
to KGlobalAccel on Apply/Save.

m_actionsCollection is only used as a helpful way to store this
internal configuration, and doesn't really needs saving to
or restoring from config.

BUG: 459325
FIXED-IN: 5.27
2023-01-12 12:15:48 +00:00
l10n daemon script
b3776cef5b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-12 02:01:58 +00:00
Vlad Zahorodnii
fe1054a52a autotests: Fix a typo in testKeyboardShortcutsInhibitorInterface
We need to monitor whether the inhibitorActive signal gets emitted. It
reduces the test's execution time from about 5 seconds to a couple
milliseconds.
2023-01-11 20:34:27 +00:00
Xaver Hugl
b4e8d44967 remove some macros with questionable usefulness 2023-01-11 19:22:23 +00:00
Nate Graham
d312ee24b8 effects: always use Title Case for user-facing effect titles
Most already did, but these three did not, creating inconsistency.

BUG: 464122
FIXED-IN: 5.27
2023-01-11 12:03:51 -07:00
Aleix Pol
ddd60a0c1b backgroundcontrast: Guard against calling a nullptr
There are cases where GLVertexBuffer::map will return null (as seen in
kwinglutils.cpp:1816) which does happen (as seen in the backtrace of bug
462017)
Make sure we don't call the null map in that case.

BUG: 372305
2023-01-11 14:37:10 +00:00
ivan tkachenko
ea61a6f63a
effects/magiclamp: Fix window suddenly disappearing when reversing minimize animation
In this branch a new animation is being started, so a ref-guard needs
to be the same as in the similar branch for starting minimize animation
in the slot above.
2023-01-11 14:35:20 +03:00
ivan tkachenko
f4c3ae7c20
effects/magiclamp: Fix code style (add {braces} about if body) 2023-01-11 14:32:54 +03:00
Vlad Zahorodnii
301e57169d backends/drm: Fix surface and buffer damage order in qpainter output layers
The prototype of OutputLayer::endFrame() looks as follows

    virtual bool endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) = 0;

On the other hand, qpainter output layers use a different order in the
header file and the cpp file.
2023-01-11 11:14:59 +02:00
Vlad Zahorodnii
91bef430bf backends/virtual: Move glFlush() to endFrame()
It makes more sense in endFrame() rather than present().
2023-01-11 08:09:19 +00:00
Vlad Zahorodnii
ff53950a6d backends/virtual: Drop KWIN_WAYLAND_VIRTUAL_SCREENSHOTS
Virtual backend is used primarily by tests, there are plans to use it
for virtual outputs too. But in either case we don't need screenshots.

I also can't imagine how it can be useful as a debugging tool. It's more
convenient to spin a windowed kwin instance.

The main motivation behind this change is to get rid of custom code in
virtual output layers and simplify it a bit more.
2023-01-11 08:09:19 +00:00
Kai Uwe Broulik
af99b4e98c backends/x11: Present surface even with empty damage
All the other backends present their surface regardless.
If the surface isn't presented, the scheduled frame is never
finished, and rendering gets stuck indefinitely.

This is also consistent with x11 standalone backend
which forgoes this check.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2023-01-10 15:18:13 +01:00
Vlad Zahorodnii
0bd4851326 effects: Fix projection matrix logic in OffscreenEffect
WindowPaintData contains two projection matrices -
screenProjectionMatrix and projectionMatrix. I'm not sure why we have
two.

screenProjectionMatrix is initialized by the scene. While
projectionMatrix is usually updated by the effects. The two are not in
sync.

On the other hand, OffscreenEffect takes into account only
screenProjectionMatrix. It means that if a window is transformed by two
offscreen effects, the final result is going to be broken because
an OffscreenEffect must use the projection matrix specified by another
OffscreenEffect, which it doesn't.

This change cleans up projection matrix properties in WindowPaintData,
so there's only one projection matrix property. With that, offscreen
effects can be properly nested.

BUG: 462876
2023-01-10 12:05:28 +00:00
Nate Graham
0075f7bd16 Use more user-friendly terminology for border actions everywhere
The window rules KCM calls this "No titlebar and frame", but different
less user-friendly terminology is used for the context menu action and
the global action. Let's unify them using the more user-friendly name.

BUG: 464007
FIXED-IN: 5.27
2023-01-09 15:16:51 -07:00
Niklas Stephanblome
1f1e67f90b effects/overview: Correct size of active virtual desktop highlight outline
The focus outline that highlights the active virtual desktop in the Overview effect, as
well as the half-transparent outlines that are around the other virtual desktops, cover
2 pixels on every side of every virtual desktop thumbnail.

This is because an invisible rectangle is used that has the same size as the thumbnail
and has a colored border, but borders are always drawn on the inside of QML rectangles,
so content in the thumbnail is covered up. Therefore, the width of the rectangle has to
be slightly adjusted to account for the thickness of the border.

BUG: 450963
FIXED-IN: 5.27
2023-01-09 16:29:52 +00:00
l10n daemon script
2f8e2ef689 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-09 02:00:23 +00:00
Xaver Hugl
2525109f1a window: use std::unique_ptr to manage the windowitem 2023-01-07 21:52:10 +01:00
Xaver Hugl
797bcb8bda window: use std::unique_ptr to manage the effectwindow 2023-01-07 21:52:10 +01:00
Xaver Hugl
3c8d2d6f18 window: use std::unique_ptr to manage the shadow 2023-01-07 21:52:10 +01:00
Weng Xuetian
6e87fae7f7 Support XKB_CONTEXT_NO_SECURE_GETENV flag
Since kwin play with CAP_SYS_NICE, secure_getenv will fail for xkbcommon
to load user level xkbmap. This allows kwin to load config under
~/.config/xkb

BUG: 447206
2023-01-07 11:35:42 +00:00
l10n daemon script
97041dab12 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-07 02:06:50 +00:00
Vlad Zahorodnii
b0e452563b kcms/effects: Fix effect loading/unloading order
There are effects that are mutually exclusive, e.g. magnifier and zoom.
They both use the same global shortcuts.

When switching from zoom to magnifier, the zoom effect must be unloaded
first, then the magnifier effect can be loaded. Doing so in the opposite
order will break global shortcuts in the magnifier effect because
zooming shortcuts are still bound by the zoom effect.

BUG: 457800
2023-01-06 13:41:38 +00:00
Nate Graham
6a1552efb6 utils/xcbutils: reduce severity of "precision lost" message a debug
Right now this is marked as critical, but it's not a critical error.
Make it a debug to avoid spamming logs with not-very-actionable
information.

BUG: 463259
FIXED-IN: 5.27
2023-01-05 13:59:43 -07:00
David Edmundson
1651b7d1d7 Include layer postPaint in render loop timings
We need render timings in the journal to be as close as possible to the
entirity of the composite function up until the backend presenting.
2023-01-05 14:41:43 +00:00
Han Young
d57495c8df Remove tablet tool when the tablet device is removed
Explicitly remove the tablet tool device when the corresponding sys event interface is removed.
2023-01-05 14:40:46 +00:00
David Edmundson
0167b7d7b0 libinput: Ignore touch events without outputs
A touch device could have no output object assigned due to the screen
being disabled, queued events or malconfiguration.

Using output would crash. Touch up is guarded so that we have matching
pairs.

BUG: 463385
2023-01-05 08:29:06 +00:00
l10n daemon script
8675ee5939 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-05 02:00:53 +00:00
Nicolas Fella
54e384e68e Enable scripted effects to load config translations from the kpackage
By default translations are loaded from /usr/share/locale. This works fine for builtin effects
since we install our translations there.

However, it doesn't work for third-party scripted effects. They only provide a kpackage and can't
install anything to /usr/share/.

This patch allows them to ship translations in contents/locale/$language/LC_MESSAGES/$domain.mo,
where $domain is the X-KWin-Config-TranslationDomain metadata value

This matches what Plasma does for applets since https://phabricator.kde.org/D5209

CCBUG: 317338
2023-01-04 21:35:59 +01:00
Nicolas Fella
a40dd9a158 Only make startup notification change the virtual desktop if requested
Startup notifications optionally contain the target desktop the app should be launched to.

If present the window is sent to that desktop, if not it is sent to the current desktop.

Later in Workspace::activateWindow we check if the window is on the current desktop, and if not
we either move it to the current desktop or switch to the window's desktop depending on user preference.

However, this is broken because the window was already moved to the current desktop. To avoid this
only move the window if specifically requested by the startup id.

BUG: 462996
2023-01-04 12:12:26 +00:00
Vlad Zahorodnii
b549776b68 scene: Avoid creating SurfaceItem for Xwayland's cursor surfaces
SurfaceInterface::scaleOverride() doesn't scale the bufferScale, so if the
scale override is 2, but the buffer scale specified by the client is 1,
bufferScale() will return 1.

Xwayland cursor surface implicitly relied on this behavior.

Porting cursor to SurfaceItem changed that. Now cursor surfaces honor
the scale override, which makes Xwayland cursors too small.

In order to properly fix, plasma has to scale Xcursor.size in xrdb. The
problem is that plasma also sets XCURSOR_THEME and XCURSOR_SIZE envvars
that take precedence. Plasma must stop setting those envvars, but it's
doable only with Qt 6.5, which got MouseCursorTheme and MouseCursorSize
hints in QPlatformTheme.
2023-01-04 11:10:32 +00:00
Vlad Zahorodnii
c10b35facb backends/wayland: Pass linux-dmabuf buffers for cursor layer
This lets us avoid reading fbo data back.
2023-01-04 09:19:12 +00:00
Vlad Zahorodnii
9f100e8292 core: Make Output::setCursor() take CursorSource
It decouples the contents of the cursor from QImage.
2023-01-04 09:19:12 +00:00
Vlad Zahorodnii
d8e6992512 tiling: Fix invalid sender object in connect()
RootTile is a CustomTile and it has no parent because it's the root.
Therefore the sender object in connect() will be null and it's going to
produce a warning.
2023-01-04 09:00:44 +00:00
Oliver Beard
7b714bdecb plugins/nightcolor: Use Night Color icon for preview OSD 2023-01-04 04:26:40 +00:00
l10n daemon script
824ef8a74e SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-04 02:02:56 +00:00
Xaver Hugl
885e3712fc useractions: add "Move to Activity" entries
This mirrors the menu in the task manager and makes it a lot more convenient
to send windows to the correct Activity

BUG: 440036
2023-01-03 23:12:18 +00:00
Xaver Hugl
6e13e21a08 workspace: take touch and tablet into account for active output follows mouse
While not technically fitting for the name of the option, the behavior is what a user
would expect and it also matches with X11 (where the cursor goes to the touch position).
2023-01-03 20:01:11 +00:00
Vlad Zahorodnii
fb1a6ecd8d backends/drm: Fix buffer centering with active hardware transform
Prior to beb6cca65d, the drm backend used
to specify QRect(0, 0, modeSize.width(), modeSize.height()) CRTC rect,
so we didn't have to care about buffer transforms, but now that we
compute the CRTC rect from the buffer size, we have to take the buffer
transform into account.

It fixes squashed output contents when the output is rotated 90 or 270
degrees and it uses hardware transforms.
2023-01-03 17:36:21 +00:00
Vlad Zahorodnii
88563cbc8e scene: Remove addDamage() in SurfaceItem::discardPixmap()
Scene::Window::discardPixmap() used not to add damage. No idea how it
got in SurfaceItem::discardPixmap(). Perhaps a mishap when introducing
window items.

From logical point of view, adding damage when discard a pixmap is not
necessary too because a new pixmap is going to be created.
2023-01-03 11:55:36 +00:00
Vlad Zahorodnii
3725d67ee1 scene: Introduce cursor item and scene
The cursor scene contains the contents of the cursor. It contains a
CursorItem. The CursorItem either creates a SurfaceItem or an ImageItem
based on the currently attached CursorSource.

The cursor item is rendered by the cursor scene. For now, wherever the
cursor must be rendered, a dummy scene delegate is constructed. It's not
nice but it's a pretty cheap operation. There's a lot of potential for
clean up by moving cursor layer handling from output backends to
compositor. The main reason why there are no persistent scene views is
that it's just easier than tracking when they are actually used, e.g.
after switching between hw and sw cursor.

The software cursor fallback is a bit tricky case. It made to work by
constructing a scratch fbo. The cursor scene is rendered in the scratch
fbo, which is then rendered on the screen. Similar to the case above,
there's space for improvements, but I don't think it has to block the
effort for reusing Items to render the cursor.
2023-01-03 09:33:17 +00:00
Vlad Zahorodnii
dda77f5942 scene: Introduce ImageItem
The ImageItem provides a way to integrate an image in the scene graph.
2023-01-03 09:33:17 +00:00
Oliver Beard
036a66f996 plugins/nightcolor: Use Night Color icon for OSD
This makes the OSD message for Night Colour inhibition use the same icon as the tray applet.

I'm not sure where the original icon `preferences-desktop-display-nightcolor-off` is, but it would seem a good idea to remove it?
2023-01-03 09:00:32 +00:00
Xaver Hugl
d49cb64231 scene: ensure OpenGL texture is updated after direct scanout
While direct scanout happens, the damage of the SurfaceItem is reset, which
can cause the OpenGL texture to not be updated once direct scanout ends,
and leave the texture outdated until the surface is damaged again.
In order to fix that, make sure the texture is always fully updated after
the SurfaceItem has been used in direct scanout.
2023-01-02 12:57:13 +01:00
Steve Leung
501a45a869 scripting: log callDBus errors at warning level
If `callDBus` hits a problem, KWin will log a debug message saying that an error occurred, but it does not log the actual error message.  This makes troubleshooting KWin scripts more difficult.

Since the call failed, log the message at warning level to make it more visible.
2023-01-02 09:25:13 +00:00
Vlad Zahorodnii
58916aac4e tabbox: Remove Xcb::sync()
TabBox::hide() used to contain the following code

    QApplication::syncX();
    XEvent otherEvent;
    while (XCheckTypedEvent(display(), EnterNotify, &otherEvent))
        ;

The purpose of XSync() is to flush any pending requests and wait until
the X server processes them. After that, we can go through event queue
to find relevant events.

Why did tabbox go through the event queue to find the EnterNotify
events? It's unclear. So it was removed in
b4c957b617. However, the XSync() call was
left out. It doesn't make sense on its own. So remove it too.
2023-01-02 08:28:47 +00:00
l10n daemon script
8e140db62e SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-02 02:31:51 +00:00
l10n daemon script
752f565521 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2023-01-01 02:21:02 +00:00
Andreas Cord-Landwehr
ee87e8699d Include missing cmath header for std::round
Fixes compilation on Yocto Kirkstone.
2022-12-31 12:18:27 +00:00
Parag W
6352173651 Fix compile failure without XINPUT
Declare and reference m_xinputIntegration only if HAVE_X11_XINPUT is defined and enabled.
2022-12-31 11:19:45 +00:00
Xaver Hugl
beb6cca65d backends/drm: support hardware scaling with direct scanout 2022-12-30 18:16:26 +00:00
Niklas Stephanblome
39612ade13 effects/overview: allow entering spaces in search field
In the Overview effect, pressing the space bar doesn't always insert a
space character into the search field as one would expect; when the text
in the search field matches any windows, it instead activates the
highlighted window. At other times, it does insert a space as expected.

This behavior is unpredictable and unintuitive, so this commit fixes the
issue by intercepting the key input event and inserting a space when the
search field has focus. In this state, the highlighted window can be
activated using the enter/return key. When the search field doesn't have
focus, a press of the space bar will continue to activate the selected
window.
2022-12-30 17:44:48 +00:00
Xaver Hugl
239207c5ee backends/drm: extend connector lifetime to match their outputs
As disconnected outputs outlive DrmGpu::updateOutputs, the DrmConnector
and DrmPipeline must also be kept valid for that time

BUG: 463334
2022-12-30 14:53:45 +00:00
Nicolas Fella
ccaf0210d1 Ignore critical notifications in window heap effects
We filter out regular notifications, but critical notifications are their own window type, so we need to explicitly filter them too

BUG: 463437
2022-12-30 10:47:09 +00:00
l10n daemon script
fddd65deda 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-12-30 02:09:12 +00:00
Joshua Goins
37adc06603 wayland: Send tilt and rotation events, if supported
While tilt is sent on X11, we're currently only sending pressure events and not tilt/rotation events on Wayland. Since Krita is still running in X11, and it's running through XWayland - it's technically a Wayland client and gets no tilt/rotation. This fixes that issue :-)

I saw !3231 which was working on complete Wayland tablet support, but it's been stagnating. I just wanted tilt & rotation support now, so I added a way to query capabilities from the `m_capabilities` variable on the private interface we already fetched.

Tested on Krita using the Tablet Debug Log.
2022-12-30 01:57:25 +00:00
Xaver Hugl
40ca578bd0 workspace: don't make the placeholder output too big
The size is used in NETRootInfo::setDesktopGeometry, which seems to cause
some applications to misbehave or even crash because they attempt to create
a texture larger than what the GPU supports

CCBUG: 461848
2022-12-29 21:19:04 +00:00