Commit graph

23470 commits

Author SHA1 Message Date
Xaver Hugl
043ebee9e3 window: simplify sendToOutput 2022-08-31 11:32:30 +00:00
Xaver Hugl
2b2d382ed1 window: add keepInArea variant that doesn't modify any window state 2022-08-31 11:32:30 +00:00
Xaver Hugl
3fff256b88 window: make resizeWithChecks not modify any window state 2022-08-31 11:32:30 +00:00
Xaver Hugl
5a3321be89 window: don't touch geometry restore in Window::sendToOutput
It's no longer used by checkWorkspacePosition
2022-08-31 11:32:30 +00:00
Xaver Hugl
e195d42916 backends/drm: ensure pipeline mode is always in the connector mode list
The current mode of an output not being in its mode list can lead to crashes
2022-08-31 09:18:59 +00:00
Vlad Zahorodnii
a9d51ab2f3 Refactor geometry handling in interactive move/resize handling func
Window::handleInteractiveMoveResize() calls setMoveResizeGeometry(),
which breaks in a way the encapsulation.

This change refactors geometry handling in handleInteractiveMoveResize()
so the next geometry is computed in a temporary variable and the move
resize geometry is updated either using move() or
doInteractiveResizeSync().
2022-08-31 10:05:21 +03:00
Vlad Zahorodnii
d6706c5ce4 wayland: Prevent sending xdg_output properties if wl_output is removed
If the wl_output has been removed, kwin can crash all Qt clients by
sending a wl_output.done event. Also, it makes no sense to send output
events after the corresponding output has been removed.

CCBUG: 451028
2022-08-30 12:56:47 +00:00
Marco Martin
4fe0bda4db compare with cend
we are searching between m_oldScreenGeometries.cbegin() and
m_oldScreenGeometries.cend(), so the result can't be compared
with m_oldScreenGeometries.end()
2022-08-30 14:00:38 +02:00
Vlad Zahorodnii
498bde9c6e xwayland: Remove text/x-moz-url and _NETSCAPE_URL mime converters
The xwayland data bridge tries to be helpful and convert some mimes.
However, that mime conversion code is buggy, and it appears like
Thunderbird can send text/x-moz-url in format, which our bridge doesn't
handle properly.

However, mime type conversion is completely out of the scope of the
compositor. We also can't keep up with various mime types. Given that
X11 clients already must handle _NETSCAPE_URL and text/x-moz-url, this
change removes our mime type conversion helpers. For the record, neither
wlroots-based compositors nor mutter perform such conversion either.

With this change, kwin will send text/x-moz-url and _NETSCAPE_URL data
as is.

BUG: 458226
2022-08-30 09:18:47 +00:00
Vlad Zahorodnii
0bf1183286 Emit Output::scaleChanged() when the state changes
The scaleChanged signal was overlooked.
2022-08-30 11:57:47 +03:00
Xaver Hugl
c4b9626117 backends/drm: replace manual IN_FORMATS parsing with libdrm functions
!2819 reminded me that it's time to replace this mess with libdrm functions

Upstream MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/146
2022-08-30 08:30:01 +00:00
l10n daemon script
71b53ca5b0 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-08-30 01:45:00 +00:00
Heiko Becker
3eaf811352 CMake: Require at least plasma-wayland-protocols >= 1.8
It needs [1] from plasma-wayland-protocols.git or fails with
"outputmanagement_v2_interface.cpp:214:50: error:
'error_already_applied' was not declared in this scope" otherwise.

[1] f882bd942283262c27811a937e0d674d365ed72a
2022-08-29 20:28:26 +02:00
ivan tkachenko
9e7fa0d0b7
effects/private: Fix stacking order and initial visibility for windows pinned to all desktops 2022-08-29 14:34:01 +03:00
Vlad Zahorodnii
6897f9a1e0 Port Window from Screens
The Window uses the Output which is stable and should not require us
connecting Screens::change anymore.
2022-08-29 11:01:33 +00:00
Natalie Clarius
e840617047 plugins/nightcolor: fix wrong transition time update in location mode
BUG: 412211
2022-08-29 09:17:32 +00:00
Natalie Clarius
ae05d5e654 plugins/nightcolor: change time handling to allow for arbitrary morning and evening times
BUG: 445758
2022-08-29 09:17:32 +00:00
Vlad Zahorodnii
76f3e1ec20 Drop Output::updateEnablement()
It's unused since moving placeholder output handling to the workspace.
2022-08-29 09:54:05 +03:00
Vlad Zahorodnii
c6de04773c Make Output fields protected
It's far more practical in Output subclasses than private access modifier.
2022-08-28 14:30:24 +00:00
Vlad Zahorodnii
ed49d7c59b Refactor output state setting
If multiple properties that affect the geometry change, then the
Output::geometryChanged() signal will be emitted multiple times, which
in its turn may force the Workspace to re-arrange windows, etc.

