Commit graph

23145 commits

Author SHA1 Message Date
Vlad Zahorodnii
8b4ffd5cc9 wayland: Relax conditions in strut edge heuristics
When the output layout changes, it's possible that the bottom panel
will float in the middle of the screen, e.g. left edge of the panel
touches the left screen edge while top and bottom panel edges touch no
screen edge.

In that case, XdgToplevelWindow::strutRect() will erroneously indicate
that the left strut rect is valid, while it's not.

Since the strut area is garbage, Window::checkWorkspacePosition() may
incorrectly move and resize windows during output layout change.

The proposed heuristic will fail with square panels, but those are rare
and the only way to detect the correct strut area would be to use the
layer shell protocol.
2022-09-02 17:54:15 +03:00
Vlad Zahorodnii
82c09653aa Move xcursortheme.{h,cpp} to utils/
utils/ seems like a better place for this helper.
2022-09-02 11:06:49 +00:00
Aleix Pol
4f20e9216f Make it possible to raise windows on top of the lockscreen
Requires clients to have the
X-KDE-Wayland-Interfaces=kde_lockscreenallowed_v1 set in their desktop
file, then they will be able to use the kde_lockscreenallowed_v1
protocol to raise any surface above the lockscreen.
The protocol has only 1 method, raise_surface to do exactly that.

Makes it possible to implement
https://invent.kde.org/teams/plasma-mobile/issues/-/issues/98
2022-09-02 10:48:49 +00:00
Aleix Pol
123549f8f3 Move the lockscreen's layer on wayland
On wayland, we are already restricting the rendering of windows that
aren't supposed to be shown when locked, so we don't need to keep the
lock screen on the unmanaged layer.
2022-09-02 10:48:49 +00:00
Vlad Zahorodnii
a3dcecef7a Fix getting old screen area in Window::sendToOutput()
Workspace::clientArea(clientAreaOpt, Window) uses the current output,
while we need the current move resize output.
2022-09-02 09:29:51 +00:00
David Redondo
2f03d1f940 buttonrebinds: Fix Meta modifier
Devices send evdev keycodes not xkb keycodes.
2022-09-02 08:29:27 +00:00
Vlad Zahorodnii
e22c6160fa Avoid mixing current and next fullscreen states more
Mixing those two can make fullscreen mode behavior undefined.
2022-09-02 07:48:55 +00:00
Vlad Zahorodnii
4a6e416289 Avoid mixing current and next maximize modes more
Mixing those two can make maximize mode behavior undefined.
2022-09-02 07:48:55 +00:00
Fushan Wen
c1b3fe1143 effects/overview: remove unneeded Accessible.name
It's implicitly set by text property.
2022-09-02 07:06:26 +00:00
Vlad Zahorodnii
16d9a08f85 Ensure that Window::output() is always in sync with the frame geometry
plasmashell may see new output layout before kwin_x11 and move desktop
windows accordingly. If that happens, the desktop windows will have old
outputs in Window::output() property because the Workspace doesn't
re-check outputs if the output layout changes.

In order to fix the Window::output() property getting out of sync,
re-check the current output after the output layout changes. It should
also fix a visual glitch in the slide effect caused by
EffectWindow::screen() not being correct.
2022-09-02 06:46:38 +00:00
Vlad Zahorodnii
6cc4b799f4 wayland: Use correct output when sending xdg_toplevel.configure_bounds
We should use the next output rather than the current output.
2022-09-02 06:46:38 +00:00
Vlad Zahorodnii
0be0e8a7b0 Add Window::moveResizeOutput()
The Window::moveResizeOutput() property is used to track the output
where the window is expected to land after the move or resize operation
completes.

