Commit graph

3960 commits

Author SHA1 Message Date
David Edmundson
97fe0613e6 Support QRectF in debug console 2022-07-28 11:55:43 +00:00
Vlad Zahorodnii
9177fd1835 kwineffects: Make clientArea() return a QRectF
Make EffectsHandler::clientArea() return same type as
Workspace::clientArea().
2022-07-28 10:58:59 +00:00
Xaver Hugl
34344c8dc4 input: don't forward gestures used by KWin to applications
If both compositor and applications were to use these gestures at the same
time, that would be quite confusing for the user. This also works around
a bug in Wine that makes applications crash.

BUG: 455952
2022-07-28 10:01:48 +00:00
Vlad Zahorodnii
e604b6852f backends/drm: Remove Compositor dependency
This breaks cyclic dependency between Compositor and DRM backend, there
are still indirect dependencies though. However, fewer cyclic
dependencies should make the architecture more cleaner and easier to
tweak.
2022-07-28 08:56:47 +00:00
ivan tkachenko
51326dfb85
effects/private: Group Repeater's alias properties together 2022-07-28 11:02:37 +03:00
ivan tkachenko
766d64c1e5
effects/private: Port potential misuse of a dragHandler to activeDragHandler
There are two drag handlers, and an `activeDragHandler` property to
switch between them. That's what other code is doing in this component.
2022-07-28 11:02:36 +03:00
ivan tkachenko
1c1cf61b1f
effects/private: Drop unused property dragHandler 2022-07-28 11:02:36 +03:00
ivan tkachenko
aa6200495c
effects/private: Make WindowHeapDelegate dragHandler less confusing
There were too much `dragHandler` identifiers per square meter of code.
2022-07-28 11:02:36 +03:00
ivan tkachenko
f48b306665
effects/private: Set required property for default WindowHeapDelegate
Otherwise this WindowHeap type is not usable without custom delegate.

    /usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:111:23:
        QML Component: Cannot create delegate
    /usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:21:5:
        Required property windowHeap was not initialized
2022-07-28 11:02:36 +03:00
ivan tkachenko
da3b731c1a
effects/overview: Clean up QML/JavaScript code 2022-07-28 11:02:35 +03:00
ivan tkachenko
94168cd7c1
effects/private: Drop unused properties 2022-07-28 11:02:34 +03:00
ivan tkachenko
12b72d614e
effects/private: Port ExpoLayout to using anchors 2022-07-28 10:45:43 +03:00
ivan tkachenko
22156777fb
effects/desktopgrid: Add explicit spacing for buttons layout 2022-07-28 10:45:41 +03:00
Aleix Pol
dcb1836c6e wayland/autotests: Make sure TestWaylandSurface deletes the surfaces it uses 2022-07-28 07:23:56 +00:00
Aleix Pol
a94f5c0d7f wayland/autotests: Make sure SeatInterface gets deleted 2022-07-28 07:23:56 +00:00
Aleix Pol
4af69643e1 wayland/autotests: Make sure we delete the seat
The parent is the second argument, it therefore was nullptr and it broke
the assumption from few lines below that it's owned by the display.
2022-07-28 07:23:56 +00:00
Aleix Pol
bbb4c20c8a libinput: Make sure config values get deleted
Switches to a shared pointer rather than a raw one. It would leak, which
in general is not a big problem but it would flood the output when
running tests with ASAN. Also it's the right thing to do.
2022-07-28 07:23:56 +00:00
Vlad Zahorodnii
a513b795ad backends/wayland: Fix a crash on shutdown
The wayland backend changes the dpms mode when the enabled state of the
output changes. This creates problems when destroying all outputs on
shut down. The wayland backend calls InputRedirection's methods, but
InputRedirection is already destroyed by that time.

While the crash can be fixed by guarding input() in createDpmsFilter()
with an if statement, changing dpms mode in updateEnablement() doesn't
seem like a good idea because Output changes unrelated states (enabled !=
dpms mode), so let's get rid of it.
2022-07-28 07:02:16 +00:00
ivan tkachenko
3da3489aaa
effects/private: Don't show another window's hover/highlight while dragging
This produced really weird impression that if you will drop a window it
will be actually dropped on another window??
2022-07-27 20:15:50 +03:00
ivan tkachenko
54917f038e
effects/private: Raise currently dragged window higher than anything
BUG: 456936
FIXED-IN: 5.25.4 5.26
2022-07-27 18:08:00 +03:00
ivan tkachenko
074fed313b
effects/desktopgrid: Fix dragging and swapping desktops on a grid
Amends 00ba4aedcc.
2022-07-27 16:34:39 +03:00
ivan tkachenko
f1a45b6509
effects/private: Drop opacity binding inside WindowHeapDelegate
This targetOpacity is nowhere to be found. This is a relic of past
development. Currently code that needs to alter opacity based on drag
state does so externally by setting opacity on a delegate as a whole.
2022-07-27 15:24:50 +03:00
David Edmundson
a7520b3659 Fix activity swtiching through UserActions menu
On wayland the code to keep windows on the current activity whilst the
window was broken was completely broken in porting. We only held the
block for the duration of the method even though the popup remained open
for longer.

On X11, when removing the window from the current activity it would not
update correctly and remain visible. The code path was as follows:
 - the menu is shown an event loop is started
 - we change the activities
- as we close the menu focus changes and workspace calls
UserActionsMenu::close this unsets m_window
- We then never call the blockActivityUpdates(false) at the end of
UserActionsMenu::show

This patch addresses both at once.

We get rid of the nested event loop as that was always evil. This means
slotWindowOperation no longer needs to be queued.

We perform cleanup of m_window and the activity blocker when the menu
closes which should be safer.

BUG: 456873
2022-07-27 12:20:50 +00:00
ivan tkachenko
7b24df247d
effects/overview: Fix anchor on a placeholder message
ScreenView.qml:202:17: Unable to assign QQuickItem to QQuickAnchorLine
2022-07-27 13:19:42 +03:00
Vlad Zahorodnii
04d1bef9f8 Make Platform::outputs() pure virtual method 2022-07-27 09:22:10 +00:00
Vlad Zahorodnii
a198516871 Drop Platform::enabledOutputs()
At the moment, a platform should provide two output lists - one that
lists all available outputs, and the other one that contains only
enabled outputs. In general, this amounts to some boilerplate code and
forces backends to be implemented in some certain way, which sometimes
is inconvenient, e.g. if an output is disabled or enabled, it will be
simpler if we only change Output::isEnabled(), otherwise we need to
start accounting for corner cases such as the order in which
Output::isEnabled() and Platform::enabledOutputs() are changed, etc.
2022-07-27 09:22:10 +00:00
Vlad Zahorodnii
2629007eef Make outputs disabled by default
This can be used to make our backends more multi-purpose. At the moment,
new outputs are enabled by default, but it makes sense to do otherwise.

For example, if an output is disabled by default, it would be possible
to delegate initial output configuration to layer above, to kwin.

In long term, the drm backend would need to scan connectors, create an
Output for every one of them, kwin sees new outputs and tries to apply
the initial output configuration, which includes the enabled status.
2022-07-27 09:22:10 +00:00
ivan tkachenko
854aebb3ae
Mark window type properties as CONSTANT
Since we don't have any means of getting notified by _NET_WM when a
windowType changes, and since KWin would handle that quite poorly, AND
since no one does that in real-world applications anyway, we might as
well mark those getters as CONSTANT, so that QML engine would stop
complaining about depending on non-NOTIFYable properties.

According to the specification, the window type should be decided before
a window gets mapped.
2022-07-27 12:06:54 +03:00
David Edmundson
2073415f91 Ensure size is valid after maximising
In X11 when a window is maximised if the client is unable to fufill the
space provided we centre align the window.