With this, the geometryChanged signal will be emitted in more expected
fashion only once as long as relevant property changes are batched.
2022-08-28 14:30:24 +00:00
ivan tkachenko
e9cd8be36d
UserActionsMenu: Use an icon for the "Move to Desktop" -> "New Desktop" action
Taken from a pager applet, where all actions have icons. Worth porting
to task manager as well.
2022-08-28 15:33:07 +03:00
Xaver Hugl
a1ed313a42 backends/drm: move placeholder output management to Workspace
Backends aren't the right layer to take care of placeholder outputs, and
don't really have enough information to do it either. This also fixes a
crash, because the placeholder output currently gets created too late
2022-08-27 20:30:27 +02:00
Vlad Zahorodnii
070f63c451 Drop Screens::geometry() and Screens::size()
Currently, the main user of these two functions is the X11 standalone
platform.

This change ports that code to Workspace::geometry(), which is not great
but the X11 backend already depends on the Workspace indirectly via the
Screens. Not sure if it's worth making the standalone X11 backend track
the xinerama rect internally.
2022-08-27 13:51:37 +03:00
Vlad Zahorodnii
1baa267127 Remove dpms_interface_p.h
Its contents can be put in the corresponding cpp file as DpmsInterface
is not needed elsewhere but the cpp file.
2022-08-27 10:35:31 +00:00
Vlad Zahorodnii
a5ac7cf0ae scripting: Port ClientModel V2 from Screens 2022-08-27 09:21:44 +00:00
Vlad Zahorodnii
018a41a123 wayland: Fix lease termination in wp_lease_v1_destroy()
If a drm lease is destroyed, e.g. the app has unexpectedly terminated,
only the finished event will be sent. The leaseRevoked signal won't be
emitted so the drm backend can't clean up DrmOutput::m_lease. Since
m_lease can be a dangling pointer, the drm backend can crash in
DrmGpu::updateOutputs() when it tries to determine if m_lease is still
alive and was not terminated by closing the lease fd on the client side.
2022-08-26 16:07:49 +03:00
Vlad Zahorodnii
b9bc1479f8 wayland: Make the dpms protocol use Output directly
It simplifies the dpms protocol implementation by making it use the
Output directly. It also removes unrelated code in WaylandOutput and
OutputInterface that can be used for future cleanups, e.g. removing
WaylandOutput.
2022-08-25 16:01:38 +03:00
Vlad Zahorodnii
eeb701bfe3 Add KWin::Output handle to OutputInterface
That's a necessary change for further output related refactorings. It
also allows us to simplify some OutputInterface to Output mapping code.
2022-08-25 15:08:20 +03:00
Vlad Zahorodnii
ace5b58f7a Drop Platform::{outputEnabled,outputDisabled} signals
Use Output::enabledChanged signal to determine if an output is enabled
or disabled.
2022-08-25 06:35:55 +00:00
Vlad Zahorodnii
f956d701c4 Port Workspace to Platform::{outputAdded,outputDisabled} signals 2022-08-25 06:35:55 +00:00
Vlad Zahorodnii
b0340dc774 Move primary output to Workspace
Primary output is a window management abstraction, not a hardware
abstraction so move it in Workspace where it belongs.
2022-08-25 06:35:55 +00:00
Volker Krause
7c22e6435c Adapt to Qt6 QQuickRenderControl API changes 2022-08-24 15:15:34 +00:00
David Redondo
bc792a2bc8 Allow rebinding of extra mouse buttons
Some mice have more than the three standard buttons. While some applications
can use a subset of those (mostly the backwards and forwards buttons) in many
cases pressing them will do nothing. This makes it possible to assign key
combinations to buttons that will cause synthetic key event when pressed.
2022-08-24 08:44:31 +00:00
David Redondo
80d28499e1 libinput/device: Use button mapping that is used in input handling for supported buttons
Fixes and prevents inconsistencies between those.
2022-08-24 08:44:31 +00:00
Nicolas Fella
938b8c87a1 Remove unused license file 2022-08-23 17:41:55 +02:00
Nicolas Fella
4fe4ed9041 Add missing license files 2022-08-23 17:40:23 +02:00
Nicolas Fella
f3c2223190 Fix SPDX identifier for CC0 license 2022-08-23 17:40:09 +02:00
ivan tkachenko
0f20e4b838
effects: Fix windows visibility during partial activation (realtime gesture)
Makes partial state account for both initial- and active-hidden status.

