Commit graph

23130 commits

Author SHA1 Message Date
Eric Edlund
634182d489 Move gesture direction to base class 2022-09-11 00:09:44 +00:00
Eric Edlund
d29c7a6c2b Merge gesture structs/enums
- Now only 1 GestureDirection enum
- Now only 1 registerGesture() call
- The 4 kinds of gesture (Pinch/Swipe) and (Touchpad/Touchscreen) in globalshortcuts.h/cpp are merged into 1 GestureShortcut
- Change from range to set of finger counts in gestures

No behavior should change, just a refactor.
2022-09-11 00:09:44 +00:00
ivan tkachenko
fe1f720307
effects/outputlocator: Show connector name for monitors with identical everything
See also: https://invent.kde.org/plasma/kscreen/-/merge_requests/129

BUG: 450344
2022-09-10 13:19:38 +03:00
Natalie Clarius
2ebbe42aae kcm/kwinrules: fix broken help page link 2022-09-09 15:27:19 +00:00
Natalie Clarius
b2e7a24ab4 kcm/kwineffects: fix broken help page link 2022-09-09 15:27:19 +00:00
Natalie Clarius
d2ec8ac643 kcm/kwindesktop: fix broken help page link
BUG: 458767
2022-09-09 15:27:19 +00:00
Mikhail Vinogradov
45486ce515 tabbox: don't hide panels when highlighted as the only item in the tabbox
When we have 0 opened apps, tab box only shows "Show Desktop". That element is a
special entry in the alt+tab list for minimizing all windows. When highlighting
it, panels temporarily become hidden, which does not make sense to do when it is
the only item in the tab box. In this case, do not temporarily hide the panels.
2022-09-09 13:39:14 +00:00
Vlad Zahorodnii
287ad9561d scripting: Add null window guard in WorkspaceWrapper::clientArea()
Workspace::clientArea(clientAreaOpt, Window*) expects a valid pointer.

BUG: 458598
2022-09-09 06:10:56 +00:00
Aleix Pol
006ee8b87a inputmethod: Allow forcing the display of the input method
This makes it possible to show the input method when using a client that
doesn't support Wayland input methods (e.g. Xwayland).

This adds 2 dbus API entry points:
- activeClientSupported property: That tells us if the current client
doesn't support text-input-v*
- forceActivate method: forces the activation of the input method. This
configures the input method in a state that we can use to forward the
input method's keystrokes to the client, emulating a hardware keyboard.

BUG: 4399911
2022-09-08 23:30:16 +02:00
Xaver Hugl
d659f4bfd7 workspace: don't crash without outputs
BUG: 458892
2022-09-08 22:46:17 +02:00
Marco Martin
a0385c330b updateAllowedActions when going in/out fullscreen
when going in/out of fullscreen call updateAllowedActions to notify the
decoration of eventual allowed actions changed. this makes the shade
button reappear as needed

BUG:458844
2022-09-08 19:45:55 +00:00
David Edmundson
7927b17d40 Avoid rounding issues in Surface damage tracking
When a buffer is damaged via damage_buffer we have to map things to
logical space. This mapping can involve floating numbers, most notably
with the X11 override, right now that's via a QRegion which is always
integer. For damage we always want to round outwards to the larger
space, not to the nearest space.
2022-09-08 16:18:12 +01:00
Vlad Zahorodnii
33827bbdbe autotests: Fix internal connection teardown
This might be the root cause of random ASAN errors in testQuickTiling.

From commit 617291c6974d232ee99c4c49e891ce16863e3d6e:

The internal EventQueue is a child of the registry object. This means
that after the registry is destroyed, all proxy objects in that event
queue are going to have invalid reference to it, which is not a problem
as long as the wl_display_dispatch() function is not called.

The wl_display_dispatch() function uses wl_proxy's queue reference to
enqueue incoming events to that queue.

Unfortunately, during teardown, the internal ConnectionThread may
dispatch events right after the registry object has been destroyed,
which can lead to a crash.

In order to fix the crash, we need to destroy all proxy objects and only
after that we can destroy the event queue. It's okay if wayland events
are dispatched in between.