With the new floating point geometry behaviour of centreing changes.
Instead of a 1 pixel gap at the top, we get a 0.5 pixel gap either side.
When we get into the codepath to "fix" the window in `closeHeight` we
only move the top, giving us an invalid buffer size.

We don't really want to change the logic here; on xwayland with the
scaling opt-out path it's feasible for a floating sized logical size to
still be representable. This code rounds to the native unit after all
the logic has taken effect.
2022-07-27 08:43:23 +00:00
Alexey Andreev
c61515cd8d kwinglutils: restore alignment logic for Mali GPU
Contributes to:

https://invent.kde.org/teams/plasma-mobile/issues/-/issues/172
2022-07-27 08:20:40 +00:00
Vlad Zahorodnii
3ce24a0cbf Make OutputConfiguration take OutputMode
OutputMode provides a more robust way to refer to outputs. A mode can
have flags and things as such that are not taken into account with mode
+ refresh rate.
2022-07-27 07:26:48 +00:00
Vlad Zahorodnii
726f97d2a6 effects/slidingpopups: Fix slide offset
Code such as "screenRect.bottom() - windowGeo.bottom()" assumes that
both screenRect and windowGeo have the same type. At the moment, it's
not the case, screenRect has QRect type and windowGeo has QRectF type,
so the calculated offset will be off by one.
2022-07-27 07:09:14 +00:00
Xaver Hugl
5e602434c0 backends/drm: fix memory leak 2022-07-26 19:41:51 +00:00
Xaver Hugl
4be81e0176 backends/drm: make modeset tests explicit
Instead of checking for properties needing a modeset, do atomic tests
with ALLOW_MODESET where it makes sense, and do a second atomic test
afterwards without ALLOW_MODESET to check if the modeset can be skipped.

This should ensure that KWin always does a modeset when it needs to do one,
 and not do a modeset when it's not necessary. Doing this also allows
reducing the complexity of the drm backend a bit.
2022-07-26 19:03:33 +00:00
Alexander Lohnau
bd8d65a861 Port deprecated KPluginMetaData constructor for json file 2022-07-26 15:28:08 +00:00
Vlad Zahorodnii
71a58231e8 backends/drm: Make DrmOutput::queueChanges() not touch active status
The DrmOutput synchronizes the enabled state with the active state,
which makes sense on one hand, but on the other hand, that's not good.
The drm backend makes a decision that should be ideally made by either
kscreen (turn on outputs before applying an output config), user, or
kwin itself.

This would also allow kwin to control the allocation of crtcs for
non-desktop outputs, which is a minor thing, but it might be useful in
the future.
2022-07-26 13:40:29 +00:00
David Redondo
0fc4bf7fba Remove another unneded include
GIT_SILENT
BUG:457152
2022-07-26 13:32:27 +02:00
David Redondo
1f9c317878 Remove unneeded include
BUG:457152
2022-07-26 10:06:14 +00:00
Xaver Hugl
361fc0a38e backends/drm: remove drm lease layers
They just add more code and more potential problems, and the difference in
VRAM usage is very minimal
2022-07-26 09:57:06 +02:00
Xaver Hugl
b7d7a99fcb backends/drm: fix placeholder output check
Non-desktop outputs must be ignored
2022-07-26 07:06:30 +00:00
David Edmundson
e67e9b6e28 Avoid rounding in frameSizeToClientSize 2022-07-26 06:20:24 +00:00
David Edmundson
4573337bfe Avoid unneeded Rect conversion 2022-07-26 06:20:24 +00:00
Aleix Pol
27f24d1449 input: Introduce a outputArea property for tablet devices
It's important for tablet devices to be able to specify to which section
of the display we'll be fitting the tablet. This setting allows to
specify this by providing some options that will do so relative to the
output size.

CCBUG: 433045
2022-07-25 23:29:07 +00:00
Niklas Stephanblome
8407f88585 effects/overview: Add window filtering
This adds window filtering to the Overview effect. This satisfies both
Overview users' needs and the workflow of Windowview: When the user
starts typing, windows are filtered by default. If there is no matching
window, then the Milou UI is shown, including the option for opening a
new app is shown--the same one that currently gets shown when the user
starts typing. This leads to a very seamless experience, where the user
can type any app name and they will get it, no matter if it's already
opened or not.
2022-07-25 16:18:06 +00:00
Vlad Zahorodnii
dc92939908 Adjust Window code to behavior of QRectF::right() and QRectF::bottom() 2022-07-25 10:49:14 +00:00
Vlad Zahorodnii
519a2db950 Remove leftover qDebug()s 2022-07-25 09:19:44 +00:00
Vlad Zahorodnii
1b4258bf17 kwineffects: Move infiniteRegion() to kwinglobals.h
infiniteRegion() is useful not only to effects but also other kwin
components, so move it to kwinglobals.h in order to make backends stop
depending on libkwineffects
2022-07-25 10:52:03 +03:00
Vlad Zahorodnii
1baf39daf7 backends/drm: Improve device seat assignment handling
This fixes the drm backend adding hotplugged gpus that belong to other
seats and makes the udev helper depend on less stuff from the layer
above backends.
2022-07-24 19:36:50 +03:00
Vlad Zahorodnii
cf3fe003e6 Move ownership of Session to Application
The Session can be useful not only to the platform backend but also
input backends and for things such as vt switching, etc. Therefore it's
better to have the Application own the Session.
2022-07-24 19:14:26 +03:00
Vlad Zahorodnii
5e669aece9 backends/libinput: Take Session explicitly
The API will be more clear about what the libinput backend needs.
2022-07-24 19:14:26 +03:00
Alexander Lohnau
4f7b2054e1 Remove "KCModule" ServiceType for KCMs
This is not needed anymore.

Task: https://phabricator.kde.org/T14483
2022-07-24 15:52:12 +00:00
Alexander Lohnau
ce694e838f De-duplicate json metadata of KPackages
Systemsettings and Plasma-Settings use the embedded json metadata instead of the KPackage one

Task: https://phabricator.kde.org/T14983
2022-07-24 15:52:12 +00:00
Alexander Lohnau
1a38ea6aba Port to KCM desktop file generation method from kcmutils
This de-duplicates the translations needed for the KCMs.

Task: https://phabricator.kde.org/T15609
2022-07-24 15:52:12 +00:00
Vlad Zahorodnii
36e238cda5 backends/drm: Remove EdidOverwrite config option
This is a too niche feature. It also doesn't have to be implemented in
the compositor. The kernel provides a way to overwrite the edid blob,
which is not specific to the running compositor.
2022-07-24 15:37:44 +00:00
Vlad Zahorodnii
96f3a5eec2 backends/drm: Fix dangling connectors in m_allObjects
We add connectors to m_allObjects but never remove them.

CCBUG: 457002
2022-07-24 14:20:12 +00:00
Vlad Zahorodnii
5aef41663a backends/drm: Fix potential use-after-free
When the output is removed, there are legit cases when the connector can
be still accessed.

CCBUG: 457002
2022-07-24 14:20:12 +00:00
Xaver Hugl
f0d59b078b backends/drm: explicitly initialize all fields of drmModeModeInfo 2022-07-24 13:49:54 +00:00
Xaver Hugl
bf6990da45 backends/x11/windowed: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
2420949628 backends/x11/common: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
ff0e89b030 backends/x11/standalone: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
d251d33402 backends/drm: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
24b1eab228 backends/wayland: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Xaver Hugl
9d3561faf8 backends/virtual: rename files to be more consistent 2022-07-24 13:05:13 +00:00
Vlad Zahorodnii
50e99808e8 utils/udev: Drop Udev::listFramebuffers()
The fbdev backend was dropped so it's unused.
2022-07-24 09:23:35 +00:00
Xaver Hugl
6d1c97c4bc workspace: fix resize snapping
With the existing behavior there was a 1px gap between windows
2022-07-23 22:14:56 +00:00
Vlad Zahorodnii
045da603a4 Make backends part of libkwin
Platform backends are provided as plugins. This is great for
extensibility, but the disadvantages of this design outweigh the
benefits.

