Commit graph

23242 commits

Author SHA1 Message Date
Vlad Zahorodnii
e0945886ed Rename Platform::screensQueried() to Platform::outputsQueried()
It makes the vocabulary consistent. We use the word "output" more than
"screen."
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
dbef4fa3f0 backends/drm: Rework GPU removal
The proposed way to handle unplugged gpus allows us to ensure that
removed outputs' lifetime can be extended to the moment when the
Platform::outputsQueried signal is emitted.

Besides that, it's possible to extend this code a bit further to make
sure that output updates are batched when hotplugging multiple gpus,
e.g. after resuming, etc.
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
383b054e5c effects: Stop highlighting WindowHeapDelegate when the effect is deactivated
It makes the deactivation animation look less weird when activating a
window in the overview effect using keyboard.
2022-09-12 06:44:54 +00:00
Volker Krause
a7c8735f4f Add libqaccessibilityclient dependency 2022-09-11 10:58:41 +00:00
Vlad Zahorodnii
38600a6235 Revert "Merge gesture structs/enums"
This reverts commit d29c7a6c2b.

It was pushed with unreviewed changes and not fully resolved issues.
2022-09-11 13:14:11 +03:00
Vlad Zahorodnii
db1ec66eb1 Revert "Move gesture direction to base class"
This reverts commit 634182d489.

It was pushed with unreviewed changes and not fully resolved issues.
2022-09-11 13:14:10 +03:00
Vlad Zahorodnii
e3df43c701 Revert "Add new gestures and improve naming clarity in gesture.h"
This reverts commit bc15b72e3d.

It was pushed with unreviewed changes and not fully resolved issues.
2022-09-11 13:14:08 +03:00
Vlad Zahorodnii
d23781d87a Revert "Clarify interface and improve documentation in gesture"
This reverts commit 6c0ed14800.

It was pushed with unreviewed changes and not fully resolved issues.
2022-09-11 13:14:02 +03:00
Vlad Zahorodnii
74da80763f Revert "Rename GestureDirection to GestureType"
This reverts commit 5de6c507db.

It was pushed with unreviewed changes and not fully resolved issues.
2022-09-11 13:13:37 +03:00
Eric Edlund
5de6c507db Rename GestureDirection to GestureType 2022-09-11 00:09:44 +00:00
Eric Edlund
6c0ed14800 Clarify interface and improve documentation in gesture
Separate trigger progress and semantic progress in gesture.
Move effect activation and desktop switching over to semantic progress.
Allow semantic progress to exceed 1 for overshoot in animations.
2022-09-11 00:09:44 +00:00
Eric Edlund
bc15b72e3d Add new gestures and improve naming clarity in gesture.h
I've added VerticalAxis, HorizontalAxis, DirectionlessSwipe and BiDirectionalPinch gestures directions.
These are all combinations of other gesture directions that semantically work well together.
I've implemented these gestures as well as changed some labels and improved documentation,

Also,
Add vector signal to SwipeGesture
2022-09-11 00:09:44 +00:00
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