This fixes the case when activeHidden windows would show up during a
gesture even though they should disappear when the gesture completes.
2022-08-23 16:59:17 +03:00
ivan tkachenko
9e4926bf34
effects/private: Simplify "active-hidden" state by inheriting from "initial-hidden"
This does not fix anything per se, just strips some unnecessary lines
and extra ensures zero opacity to other items.
2022-08-23 16:59:17 +03:00
ivan tkachenko
3a406dd451
effects/private: Rename property 'hidden' to 'activeHidden'
This is done to better reflect its relation to the
complementary 'initialHidden' property.
2022-08-23 16:59:17 +03:00
ivan tkachenko
56530ce939
effects: Fix initial hidden state: also initially hide windows from other desktops
This fixes the case in Show All Windows (F10) and Show Windows of
Current App (F7): non-minimized windows from other desktops suddenly
pop-up at the start of these effects instead of remaining hidden.

Note: don't test this with full-screen/maximized windows open on current
desktop otherwise you probably won't see any difference.
2022-08-23 16:59:16 +03:00
ivan tkachenko
73fa0d124f
effects: Fix stacking order of windows relative to panels
Make windows thumbnails use their native stacking order as a 'z' value
for current desktop while lowering windows from other desktops.

By lowering others instead of raising current ones we get to use
stacking order compatible with desktop & dock/panel window types.

For now they are drawn separately, so this change doesn't do much on its
own, but it would become useful during refactoring when putting all
windows (regular and panel types) in a single parent with shared z stack.
2022-08-23 16:59:16 +03:00
Xaver Hugl
d54aaf5aaa workspace: restore cursor position after output changes 2022-08-23 12:15:33 +02:00
Vlad Zahorodnii
a32869594e Fix some -Wunused-variable warnings 2022-08-23 10:54:39 +03:00
Vlad Zahorodnii
b01cfb8514 wayland: Merge WaylandOutputDeviceV2 and OutputDeviceV2Interface 2022-08-23 07:18:39 +00:00
Kai Uwe Broulik
b0423c32ac window: Create palette only when needed
Creating a `DecorationPalete` (e.g. the `KColorScheme` inside) is
relatively expensive. Currently, this is done once a client is mapped,
regardless of whether it actually has a server-side decoration.

This change makes it create the palette only when it is actually used,
e.g. the window indeed has a server-side decoration or when the user
actions menu is invoked.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-22 08:38:29 +02:00
l10n daemon script
8ca6170c91 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-08-22 01:46:04 +00:00
ivan tkachenko
fc757be20a
effects/desktopgrid: Fix grid's size and scale w.r.t. row/column spacing
This patch makes grid actually account for the spacing, so that when
fully shown it won't cut off bottom or right edge of desktops. It can
be easily seen with a wallpaper that has visible features on the edges
such as borders, or by settings rowSpacing & columnSpacing to an
absurdly high value.
2022-08-19 23:43:02 +03:00
ivan tkachenko
5af891ec8e
effects/desktopgrid: Replace PlasmaCore.Units.largeSpacing with gridUnit
It's broken and equal to a grid unit, all existing usages must ported
one way or another. Using `smallSpacing * 2` (the intended value of
largeSpacing) results in a gap that is too narrow to be consistent when
scaled down between multiple desktops.
2022-08-19 23:42:58 +03:00
Kai Uwe Broulik
c7e156165d inputmethod_v1_interface: Use RamFile for passing keymap to clients
This uses a sealed anonymous file (memfd) instead of a `QTemporaryFile`,
which is more efficient.

Ideally, this file was also reused if the keymap didn't change.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-19 15:26:25 +02:00