i.e. the EventQueue object must be destroyed last to ensure avoid hitting
dangling pointers.
2022-09-08 10:16:35 +00:00
Vlad Zahorodnii
e40bdc9016 autotests: Simplify tearing down ConnectionThread
It should be enough to call QObject::deleteLater() and wait until the
connection thread stops spinning its event loop.
2022-09-08 10:00:20 +00:00
Kai Uwe Broulik
63258ab076 kcmkwin/kwintabbox: Remove API not supported by KWin core
WindowThumbnailItem in scripting doesn't support any of the
'brightness', 'saturation', 'clipTo' anymore, so it makes
no sense to support it in the KCM's preview.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-09-08 06:43:02 +00:00
Yuri Chornoivan
354c0e350f Fix minor typos 2022-09-08 08:43:44 +03:00
Natalie Clarius
1598cecc8e doc/windowbehavior: improve help page for window behavior kcm
- add missing entries for focus delay and multiscreen behavior
- add missing entries for window placement modes maximized and under mouse
- add missing entries for mouse actions
- remove entry for removed "display window geometry when regeometrizing" option
- reword explanation for window raising
- extend explanations for window placement
- hint at screen edges kcm in movement section
- hint at window rules in advanced section
- add more keywords
- some small wording, typographical and formatting changes
2022-09-07 19:01:28 +00:00
Vlad Zahorodnii
3d1b3c9c66 backends/drm: Store hardware and virtual outputs in two different lists
Currently, we effectively almost everywhere need DrmOutput outputs,
DrmVirtualOutput outputs are needed only in a couple of places. There's
not a lot that we gain from storing real and virtual outputs in one
list, it adds unnecessary casting, etc. Ideally, virtual outputs must
come from a different backend, the current approach is not scalable.
2022-09-07 17:40:51 +00:00
Nate Graham
f73cb8f1e5 effects/windowview: fade Searchfield in and out just like background
The Overview effect manipulates the opacity of the desktop bar and
search field along with that of the blurred background so that they
all fade in and out in sync, but Window View does not, leading to a
discrepancy between them that looks weird.
2022-09-07 13:27:53 +00:00
Marco Martin
31d1f885ce Restore the crossfade effect
This enables again the crossfade between the old window picture and the new one in the maximize and morphingpopup effects.
It does that with the OffScreenEffect redirect() feature.

BUG:439689
BUG:435423
2022-09-07 10:16:36 +00:00
Volker Krause
b7f950a5a6 Don't generate Metal and D3D shaders
Not relevant for KWin.
2022-09-07 07:26:03 +00:00
Vlad Zahorodnii
9c4bcb92c3 backends/drm: Don't sort DrmBackend::m_outputs
This std::sort() function traces its origin back to
cbbd684430. The sort step was necessary to
ensure that we get same configuration hash regardless the order in which
outputs were connected.

On the other hand, our KWinKScreenIntegration code already does that so
it seems excessive to sort outputs the second time.
2022-09-06 17:54:52 +03:00
Vlad Zahorodnii
d8ea87a9ea Add dummy placeholder output type
Placeholder outputs are not rendered so they don't need render data.
Also, this simplifies the control flow when the last real output is
removed. The Platform::screensQueried signal won't be emitted inside a
Platform::screensQueried slot.
2022-09-06 10:36:33 +00:00
Volker Krause
192a57e2e1 Port thumbnail item to use Qt Shader Tools for Qt 6 2022-09-06 10:12:37 +00:00
Vlad Zahorodnii
1b5814c0f2 Remove unused core/platform.h includes 2022-09-06 11:21:40 +03:00
Vlad Zahorodnii
d2fb4147fc Move multi-purpose code in its own directory
Things such as Output, InputDevice and so on are made to be
multi-purpose. In order to make this separation more clear, this change
moves that code in the core directory. Some things still link to the
abstraction level above (kwin), they can be tackled in future refactors.
Ideally code in core/ should depend either on other code in core/ or
system libs.
2022-09-06 11:21:40 +03:00
Vlad Zahorodnii
a295db01d9 autotests: Make mapping between KWin::Output and wl_output more robust
Use wl_output.name to find the wl_output for the given server side
output. This way the order in which wl_output globals are announced
won't matter.
2022-09-06 06:47:43 +00:00
Aleix Pol
64800e72ca buttonrebinds: Refactor to be able to share some more code
This way we detach the infrastructure from QKeySequence so other kind of
actions can be taken.
2022-09-05 20:37:40 +00:00
Aleix Pol
a22546897b tablet: Add support for binding tablet events to keyboard shortcuts
Reuses the infrastructure we have for mice buttons for tablets.
2022-09-05 20:37:40 +00:00
Aleix Pol
0744ee09ed libinput: Include the Pad name in the TabletPadId
It's helpful to identify what pad we are referring to in a cross-session
way where a pointer won't hold.
2022-09-05 20:37:40 +00:00
Aleix Pol
6b4feccadd tablet: Send libinput timestamp as the time
As it should be done, instead of using some different value from the
local system.
2022-09-05 20:37:40 +00:00
Vlad Zahorodnii
e97e520175 Move placement policy enum in KWin namespace
Other policy enums are declared in options.h so let's do the same for
placement policy. Besides consistency, another advantage of moving the
enum in kwin namespace is that the enum could be forward declared.
2022-09-05 14:11:42 +00:00
Vlad Zahorodnii
71c9f16673 Fix a typo
Forgot to specify the resource where to send name & description.
2022-09-05 15:17:52 +03:00
Vlad Zahorodnii
330a02d862 wayland: Implement wl_output version 4
wl_output version 4 adds name and description properties. Those
properties were added in wayland 1.20, which we already require.
2022-09-05 14:37:10 +03:00
Kai Uwe Broulik
a0a472391e effects/blur: Generate noise texture on demand
It is relatively expensive and there is no need to do it unless
there are actually windows that make use of the blur effect.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-09-05 09:25:06 +02:00
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