The number of backends will be limited, it's safe to say that we will
have to maintain three backends for many years to come - kms/drm,
virtual, and wayland. The plugin system adds unnecessary complexity.

Startup logic is affected too. At the moment, platform backends provide
the session object, which is awkward as it starts adding dependencies
between backends. It will be nicer if the session is created depending
on the loaded session type.

In some cases, wayland code needs to talk to the backend directly, e.g.
for drm leasing, etc. With the plugin architecture it's hard to do that.
Not impossible though, we can approach it as in Qt 6, but it's still
harder than linking the code directly.

Of course, the main disadvantage of shipping backends in a lib is that
you will need to patch kwin if you need a custom platform, however such
cases will be rare.

Despite that disadvantage, I still think that it's a step in the right
direction where the goal is to have multi-purpose backends and other
reusable components of kwin.

The legacy X11 standalone platform is linked directly to kwin_x11
executable, while the remaining backends are linked to libkwin.
2022-07-23 11:52:42 +00:00
Vlad Zahorodnii
0fbd5fa377 backends/virtual: Provide own logging.h file
target_sources() doesn't work as expected with generated source files.
2022-07-23 11:52:42 +00:00
l10n daemon script
acd5bf9a6e 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-07-23 01:47:37 +00:00
ivan tkachenko
df6331b60a effects/colorpicker: Fix picking colors
Due to the wrong buffer format, the function failed with
GL_INVALID_OPERATION error, which was silently ignored by the effect.
It resulted in the constant phantom color being returned over and over
again.

Co-Authored-By: David Edmundson <kde@davidedmundson.co.uk>
BUG: 454974
FIXED-IN: 5.24.7, 5.25.4, 5.26
2022-07-22 19:51:11 +00:00
Nate Graham
282e79c178 useraction: port away from DEF macros
Currently, defining shortcuts in useractions.cpp is done using one of
six macros, some of which allow the name that ends up as the key in
the config file to be autogenerated from an untranslated form of the
user-facing text.

Whenever a shortcut using one of these macros is renamed, the key in the
config file changes too, so users lose any custom shortcuts they had
assigned.

To avoid this, developers need to know that they have to switch to the
relevant macro that allows the name and description to be defined
separately, remember to do so, and manually set a name that matches the
old user-facing text. This can be forgotten, is not obvious to new
developers, and is a subtle source of user-facing bugs.

In addition the macros are largely unnecessary, as they are wrappers 
around a custom function. We can just call the custom function 
ourselves.

This commit ports away from the macros and calls the initShortcut()
instead, which resolves both issues.

cc @davidre
2022-07-22 16:50:25 +00:00
Volker Krause
9e8b370453 Adapt to Qt 6.3 API changes to QMutableEventPoint 2022-07-22 14:03:30 +00:00
Vlad Zahorodnii
1fccb3daf1 plugins/colord-integration: Expose outputs managed by Workspace
Workspace knows better about managed outputs, and it removes one more
dependency on Platform::enabledOutputs() and the corresponding signals.
2022-07-22 13:49:12 +00:00
Vlad Zahorodnii
82c1cf3de2 backends/drm: Pass DrmGpu to page flip handler through user data
The page flip handler can be simpler if it gets the gpu through user
data. It also removes a usage of the Application singleton.
2022-07-22 12:02:47 +00:00
Vlad Zahorodnii
e179d9cea1 Load plugins after Workspace is created
The original intention behind creating plugins before the workspace was
to handle the case where kwin_wayland may need to wait until outputs are
available. However, since things have changed a lot in that regard,
plugins can be loaded after the workspace now.

The main benefit behind this is that plugins can be simpler, they won't
need to track when the workspace is created.

On X11, plugins are already loaded after the workspace is instantiated.
2022-07-22 11:28:21 +00:00
Vlad Zahorodnii
211d0c00fc Remove unused main.h includes 2022-07-22 13:13:14 +03:00
Xaver Hugl
b6cf576efa move DecorationBridge singleton into Workspace 2022-07-21 15:24:57 +02:00
Xaver Hugl
7f1923cc9b move ApplicationMenu singleton into Workspace 2022-07-21 15:24:57 +02:00
Xaver Hugl
1cf2205283 move Activities singleton into Workspace 2022-07-21 15:24:51 +02:00
Xaver Hugl
f2ad6bcce9 move ColorManager singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
9337f145d5 move InputMethod singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
45d4677973 move PluginManager singleton to Application 2022-07-21 15:16:40 +02:00
Xaver Hugl
4121d45c42 backends/libinput: remove global state 2022-07-21 15:16:40 +02:00
Xaver Hugl
1ce7dc9e02 move FocusChain singleton into Workspace 2022-07-21 15:16:40 +02:00
Vlad Zahorodnii
0a7661c9df backends/drm: Remove DrmGpu::{outputEnabled,outputDisabled}
They are unused.
2022-07-21 12:35:51 +00:00
Vlad Zahorodnii
8ce8d9a330 Remove Application::isClosingX11Connection()
It's unused.
2022-07-21 13:18:35 +03:00
Vlad Zahorodnii
fb3787a4d7 Drop unused Application::platformCreated() signal 2022-07-21 08:43:50 +00:00
Vlad Zahorodnii
4bfb0acc17 Make Workspace track managed outputs
This change adjusts the window management abstractions in kwin for the
drm backend providing more than just "desktop" outputs.