This can be used to decouple the current output from the next output,
which allows us to send better xdg_toplevel.configure_bounds events or
make windows stick to outputs while keeping Window::output() in sync
with the current output layout.
2022-09-02 06:46:38 +00:00
Laurent Montel
0ea72e9275 Remove extra ';' 2022-09-02 08:27:52 +02:00
Nate Graham
3cf7737042 effects: add Meta+plus as a default shortcut for Zoom effect
Right now the Zoom effect's "zoom in" action is bound by Meta+Equals,
which makes sense for ANSI US keyboards without numberpads which make
you hit the Shift key before you can get a plus sign, and pressing it
without Shift gets you an Equals sign.

But some ANSI US keyboards have a numberpad with a Plus key, and many
other keyboards without numberpads also have a Plus key, so we should
allow users of those keyboards to trigger "zoom in" as easily as users
of ANSI US keyboards.
2022-09-01 12:21:44 -06:00
Arjen Hiemstra
345736735e Add a fallback path for input when there is no text-input
An application that does not support text-input has no way of
communicating with the input method, so even if you show the input
method the application receives nothing. As a fallback, instead send
fake key events so the application still gets something at least.

The key events are synthesised based on the text string that the
input method sends, which may result in things that do not actually
correspond to real keys. Unfortunately I do not see a way around that.

CCBUG: 439911
2022-09-01 14:41:51 +00:00
Arjen Hiemstra
076203c926 Move keycodeForKeysym from ButtonRebindsFilter into Xkb
So we can use it in other places
2022-09-01 14:41:51 +00:00
Yuri Chornoivan
31cf10a6aa Make the tip consistent with label 2022-09-01 16:53:06 +03:00
Vlad Zahorodnii
207a16f14f backends/drm: Fix software cursor fallback in DrmOutput::renderCursorOpengl()
We need to return if the cursor sprite is bigger than DrmGpu::cursorSize().

BUG: 458036
2022-09-01 13:11:13 +00:00
Vlad Zahorodnii
df79d68309 backends/drm: Port from kwinApp()
kwinApp() lives in abstraction layer above and we can use
QCoreApplication to terminate the application.
2022-09-01 12:49:39 +03:00
Vlad Zahorodnii
2d2f972bff Fix loading xcursor themes with invalid Inherits field
Xcursor loading can get stuck in an infinite recursion if index.theme
file indicates that the theme inherits itself.

In order to prevent that, keep track of the loaded so far themes and
avoid loading already loaded themes.

BUG: 457926
2022-09-01 10:12:17 +03:00
Xaver Hugl
245eb822c7 autotests/xdgshellwindow: remove timeout for outputEnteredSpy
The timeout makes the test fail wrongly sometimes and isn't needed. Instead
assume the window always gets placed on the first output
2022-09-01 06:43:09 +00:00
Xaver Hugl
ba0799974e workspace: restore window position after output changes
BUG: 455066
BUG: 374908
CCBUG: 444082
CCBUG: 454003
CCBUG: 453589
2022-08-31 22:30:13 +02:00
Natalie Clarius
8e8b614500 plugins/nightcolor: add configurable day temperature
BUG: 390021
2022-08-31 18:58:07 +00:00
Natalie Clarius
6b38b03724 Add new option for behavior when window on different desktop is activated
When a window that is on a different virtual desktop than the current one gets
activated, the current behavior is that the active virtual desktop will be switched
to the one the activated window is on. This may seem reasonable for a scenario where
the user explicitly intends to activate an existing window on a different desktop.
However, the following scenario is also (perhaps even more?) common: When an
application responds to a launch command by requesting to activate an existing
instance instead of opening a new one (such as Firefox or KDE System Settings), an
existing window on any desktop will get activated even when what the user had in
mind was opening a new window (on the desktop they are currently in). 

This means that opening an application, such as following a URL or accessing a
system setting, unexpectedly results in the user being teleported to a different
virtual desktop. This can be very irritating. The more expected behavior for these
users would be to have windows always open on the desktop where they are called
from. That's is what this commit adds as a new option.

BUG: 438375
FIXED-IN: 5.26
2022-08-31 18:57:21 +00:00
Xaver Hugl
3973b7401d window: keep positions of windows with special states in checkWorkspacePosition 2022-08-31 11:32:30 +00:00
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