Besides that, it has other potential benefits - for example, the
Workspace could start managing allocation of the placeholder output by
itself, thus leading to some simplifications in the drm backend. Another
is that it lets us move wayland code from the drm backend.
2022-07-21 08:43:50 +00:00
Vlad Zahorodnii
724d6761cd backends/drm: Store desktop and non-desktop outputs in the same list
Now, the drm backend exposes all outputs. It's the job of the workspace
layer to filter out outputs it's not interested in.
2022-07-21 08:43:50 +00:00
Vlad Zahorodnii
8dabeb4709 backends/drm: Use DrmOutput to represent non-desktop outputs too
The main motivation behind this change is to make the drm backend
multi-purpose. That's it, to make it suitable for implementing all kinds
of compositors. At the moment, there's an artificial split between
"desktop" and "non-desktop" outputs, i.e. VR headsets, which stands in
the way of that and moving the remaining wayland code out of the drm
backend for better layering and architecture.
2022-07-21 08:43:50 +00:00
ivan tkachenko
1dddf271d2 x11: Inline condition to avoid potential extra call 2022-07-21 07:11:56 +00:00
David Edmundson
62cf7e8830 Only calculate surfaceInputTransformation when we have a surface 2022-07-20 22:00:36 +00:00
Vlad Zahorodnii
1c25c7101d Simplify Workspace::clientArea()
We don't need to look up unrelated areas, for example looking up the
screen area when we are after the work area.
2022-07-20 14:10:01 +00:00
Aleix Pol
4220e7ac25 wayland/tablet_v2: Keep also the pad surface in a QPointer
This way we make sure that we don't explode if for some reason the
surface is destroyed (e.g. it's closed).
This will make it work exactly like the other references to
SurfaceInterface.

BUG: 456817
2022-07-20 15:23:33 +02:00
Vlad Zahorodnii
c7af7adda6 x11: Hard-code 0 default screen
The screen number matters only on multi-head setups.
2022-07-20 11:37:57 +00:00
Vlad Zahorodnii
8f2748b1e1 Move udev.{h,cpp} to src/utils 2022-07-20 12:31:32 +03:00
David Redondo
6576a83aee Add outputlocator effect
An effect that implements the "identify" functionality of
the screen configuration kcm. It displays a label on each
screen that identifies the screen.
Doing this as a kwin effect allows to correctly handle
the case when outputs are mirrored (on wayland) compared to
absolute positioning of windows which end up on top of each other.
2022-07-20 07:01:05 +00:00
David Redondo
ab55c0276f Provide extra information about outputs to effects
Adds output manufacturer, model and serial number to EffectScreen.
2022-07-20 07:01:05 +00:00
David Redondo
499474ed66 Fetch and parse EDIDs on X11
This allows us to get more information about the outputs like vendor
and model and for example provide them to effects which might find
the extra info useful.
2022-07-20 07:01:05 +00:00
l10n daemon script
ff9bfc2e3b 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-07-20 01:44:06 +00:00
Vlad Zahorodnii
dd9b4aa37a backends/x11: Remove AbstractEglBackend::setSurface() call
KWin requires surfacesless contexts, so this setSurface() is not needed.
This ensures that makeCurrent() won't make the opengl context current
against a surface that belongs to a removed output.
2022-07-19 18:56:12 +00:00
Vlad Zahorodnii
42285bc659 backends/wayland: Remove AbstractEglBackend::setSurface() call
KWin requires surfacesless contexts, so this setSurface() is not needed.
This ensures that makeCurrent() won't make the opengl context current
against a surface that belongs to a removed output.
2022-07-19 18:56:12 +00:00
Eric Edlund
99913bab5d Make EffectWindowVisibleRef mandatory when refrencing window visibility in effects
This should prevent a stray visiblity unrefrence in an effect from crashing kwin.
2022-07-19 17:32:46 +00:00
Vlad Zahorodnii
b81f16fbd5 x11: Remove unused field in EglOnXBackend 2022-07-19 17:19:40 +03:00
Vlad Zahorodnii
4dd9b0f15b x11: Drop support for multi-head
The main reason to drop multi-head support is that it has been simply
unmaintained for many many years. When implementing a feature, we don't
even bother checking if multi-head is broken, KCMs don't handle
multihead, window management features are written for Xinerama. KWin
is optimized for Xinerama-like operation mode in general, which is
provided out of the box.

If you use multihead for esoteric gpu stuff, consider using kwin_wayland!
2022-07-19 11:44:00 +00:00
David Edmundson
80fb713787 Support keyboard navigation between windows across desktops
If a DesktopView doesn't handle a keyboard navigation event it
propagates to main which then focusses the next desktop view and the
relevant window.

Empty desktops can also be selected.

BUG: 456068
2022-07-19 10:35:09 +00:00
David Edmundson
00ba4aedcc Make DesktopView a FocusScope 2022-07-19 10:35:09 +00:00
David Edmundson
9152df4b4f Accept keys in windowheap conditionally
In WindowHeap we currently always accept the keyboard event regardless
of whether the event was handled.

This will allow the event to propagate to other handlers
2022-07-19 10:35:09 +00:00
David Edmundson
a61719ddc4 Accept keys in windowheap conditionally
In WindowHeap we currently always accept the keyboard event regardless
of whether the event was handled.

This will allow the event to propagate to other handlers
2022-07-19 10:14:47 +00:00
Xaver Hugl
e726779c9b manage plugins with std::unique_ptr 2022-07-19 08:42:22 +00:00
Xaver Hugl
dc4436a754 core: port a few things away from manual memory management 2022-07-19 08:42:22 +00:00
Vlad Zahorodnii
faa006d76f backends/x11: Manage X11WindowedQPainterOutput using std::unique_ptr 2022-07-19 07:51:46 +00:00
Vlad Zahorodnii
c74fa4b571 backends/x11: Port windowed backend from Screens 2022-07-19 07:51:46 +00:00
Vlad Zahorodnii
c414efc353 Stop unregistering org.kde.kwin dbus service
We don't use KApplication.
2022-07-19 10:21:04 +03:00
Vlad Zahorodnii
7d05cb7d79 Remove unused X11 kwin-specific properties
There are no seems to be any usages of these properties.
2022-07-19 10:20:59 +03:00
Aleix Pol
1cb2d38a64 activation: Be liberal about the StartupWMClass
Some apps (e.g. VirtualBox) are inconsistent there.
2022-07-18 21:00:24 +02:00
Aleix Pol
c68a0f5dc0 activation: Fix activation notification of Xwayland clients
Most xwayland clients don't know their desktop file name, so use the
StartupWMClass field in their desktop files as means to inferring their
desktop file name.

BUG: 455265
2022-07-18 19:58:03 +02:00
Aleix Pol
b2aacba086 activation: Simplify icon loading logic 2022-07-18 19:35:31 +02:00
Xaver Hugl
61b1eac5b8 platform, scenes: use std::unique_ptr for creation functions 2022-07-18 14:26:26 +00:00
Xaver Hugl
f50547de1e backends/drm: manage drm objects with std::unique_ptr
Also makes the connector detection code a bit more readable
2022-07-18 14:26:26 +00:00
Xaver Hugl
affa7386f8 backensd/drm: manage gpus with std::unique_ptr 2022-07-18 14:26:26 +00:00
Xaver Hugl
32c2ae15a4 backends/drm: manage drm properties with std::unique_ptr 2022-07-18 14:26:26 +00:00
Vlad Zahorodnii
aa739c59cf wayland: Make mapping from xinerama indices to Output correct
We assume that outputs in kwinApp()->platform()->enabledOutputs() are
stored in the xinerama order. However, this is not the case on Wayland
and it's not going to be changed because it increases the complexity.

This change makes Workspace::xineramaIndexToOutput() use Xinerama
extension API to map a xinerama index to the associated Output object.

With this, Xwayland applications will be able to put on outputs as
expected.

Note that xinerama indices are not cached because
Workspace::xineramaIndexToOutput() is not used in any hot code path. If
that changes, xinerama indices can be cached. The cache must be
invalidated whenever we get screens changed notify event from RANDR.
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
5a8beacd2b Drop Platform::findOutput()
Please, don't use integer ids to identify outputs!
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
fc58fbaa71 Add conversion helpers between xinerama indices and output objects
Currently, we implicitly assume that enabled outputs are stored in the
xinerama order, but with ongoing refactorings, it's easy to break that
assumption. Also, we are not going to change the DRM backend so it
stores enabled outputs in the xinerama order.

This change adds xinerama index conversion helpers in order to reduce
the number of potential regressions with output refactorings.
2022-07-18 13:52:58 +00:00
Vlad Zahorodnii
4790916fb1 x11: Fix shading with non-zero border
There was a geometry change that fixed mixing the next and current
geometries. While it did fix issues on wayland, it broke window shading
on x11 because of an obscure resize() call.

That obscure resize() had a side-effect that ensures m_clientGeometry
has the right value so the next time the window is unshaded,
implicitSize() will return a good value.

In order to make window size computation more robust, this change makes
X11Window compute the natural frame size based on cached size in
m_client, which shouldn't change when the window is shaded.

However, given how buggy window shading is and how difficult it is to
make it work right, I think that it's better to deprecate window shading
and remove it in some future release.

BUG: 450582
2022-07-18 11:39:06 +00:00
Vlad Zahorodnii
64c71a37a0 backends/virtual: Use #pragma once 2022-07-18 08:36:04 +00:00
Vlad Zahorodnii
f80a14d4f6 backends/virtual: Make render backend naming consistent 2022-07-18 08:36:04 +00:00
Vlad Zahorodnii
5bf1332df5 backends/wayland: Use #pragma once 2022-07-18 08:36:04 +00:00
Vlad Zahorodnii
a56b09ab9d backends/wayland: Make render backend naming consistent 2022-07-18 08:36:04 +00:00
Vlad Zahorodnii
6db530bfde backends/x11: Use #pragma once 2022-07-18 08:36:04 +00:00
Vlad Zahorodnii
8dd719e4e2 backends/x11: Make render backend naming consistent 2022-07-18 08:36:04 +00:00
Nate Graham
a0c8d4b24d WindowHeap: expand size of highlight
Currently, the highlight effect is not very visible because it only
barely peeks out of the window thumbnail. We can make it bigger by
making it peek out a little bit more, and also by including the window
title and icon (when visible) within it.

BUG: 454842
2022-07-17 02:55:01 +00:00
l10n daemon script
131b9d226a 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-07-17 01:46:18 +00:00
Nate Graham
722cc87016 Use old id for "Peek at Desktop" to preserve existing shortcus
This code uses the DEF() macro which silently re-uses an untranslated
version of the string as the ID in the config file. So anytime you
change the text, a new entry will be created in the config flil and
users will lose any custom shortcut mappings.

To avoid this, use the DEF2() macro instead, which allows defining the
ID and the user-facing translated name differently.
2022-07-15 15:52:18 +00:00
Xaver Hugl
636b411b31 backends/drm: don't crash if importing a texture fails
CCBUG: 456500
2022-07-15 13:42:48 +00:00
Aleix Pol
c8c1b05661 Remove unnecessary constructor 2022-07-15 14:58:42 +02:00
Aleix Pol
39f45ad70f WaylandOutput: Remove unused rendered attribute 2022-07-15 14:58:42 +02:00
Vlad Zahorodnii
885e9acb6e Drop ApplicationWaylandAbstract
We gain nothing with it. XCB setup logic in the Xwayland server has to
be moved to the workspace layer anyway. For example, this move of
responsibilities will be needed to support running more than just one
instance of Xwayland. Architecture-wise, it would be cleaner too.

Unfortunately, it breaks encapsulation of the Application, but this can
be taken care later.
2022-07-15 12:18:03 +00:00
Kishore Gopalakrishnan
ed128064e3 Swapping desktops: only swap windows on current activity.
In the desktop grid effect, dragging an empty area of a desktop to
another desktop swaps all windows on the two desktops. This change makes
sure that this matches only windows in the current activity.

Was earlier fixed in
1e0b0c881e
, but the bug was reintroduced by the QML rewrite.

BUG: 386769
2022-07-15 08:26:08 +00:00
Nate Graham
e801819a2d Rename "Show Desktop" to "Peek at Desktop" in UI strings
Companion to https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1036
2022-07-14 17:36:04 +00:00
awed potato
717e17d578 Default RollOverDesktops (AKA "navigation wraps around") to false
Having RollOverDesktops false is more intuitive and "natural" for
new users, who may be disoriented by virtual desktop navigation
wrapping around (especially for small numbers of virtual desktops)
and not find the setting to change it very easily.
2022-07-14 14:21:40 +00:00
David Edmundson
862aae9d35 Drop uneeded toPoint
outputAt has an overload
2022-07-14 11:39:00 +00:00
David Edmundson
0c5da45cfc Drop multiple point rounding in input code
Input is floating but was rounded when we entered kwin logic.
This is no longer needed after more floating point support was added to
the core.
2022-07-14 11:39:00 +00:00
Arjen Hiemstra
2138a43392 Properly set m_size when updating SurfacePixmap{Wayland,Internal}
Otherwise the size() getter in the base class outputs an invalid size
and we can't really use it.
2022-07-14 11:34:45 +02:00
Arjen Hiemstra
2f4fa23e61 Use normalized UV coordinates for SurfaceItem
Relying on the texture matrix to normalize means we multiply every UV
coordinate with 1/scale, which leads to floating point errors and thus
errors in the UV coordinates. Instead, if we calculate normalized
coordinates directly we avoid floating point error and get proper UV
coordinates.

Longer term the plan is to make all UV coordinates normalized and get
rid of the CoordinateType altogether.
2022-07-14 11:34:45 +02:00
David Edmundson
7292af3d04 Use floating geometry throughout
With fractional scaling integer based logical geometry may not match
device pixels. Once we have a floating point base we can fix that. This
also is
important for our X11 scale override, with a scale of 2 we could
get logical sizes with halves.

We already have all input being floating point, this doubles down on it
for all remaining geometry.

- Outputs remain integer to ensure that any screen on the right remains
aligned.
 - Placement also remains integer based for now.
- Repainting is untouched as we always expand outwards
 			   (QRectF::toAdjustedRect().
 - Decoration is untouched for now
 - Rules are integer in the config, but floating in the adjusting/API
This should also be fine.

At some point we'll add a method to snap to the device pixel
grid. Effectively `round(value * dpr)  / dpr` though right now things
mostly work.

This also gets rid of a lot of hacks for QRect right and bottom which
are very
confusing.

Parts to watch out in the port are:
 QRectF::contains now includes edges
QRectF::right and bottom are now sane so previous hacks have to be
removed
 QRectF(QPoint, QPoint) behaves differently for the same reason
 QRectF::center too

In test results some adjusted values which are the result of
QRect.center because using QRectF's center should behave the same to the
user.
2022-07-14 10:04:46 +01:00
Bharadwaj Raju
1527a0cf13 Don't use Plasma-themed icons in Present Windows
BUG: 455368
2022-07-14 08:01:51 +00:00
Vlad Zahorodnii
d6646d25d0 Remove unused screens.h includes 2022-07-14 09:51:18 +03:00
Ismael Asensio
6914c81324 TabBox: Fix loading a different switcher after one has failed
We need to reset the QML Item on failure or trying to load a
different switcher afterwards will pick a wrong codepath and
also fail.

BUG: 445455
FIXED-IN: 5.25.4
2022-07-14 00:15:13 +02:00
Vlad Zahorodnii
9e61f5039e Remove some Screens::count() usages
Screens is obsolete, use Platform::enabledOutputs().
2022-07-13 21:51:03 +00:00
Xaver Hugl
7f04ea578f backends/drm: handle broken legacy drivers better
Some legacy drivers either don't accept gbm buffers suitable for cursors,
or don't handle them properly. In order to work around that, always do a
CPU import with legacy and use dumb buffers instead.

BUG: 453860
CCBUG: 456306
2022-07-13 21:10:19 +02:00
Vlad Zahorodnii
e09ca74295 wayland: Make workspace responsible for creating Screens
The Screens object is created by Workspace on X11. This change makes X11
and Wayland behave more similar. As is, the Screens is a helper for
window management code, don't use it in backends. Note that the X11 backend
already uses the Screens, it needs to be addressed individually.
2022-07-13 17:54:35 +00:00
Xaver Hugl
137cd9c031 xdgshell: don't allow applet popups to be moved 2022-07-13 17:00:34 +00:00
Vlad Zahorodnii
5be18da8ac backends/virtual: Remove unused includes 2022-07-13 16:01:46 +00:00
Vlad Zahorodnii
728e369a4d backends/virtual: Remove eglSwapBuffers() call
It's noop, we use EGL_MESA_platform_surfaceless.
2022-07-13 16:01:46 +00:00
Vlad Zahorodnii
b442c1e81b qpa: Port from Screens 2022-07-13 15:42:27 +00:00
Xaver Hugl
c050716a3b wayland/drmlease: correct DrmLeaseDeviceV1Interface::setDrmMaster 2022-07-13 12:27:54 +00:00
Xaver Hugl
9ac3c64d4c wayland/drmlease: split up DrmLeaseV1Interface::deny 2022-07-13 12:27:54 +00:00
Xaver Hugl
919b56e9a2 drmlease: send device done event correctly 2022-07-13 12:27:54 +00:00
Vlad Zahorodnii
71bfbe815c backends/virtual: Manage VirtualQPainterLayer using std::unique_ptr 2022-07-13 11:07:18 +00:00
Vlad Zahorodnii
26d4a06818 backends/virtual: Port from Screens 2022-07-13 11:07:18 +00:00
Vlad Zahorodnii
b3d3ca8c0f backends/drm: Remove unused screens.h includes 2022-07-13 10:21:44 +00:00
Arjen Hiemstra
a4fe17653f Remove alignment requirements from data in vertex/index buffers
We now rely on auto-vectorisation to generate the appropriate SSE or
other instruction set code. We can also assume that takes care of
handling any alignment requirements and thus remove the need for manual
alignment things.
2022-07-13 09:25:12 +00:00
Arjen Hiemstra
5287422f46 Add unroll hint to inner loop in WindowQuads::makeInterleavedArrays
The inner loop here has a fixed size and unrolling it allows better
vectorization. Both GCC and clang recognise the `#pragma GCC unroll`
directive.
2022-07-13 09:25:12 +00:00
Arjen Hiemstra
a95b556868 Drop custom SSE code from WindowQuads::makeInterleavedArrays
Both GCC and Clang do auto vecrization these days and testing shows that
that actually produces faster code, so dropping the SSE stuff makes
things both simpler and faster.
2022-07-13 09:25:12 +00:00
ivan tkachenko
0c8d87f9d4
[kwineffects] Fix wrong object being passed as a QQuickItem* context
Without this patch the following warning is issued:

    Could not convert argument 1 at
        onTriggered@file:///usr/share/kpackage/kcms/kcm_kwin_effects/contents/ui/Effect.qml:129
        onClicked@file:///usr/lib/qml/org/kde/kirigami.2/templates/SwipeListItem.qml:485
    Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated.
    This will throw a JavaScript TypeError in future releases of Qt!
2022-07-13 10:53:42 +03:00
Arjen Hiemstra
d7fd53e9b0 Correct bottom left corner when placing a bottom toplevel input panel
`bottomLeft()` is affected by the same issue as anything else using
bottom, that is, it is off by 1. So instead use top() + height() for the
bottom edge.
2022-07-12 22:43:56 +01:00
Arjen Hiemstra
083437d487 Don't use QRect::bottom when applying virtual keyboard geometry
Bottom is unreliable because of "historical reasons" in Qt. So don't use
bottom, instead calculate the proper height and top manually.
2022-07-12 22:43:56 +01:00
David Edmundson
36f7bae36a Revert "inputpanel: Compensate the 1px difference in height for panel position"
This reverts commit 8d588f165c.
2022-07-12 22:31:38 +01:00
Rodney Dawes
8d588f165c inputpanel: Compensate the 1px difference in height for panel position
It seems there is a 1px offset in the availableArea height, so compensate
by subtracting an extra pixel from the input panel height, to avoid a gap
below the panel.

Fixes https://invent.kde.org/teams/plasma-mobile/issues/-/issues/150
2022-07-12 14:34:10 -04:00
Vlad Zahorodnii
64f811107e scenes/opengl: Remove unused includes 2022-07-12 17:49:41 +03:00
Vlad Zahorodnii
86f741ebe7 scenes/qpainter: Remove unused includes 2022-07-12 17:47:02 +03:00
Vlad Zahorodnii
02bfc8ecae scripting: Port from obsolete Screens 2022-07-12 12:22:18 +00:00
Vlad Zahorodnii
7d00766629 backends/drm: Make drm backend not touch output configuration if all outputs are disabled
This behavior was added in order to fix a crash reported in bug report
442990. However, the analysis was not 100% correct, kwin failed to
create a placeholder because the relevant check was incorrect. The drm
backend was checking the list of all connected outputs rather than the
list with enabled outputs to decide whether to create a placeholder output.

As a safety measure the proposed behavior makes sense, however the drm
backend is not the right layer to implement it. If the last enabled
output is disconnected, kscreen should view it as a new output
setup and re-enable outputs in order to ask user what desired output
configuration should be.
2022-07-12 09:54:50 +00:00
Vlad Zahorodnii
694c32cf2c Fully port EffectsHandler from Screens
This port the remaining bits in EffectsHandler from Screens. It does
make sense to deprecate or remove workspace geometry bits in
libkwineffects as the interpretation of the workspace layout is very
effect-specific, e.g. as in the slide effect.
2022-07-12 10:40:23 +03:00
l10n daemon script
8d08c31de0 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-07-12 01:49:58 +00:00
ivan tkachenko
e9ad2b530b
[kcm/kwindesktop] Bump QML imports & fix JavaScript code style 2022-07-11 21:52:30 +03:00
ivan tkachenko
4f419afe30
[kcm/kwindesktop] Emit rowsChanged signal to fix default state highlighting
Without this, the rowsChanged signal wasn't emitting at startup, so the
binding `highlight: kcm.desktopsModel.rows !== 2` didn't work correctly.

FIXED-IN: 5.24.7 5.25.3 5.26
2022-07-11 21:52:25 +03:00
Xaver Hugl
0d302d5c66 backends/drm: also check for properties in DrmPipeline::needsModeset
Otherwise we may be missing situations where a modeset is needed

BUG: 455814
2022-07-11 14:31:55 +00:00
Vlad Zahorodnii
8f18dc5b7d Make Item::repaints() not guess repaints
The guessed repaint region is not optimal on wayland. Second, if it's a
new output, it's expected that there will be already a scene repaint
that covers all items on the given output so items don't need to provide
redundant repaint region.
2022-07-11 14:21:53 +03:00
l10n daemon script
c442f582a3 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-07-11 01:48:31 +00:00
Xaver Hugl
2d43f3eee2 backends/drm: handle disconnected but not removed connector objects properly
The kernel doesn't disable connector objects that represent physical ports
when the output gets removed. If KWin tries to change the output configuration
without explicitly disabling the connector, atomic commits can fail.
2022-07-10 11:55:57 +00:00
Alexander Lohnau
e96b9ba499 Improve docs for creating KWin effects
- use kcoreaddons_add_plugin CMake macro, the other one is KWin internal
- reference embedded json metadata in section about macros
- Provide codesnippet to json metadata
- Do not explicitly define plugin id in metadata, instead we can derive it from the library name
2022-07-10 10:05:55 +00:00
l10n daemon script
b97d12efc0 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-07-10 01:51:16 +00:00
l10n daemon script
19fb451be2 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-07-09 01:50:01 +00:00
Xaver Hugl
5451c7e0db windowview: handle windows from other virtual desktops better
Sometimes windows on other desktops are higher in the stacking order,
which causes them to unexpectedly jump above windows from the current
desktop in the effect.

To fix that, the z index is adjusted to be higher for windows on the active
virtual desktop, and windows from other desktops get reduced opacity in the
beginning of the animation
2022-07-08 17:03:16 +00:00
David Edmundson
c49620658f Create large enough atlas texture for decorations
When we render individual component of a decoration into an atlas we
ceil the positions for the individual component parts so they don't risk
overlapping. See SceneOpenGLDecorationRenderer::render

This isn't done when we set the overall texture height. This can cause
the bottommost part of the atlas (the right edge) to go out of view.

BUG: 453745
2022-07-08 12:34:22 +00:00
David Edmundson
06db7fc7ff Map XdgSurface to XdgWMBase instances properly
xdg_wm_base is a global that with a single instance in our high level
wrapper. Our surface wrapper needs to get the xdg_wm_base::Resource
instance on occastion.

Currently we go via wl_client for the mapping, but this breaks down
should a client bind wm_base twice.

BUG: 456349
2022-07-08 11:57:57 +00:00
Rodney Dawes
6af5a5e651 inputmethod: If KWIN_IM_SHOW_ALWAYS variable is set, show the keyboard
To allow for easier testing in development and for debugging purposes, when
the KWIN_IM_SHOW_ALWAYS environment variable is set, treat it as allowing
the keyboard to be shown, even when not using touch input.
2022-07-07 15:15:28 -04:00
David Edmundson
df1938b8af Fix flickering in slide effect with multi screen
The slide effect translates all windows as we switch desktop. In a multi
screen setup we don't want windows to enter a different screen during
this animation.

The current code masks everything to the current output. This is broken
for any window that spans across screens even slightly. It will not be
visible during the transform then appear on top at the end.

The new algorithm is, for each screen in each window we crop the painted
area to the intersection of the screen and the screen's translated
position.
2022-07-06 14:25:57 +00:00
Aleix Pol
298424d089 XdgOutput: Ensure we update the output size when the overrideScale changes
scaleOverride is set by KScreen through KConfig, so it's asynchronous to
the rest of update calls that may happen.
2022-07-06 12:57:30 +00:00
Vlad Zahorodnii
fa78de6219 kwineffects: Strip ScreenPaintData of transforms
ScreenPaintData provides a way to transform the painted screen, e.g.
scale or translate. From API point of view, it's great. It allows
fullscreen effects to transform the workspace in various ways.

On the other hand, such effects end up fighting the default scene
painting algorithm. For example, just have a look at the slide effect!
With fullscreen effects, it's better to leave to them the decision how
the screen should be painted. For example, such approach is taken in
some wayland compositors, e.g. wayfire, and our qtquick effects already
operate in similar fashion.

Given that, strip the ScreenPaintData of all available transforms. The
main motivation behind this change is to improve encapsulation of item
painting code and simplify model-view-projection code in kwin. It will
also make the job of extracting item code for sharing purposes easier.
2022-07-06 11:10:54 +00:00
Vlad Zahorodnii
53d25c7228 Remove assumption that the workspace starts at (0, 0)
If a leftmost output is temporarily disabled but outputs on the right
hand side are not moved, some windows may stop being movable because the
Workspace will return bad FullArea. In order to improve handling of
that case, make the FullArea same as the workspace geometry.
2022-07-06 10:27:14 +00:00
Xaver Hugl
7d5d35928f backends/drm: don't create a new output every time 2022-07-06 09:52:49 +00:00
Vlad Zahorodnii
b5ea9381d1 wayland: Send drm-lease-device::done event to the correct resource
When sending the drm_lease_device_v1.done event, we pass a connector
resource, but we need to pass a device resource.
2022-07-06 11:36:55 +03:00
Vlad Zahorodnii
40fb202aed Make IdleDetector not emit resumed signal when it's inhibited
At the moment, when an IdleDetector is inhibited, it can emit the
resumed signal. It makes sense on one hand, but also it doesn't.
Inhibited != resumed.

According to the idle-inhibit-v1 protocol specification, we don't
need to emit the resumed signal:

> Likewise, the inhibitor isn't honored if the system was already idled at
> the time the inhibitor was established, although if the system later
> de-idles and re-idles the inhibitor will take effect.
2022-07-05 20:36:04 +00:00
Xaver Hugl
a71146c999 backends/drm: don't remove connectors the kernel doesn't consider removed
Removing connectors that are still powered leads to a mismatch in atomic
commits: the crtc is still powered, but the connector also still there.
If KWin tries to disable the crtc afterwards, the atomic commits fail because
the connector needs to be disabled at the same time and it's missing from the
atomic commit request.

To fix this, whenever we fail to fetch information or get wrong data from
the kernel (like 0 modes), use the cached information instead and keep the
connector.

BUG: 456298
2022-07-05 19:11:33 +00:00
David Edmundson
4ced407828 Emit scaleOverride changed signal 2022-07-05 17:00:38 +00:00
Guenther Grau
5998326374 Extract duplicate line in present in both if branches
Use more concise code to assign workArea
2022-07-05 17:27:31 +02:00
Nate Graham
85e0d5ea55 effects/overview: make add/delete Virtual Desktop buttons consistent
These are proper nouns and should be capitalized. And let's consistently
use the term "Virtual Desktop", not just "Desktop" (which can be
confused for the desktop with the wallpaper).
2022-07-05 08:53:15 -06:00
Nate Graham
f53bb84009 effects/overview: clean up code for buttons with tooltips 2022-07-05 08:50:40 -06:00
Nate Graham
abbbc0b72c WindowHeapDelegate: add tooltip and accessibility info to close button
BUG: 456242
FIXED-IN: 5.26
2022-07-05 08:41:32 -06:00
Aleix Pol i Gonzalez
5214417ee3 screencasting: We need the opengl context to be current when creating dmabuf
Otherwise it (sometimes!) fails and gets very confused.
2022-07-04 22:52:40 +00:00
Aleix Pol
30e922c4d6 screencasting: Add support streaming dmabuf+modifier textures 2022-07-04 22:52:40 +00:00
Aleix Pol
d5ddf55e9b gbm: Don't pass any flags when creating buffers with modifiers
It seems it doesn't bring much and it may backfire. Especially don't
pass GBM_BO_USE_LINEAR as it will limit a lot the buffers that can be
created and GBM_BO_USE_RENDERING use seems to be more harmful than
helpful on most cases.
2022-07-04 22:52:40 +00:00
Aleix Pol
78d80123f1 xdgactivation: Properly prevent disabled activation notifications
The logic when checking the settings was wrong and it would always
notify unless both keys were actually disabled.

BUG: 454937
2022-07-04 17:44:10 +02:00
l10n daemon script
fb57b71e75 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-07-04 01:48:22 +00:00
Ismael Asensio
3c5c079aa5 TabBox: Do not highlight selected window for fullscreen switchers
This helps improving performance on those effects, where the
highlighted window is not even shown.

BUG: 449180
FIXED-IN: 5.25.3
2022-07-03 18:51:45 +02:00
l10n daemon script
7d08e5f251 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-07-03 01:57:17 +00:00
l10n daemon script
c0307bb402 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-07-02 02:03:09 +00:00
David Edmundson
ecdc73476f Fix apply button with animation slider speed
In updateUnmanagedItemStatus we compare the animation duration with
m_settings->animationDurationFactor
2022-07-01 13:24:44 +00:00
David Edmundson
0bb3eb2baf Write animation speed to kdeglobals
When the animation slider moved to look and feel a UI was kept within
the compositing KCM that was only visible for non Plasma users so they
still had a way to access this.

This non-plasma version still wrote to kwinrc. In theory this was fine
unless you used both. We also hit an issue where a stray
m_settings->save() call in `reenableGl` would sync the settings to the
wrong place.

This patch moves everything to write to kdeglobals and cleans up any old
entries here.

BUG: 431259
2022-07-01 13:24:44 +00:00
Aleix Pol Gonzalez
e04d9e1978 xdgactivation: Do not notify when applications try to activate themselves
There are some cases where this might happen, there's not much to
notify there anyway as it's more of an implementation detail.
2022-07-01 13:07:12 +00:00
Marco Martin
56d3b2ddc4 Set all timestamps for all touch events
in order for qml pointerhandlers to work correctly, they need
timestamps in all events (to decide for instance when to emit a
tapped or doubletapped)

BUG:456133
2022-07-01 12:13:18 +00:00
Vlad Zahorodnii
5975cd95e7 effects: Make setting WindowHeap layout mode nicer
Expose only the layout object and set its mode using "layout.mode:"
syntax rather than expose the layout object and its properties in the
WindowHeap.
2022-07-01 07:13:31 +00:00
l10n daemon script
6fa6c3f20b 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-07-01 01:52:46 +00:00
Alexander Lohnau
1ee1e011a3 Bump KWIn effects API version after changes to smart pointers in public API
BUG: 456155
2022-06-30 20:25:14 +00:00
Felipe Kinoshita
524e65813b effects/desktopgrid: Close windows on middle click
This makes it so that the windowview/overview/desktopgrid effects
all use the middle mouse button to close windows.

The previous behavior of pinning window is now assigned to the
right mouse button.

BUG: 456144
2022-06-30 20:23:17 +00:00
Xaver Hugl
0c453739b1 backends/drm: fix common mode generation
The unit for refresh rate was wrong, which caused insanely high as well
as negative refresh rates

BUG: 455477
2022-06-29 20:53:55 +02:00
Vlad Zahorodnii
a6d72d3f60 wayland: Introduce IdleDetector
The IdleDetector is an idle detection helper. Its purpose is to reduce
code duplication in our private KIdleTime plugin and the idle wayland
protocol, and make user activity simulation less error prone.
2022-06-29 20:27:50 +03:00
Xaver Hugl
da7dad1586 surfaceitem, surfacetexture: manage pixmaps and textures with std::unique_ptr 2022-06-29 13:18:51 +00:00
Xaver Hugl
1ff623e95e renderbackends: make SurfaceTexture creation methods use std::unique_ptr 2022-06-29 13:18:51 +00:00
Aleix Pol
696abac400 screencast: Do not send events when moving the cursor outside the viewport
e.g. when we have two outputs
2022-06-29 11:29:27 +00:00
Aleix Pol
a2913d1e2b screencasting: Have cursor move frames also send damage information
Otherwise we keep the last use of the buffer's which is clearly wrong.
2022-06-29 11:29:27 +00:00
Aleix Pol
7f73264f66 screencast: Also send the header when we just send the cursor update
When sending a frame that just updates the cursor, also increment the
sequential value of the frame
2022-06-29 11:29:27 +00:00
Xaver Hugl
84acb768ee effects: modernize some code
Mostly port away from manual memory management and clean up some headers
2022-06-29 10:34:50 +00:00
Vlad Zahorodnii
24dfdd70c0 effects: Drop WindowPaintData::modelViewMatrix()
It's unused and it conflicts in a way with PaintData::translation(),
PaintData::rotationAngle() and PaintData::scale().
2022-06-29 09:50:43 +00:00
Xaver Hugl
ef97158f96 backends/drm: suppress logging for direct scanout
BUG: 456089
2022-06-29 09:59:10 +02:00
Xaver Hugl
29625218d3 backends/drm: fix flicker with rotation on mobile
When we use a shadow buffer, we always render to the whole surface - setting
the damage region is incorrect and invokes undefined behavior. On the Lima
driver this caused flickering on screen rotation.
To fix this, don't set a damage region when we use a shadow buffer, which is
effectively setting the damage region to the full surface
2022-06-28 08:38:43 +00:00
Aleix Pol
3d3fcd7ab4 tablet: Leave the surface we were previously on, not the one we are going to
This sometimes results in a crash and it's logically wrong as it was.
2022-06-28 03:39:31 +02:00
Xaver Hugl
47c08d6f66 backends/drm: ensure modeset properties are reset properly
Without this, all atomic modeset commits fail on setups with a VR headset
2022-06-27 19:14:08 +00:00
Vlad Zahorodnii
d6e9b8011a effects/slide: Save correct current position
effects->desktopCoords() returns the position of the desktop in pixels,
while we want the desktop grid coords, i.e. if the virtual desktop is in
the first row, second column, we want m_currentPosition to be (1, 0).
2022-06-27 12:13:12 +00:00
l10n daemon script
d228a3d16e 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-06-27 01:43:00 +00:00
l10n daemon script
9eac2cc6eb 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-06-26 01:42:44 +00:00
Xaver Hugl
42c5e6bcf6 backends/drm: handle failing commits better
It can happen that the drm backend temporarily lacks permission to do atomic
commits, or that the cached drm property values become out of sync with
the real values held by the kernel. Instead of failing with both, attempt
to update property values and try the commits again at a later time.
2022-06-25 17:25:17 +02:00
l10n daemon script
6ff6dcac26 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-06-25 01:59:17 +00:00
Marco Martin
66a54d38d4 effects: Set timestamp for input events
Set the time for mouse and touch events. This is especially important
for the mouse is as the timestamp will be used to discriminate between
single and double click. Previously this was always sending the double
click event, making buttons work only every other click.

BUG: 454275
BUG: 449907
2022-06-24 17:54:55 +00:00
Marco Martin
66d1278794 Internal tracking for quick effect item focus
focus used to be always forced to the root item of the view in the
"active screen" (which behavior is configurable between mouse poosition
and screen of active window)
now set focus to that particular view only if nothing is focused, also when
the user explicitly sets focus to an item in another view
remove focus to the old one so the item properly focused would be there

BUG:455807
BUG:455783
CCBUG:455633
2022-06-24 15:56:08 +00:00
l10n daemon script
aad0673961 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-06-24 01:42:09 +00:00
Vlad Zahorodnii
b62dd29210 backends/drm: Change the base class of DrmLeaseOutput
At the moment, the DrmLeaseOutput class inherits from the
KWaylandServer::DrmLeaseConnectionV1Interface class. While this works,
it's not a future-proof design. For example, kwin could also lease its
"desktop" outputs in order to let another wayland compositor run
alongside it.

Also, it's a good practice to prefer composition over inheritance.
2022-06-23 19:51:24 +00:00
Weng Xuetian
a521525c4d Delegate updateShadow to event loop.
If PlasmaCore.Dialog resizes while visible, the kwin shadow property
used by InternalWindow may update the shadow during rendering and cause
crash related to current context.
2022-06-23 17:18:08 +00:00
Niklas Stephanblom
6838b1132f Windowview: Fix broken keyboard navigation while filtering
After the 5.25 update, one could not see which window was highlighted until one
manually unfocused the SearchField and then pressed any key to refresh the WindowHeap.
Also, the searchbar would (most of the time) "absorb" the arrow keys so one had to
also unfocus it to really be able to select windows with they keyboard. 

With this change, there is always one window highlighted while filtering using the
search box. Also, one can select another window with the arrow keys without manually
unfocusing the searchbox. This heavily improves the keyboard functionality in this
effect that got lost with the 5.25 update of presentwindows to windowview and
resolves complaints about the keyboard navigation being buggy. 

BUG: 455633
BUG: 455764
BUG: 455099
BUG: 455586
BUG: 455753
FIXED-IN: 5.25.2
2022-06-23 17:13:57 +00:00
Weng Xuetian
18763d1483 Fix flaky testTextInputV3Interface
In a74c436156, we changed behavior that
every commit() will be followed by a done(), which makes this test might
catch a different done() from server. Change the spy to make sure it
exhaust all other done before checking the one expected.
2022-06-23 14:44:42 +00:00
Vlad Zahorodnii
2ade8111de effects: Fix a type mismatch warning in WindowHeap
file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:55:9: Unable to assign null to QUuid
2022-06-23 11:57:50 +00:00
Laurent Montel
c83568dfdd GIT_SILENT: remove extra ';' 2022-06-23 13:43:09 +02:00
Laurent Montel
d1837b8603 Remove extra ';' 2022-06-23 06:56:25 +02:00
l10n daemon script
08d140982d 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-06-23 01:43:29 +00:00
David Edmundson
be5b23628f [effects] Fix QML after recent refactor
fd25e96969 looks like it attempted to
rename an alias and got out of sync.
2022-06-22 19:59:22 +01:00
Marco Martin
0534110eed Fix the math of the down gesture 2022-06-22 17:54:54 +02:00
Aleix Pol
9208a8eb0e screencasting: Properly disable the cursor when it exits the viewport
Otherwise it would glitch
2022-06-22 15:42:50 +02:00