Commit graph

3960 commits

Author SHA1 Message Date
l10n daemon script
d78379da62 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-08-18 01:47:34 +00:00
Vlad Zahorodnii
59907c12ff Remove own copies of drm_fourcc.h
libdrm is a mandatory dependency so we don't need to keep own copies of
drm_fourcc.h anymore.
2022-08-17 14:08:05 +00:00
Arjen Hiemstra
a8e6184d3c outputlocator: Return "Unknown" as screen name when we can't determine it
This slightly refactors the name generation in outputlocator to ensure
we don't add spaces when there's nothing to add a space to. It also
ensures that if we can't determine a proper name because all parts are
empty we return "Unknown" as name.
2022-08-17 11:45:37 +00:00
Arjen Hiemstra
5aa7a48f93 Replace "Show FPS" effect with a QML version
This removes a bunch of custom rendering, replacing it with a simple QML
file that makes use of KQuickCharts for chart rendering. Functionally,
it should be mostly the same except that I removed all configuration
options as I don't see why we have those.
2022-08-17 11:12:39 +00:00
Vlad Zahorodnii
fa5be54a6d Remove Platform::repaint()
It doesn't belong in Platform.
2022-08-17 10:39:46 +00:00
Arjen Hiemstra
7951940761 Don't use release() on a unique_ptr if we don't intend to release ownership
There is nothing indicating that `OffscreenQuickScene::rootItem()`
releases ownership. Additionally, calling it multiple times currently
means we get a nullptr the second time we call it which crashes the
outputlocator effect.
2022-08-17 10:11:01 +00:00
Vlad Zahorodnii
cf5205439c backend/wayland: Fix computing output pixel size in xdg_toplevel.configure handler
Currently, we pass the logical size but setGeometry() expects the size
in device pixels. It fixes "kwin_wayland --scale 2" shrinking on every
configure event.
2022-08-17 09:48:38 +00:00
Vlad Zahorodnii
facef8d301 Remove irrelevant comment 2022-08-17 07:51:44 +00:00
Arjen Hiemstra
6831f25125 Remove the lookingglass effect
It has been broken for a while (at least as long as 5.25) with no
bugreports about it. It also doesn't look all that great from the video.
2022-08-17 07:14:56 +00:00
Volker Krause
28210372a4 Remove unused surface property
This helps with the Qt6 build, as  KWaylandServer::SurfaceInterface is a
QObject subclass used in a property here, while we are only able to
forward declare it here as it comes from a library we don't link against.
And that's no longer supported in Qt6.
2022-08-17 06:30:19 +00:00
Laurent Montel
c22aa8092a Remove no longer needed ifdefs 2022-08-17 07:59:46 +02:00
Vlad Zahorodnii
811084503f Remove test_wayland_outputdevice.cpp
It's unused and tests v1, which has been dropped long time ago.
2022-08-16 17:46:36 +03:00
Vlad Zahorodnii
3381441167 Remove unused "q" field 2022-08-16 14:06:39 +00:00
Vlad Zahorodnii
42743a7826 Merge contents of outputconfiguration_v2_interface.cpp and outputmanagement_v2_interface.cpp
The established pattern is to try to keep the implementation of a
wayland protocol in one file.
2022-08-16 14:06:39 +00:00
Janet Blackquill
506e2d6f9f drm_gpu: don't bother trying to assign a crtc to a connector that isn't connected
BUG: 457002
2022-08-16 13:04:31 +00:00
Vlad Zahorodnii
f2e594358c Remove Platform::supportsOutputChanges()
If the platform does not support configuring outputs, applying a config
must fail. However, almost all output backends support output
configuring except, perhaps, the x11 backend, but that case doesn't
matter.
2022-08-16 12:31:28 +00:00
Xaver Hugl
8a154d3af1 fix fullscreen move 2022-08-16 14:05:20 +02:00
Vlad Zahorodnii
42bb455b06 wayland: Remove parent arg in OutputChangeSetV2 constructor 2022-08-16 13:13:40 +03:00
Vlad Zahorodnii
9208fb9926 Remove unused include 2022-08-16 12:18:04 +03:00
Vlad Zahorodnii
da41985051 wayland: Use already_applied error in kde-output-management-v2 2022-08-16 12:18:04 +03:00
Vlad Zahorodnii
5f15f3b47c wayland: Move output-management-v2 implementation in wayland/
Since both output-management-v2 protocol implementation and the rest of
kwin live in the same place and the fact that kde-output-management-v2
is very plasma specific, we can move Platform::requestOutputsChange() to
the implementation of kde-output-management-v2 protocol, it simplifies
the code a bit and improve code encapsulation.

In order to further simplify kde-output-management-v2 protocol, this
change alters the behavior of the protocol so an output configuration
can be applied only once, which is a very reasonable behavior.
2022-08-16 12:18:04 +03:00
Vlad Zahorodnii
a9267bdcdc plugins/qpa: Assume there's current context when swapBuffers() is called
It can happen that the window is resized after makeCurrent() and before
swapBuffers(). In that case, context()->makeCurrent() will re-create the
fbo and qpa will present an uninitialize fbo.

Assume that there's current context when swapBuffers() is called. Other
QPA already do this, for example, QtWayland. This would make the
behavior of our qpa consistent with QtWayland and fix resizing the fbo
in swapBuffers().

In general, kwin should be able to handle size mismatch between the fbo
and QWindow, but as an extra hardening measure, we could forbid resizing
windows during rendering, this can be done later though.
2022-08-16 09:02:04 +00:00
Xaver Hugl
11ad5fea9a effects/slide: apply slide setting for docks to applet panels
Otherwise they detach from panels, which looks weird
2022-08-16 08:20:09 +00:00
Volker Krause
835dc7c818 Explicitly mark DrmObject as non-copyable
It implicitly already is not copyable, due to the unique_ptr member.
However, Qt6 moc code isn't realizing that and fails to compile the
DrmPlane Q_GADGET sub-class of this.
2022-08-15 18:03:46 +02:00
Xaver Hugl
6cdb1e6f64 backends/drm: add stricter checks for direct scanout
Buffers with implicit modifiers from another GPU must not be imported, as
the layouts may not be compatible.
For buffers with incompatible modifiers, direct scanout can also be rejected
early, saving some computational power.

BUG: 457851
2022-08-14 19:53:30 +02:00
Mathieu Jobin
3ac5116487 Update URL to theme-details on develop.kde.org 2022-08-14 12:34:41 +09:00
Xaver Hugl
f4e917f734 backends/drm: release buffers for disabled objects
BUG: 456686
2022-08-12 19:52:24 +00:00
ivan tkachenko
a6cc4b557b
debug console: Sort windows tree model
Now you can see properties like 'minimizable' and 'minimized' literally next
to each other, not on the other end of a view.
2022-08-12 15:16:14 +03:00
Xaver Hugl
ca7a2cdef6 plugins/nightcolor: use FileDescriptor class 2022-08-11 21:27:33 +02:00
Xaver Hugl
9c4f3d447f debug console: use FileDescriptor class 2022-08-11 21:27:33 +02:00
Xaver Hugl
1b1e0ab95f wayland/drmlease: use FileDescriptor class 2022-08-11 21:27:33 +02:00
Xaver Hugl
1464028934 backends/drm: use FileDescriptor class for drm buffer fds 2022-08-11 21:27:33 +02:00
Xaver Hugl
6cd4d69644 dmabuf: make use of FileDescriptor class 2022-08-11 21:27:33 +02:00
Xaver Hugl
cb8be232a1 utils: introduce helper class for file descriptors 2022-08-11 21:27:33 +02:00
Vlad Zahorodnii
ca6f84dad6 Rework how wl_output and kde-output-device are created
Create wl_outputs only for outputs in Workspace.
2022-08-11 17:17:47 +03:00
Vlad Zahorodnii
c7293d95e0 backends/{x11,virtual}: Allocate render data for all available outputs
This makes the behavior of virtual and x11 backend consistent
with the drm and the wayland backend and reduces the number of users of
the Platform::outputEnabled signal.
2022-08-11 12:39:51 +00:00
Mikhail Zolotukhin
f6054863e1
window: expose "output" property
This allows it to be used from QML KWin Script or via property() C++
call.

This is useful to be able to use client area function with pointers
API without falling back to VirtualDesktop X11 ids from scripts.
2022-08-11 14:42:06 +03:00
Vlad Zahorodnii
6982c506a5 wayland: Setup window management when starting to manage X11 window
We don't need to wait until the window is ready for painting in order to
create a plasma window, in fact, quite the opposite is desired. It's
better if the plasma window is created in manage() so the task manager
displays the corresponding item even if the window is not showing up for
whatever reason.
2022-08-11 07:21:12 +00:00
Natalie Clarius
979dddb4f1 Fix wrong center snap zone value
Snap to center was mistakenly using the zone size for snap to window.
2022-08-11 06:37:07 +00:00
Vlad Zahorodnii
4d1c82d111 Make ColorManager use outputs managed by Workspace
This removes one more dependency on Platform::enabledOutputs() and
Workspace knows better about what outputs are managed.
2022-08-10 10:17:30 +00:00
Vlad Zahorodnii
b9c00ba90d Create color manager after workspace 2022-08-10 10:17:30 +00:00
ivan tkachenko
3197c7892f
effects/{private,desktopgrid,overview}: Guard against function execution when component is being destroyed
Accept drop events correctly and use returned value (action) of
Drag.drop() to guard against the situation where the delegate is about
to be destroyed.

This does not fix any bugs per se, except suppressing a warning about
undefined targetScreen being printed to a console on every window dropped
onto a different virtual desktop.
2022-08-10 12:20:27 +03:00
Vlad Zahorodnii
c3f9aab329 plugins/screencast: Allow including cursor in window screencasts
BUG: 452960
2022-08-10 06:38:05 +00:00
Blake Sperling
1a475a73de effects: Improve animation durations and easing curves in Windowheap-based effects
This commit doubles the animation durations for WindowHeap-based effects
(Overview, Present Windows, and Desktop Grid) and uses the OutCubic easing
curve for their opening and closing animations. This makes them feel smoother
and more comfortable.

BUG: 455521
BUG: 448538
FIXED-IN: 5.26
2022-08-09 23:54:44 +00:00
Xaver Hugl
9f41620b77 backends/drm: don't crash if beginFrame fails
CCBUG: 455532
2022-08-09 22:18:58 +02:00
ivan tkachenko
8feaa8922a
effects/{private,desktopgrid,overview}: Clean up QML/JS code and bump imports 2022-08-09 22:02:38 +03:00
ivan tkachenko
f892c9510e
effects/colorpicker: Fix off-by-one error during coordinates conversion
Due to this bug color picker used to not only select one pixel higher
than it should (which is quite negligible), but also returned garbage
value for the topmost row of pixels (when you push the cursor against
the top edge of the screen).

FIXED-IN: 5.24.7, 5.25.5, 5.26
2022-08-09 20:23:26 +03:00
ivan tkachenko
2fa4a4c4e9
effects/colorpicker: Factor out effects->renderTargetRect() constant 2022-08-09 20:23:22 +03:00
Kai Uwe Broulik
90688b11f6 desktopbackgrounditem: Prefer desktop window with size matching output
Conky monitor's floating popup is of type desktop, too, and when it
gets picked over Plasma's desktop window, visual artifacts can be
observed behind e.g. the overview effect.
2022-08-09 15:00:51 +00:00
Vlad Zahorodnii
3934d1d0f2 wayland: Remove surface() check in Window::setupWindowManagement()
At the moment, an Xwayland window can be marked ready for painting even
though the corresponding wl_surface is missing. If that happens,
Window::setupWindowManagement() will fail to create a plasma window and
the task manager won't display the corresponding item.

As a short-term solution, remove the surface() check. It's not really
needed after all. For example, if it takes too long to start an app or
it doesn't show up at all, we still want to see a task manager item.

In long-term, kwin probably needs to take into account both xsync and
whether wl_surface has been associated, which is more complex.

BUG: 444325
2022-08-09 11:26:40 +00:00
David Edmundson
c5e40c9687 Use correct geometry in GTKShowWindowMenu 2022-08-09 06:59:13 +00:00
David Edmundson
2854d59da4 Avoid rounding on X11 configure events
As per the comment this is in kwin logical space not X11 space,
therefore results should be floating.
2022-08-09 06:59:13 +00:00
Vlad Zahorodnii
c214801a23 wayland: Simplify geometry setup code in InternalWindow
This weird setup code was needed to work around buggy geometry code a
while ago.

It fixes the debug console getting offscreen.
2022-08-08 16:43:53 +03:00
Volker Krause
b01b13353b Remove QDesktopWidget use in WorkspaceWrapper for Qt6
This is basically a continuation of 73973641.
2022-08-08 10:03:38 +00:00
Xaver Hugl
039dd96f8d xwaylandinterface: move global to Application 2022-08-08 09:16:22 +00:00
Xaver Hugl
53815e2b28 databridge: move global to Xwayland 2022-08-08 09:16:22 +00:00
Xaver Hugl
fde7d44941 tabletmodemanager: move global to Application 2022-08-08 09:16:22 +00:00
David Edmundson
49d80162c5 [effects/blend] Fix opacity value of old window
We animated from 1.0 to 0.0, however this does not take into account
that a previous effect may also have adjusted the opacity.

We should multiply accordingly.
2022-08-08 08:36:27 +00:00
David Edmundson
3b26936019 Ammend documentation for prePaintScreen wrt openGL context 2022-08-08 06:45:44 +00:00
l10n daemon script
fbec3a1f80 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-08-07 01:49:26 +00:00
Nicolas Fella
ed829eb5ad Remove unused includes 2022-08-06 19:51:13 +02:00
Xaver Hugl
41c23fa70e effects/windowview: always set the mode when activating with gestures
Otherwise the mode uses is defined by the last time the effect was used and
thus not very predictable
2022-08-06 16:01:56 +00:00
Nicolas Fella
7744a941ce Fix warning about lambda capture
C++20 doesn't like capturing 'this' via '='
2022-08-06 15:12:35 +00:00
Nicolas Fella
9a34ebbffc [x11] Refactor output updates
The current code has multiple index-based for loops iterating over items we get from XCB

Dealing with raw indices is error-prone and not pretty

By using std::span we can replace these loops with range-based for loops

Also remove some intermediate containers that aren't neccesary
2022-08-06 02:26:39 +00:00
Arjen Hiemstra
77af052f9d WindowView: Add "show windows from class on current desktop" mode
We currently have "windows from current desktop" and "windows from
class" but not one combining both. This adds that mode along with a
(default empty) shortcut and border activation.

BUG: 413342
2022-08-05 13:52:12 +00:00
Xaver Hugl
02f55e0e40 wayland: print warning about automatic backend selection
BUG: 457491
2022-08-05 00:58:37 +00:00
ivan tkachenko
aaa5e6fee3
effects/private: Fix ExpoLayout reflowing in Desktop Grid while dragging
This fixes makes ExpoLayout independent of its position on a screen,
which in turn stops it from randomly reflowing while dragging a virtual
desktop across desktop grid. It also removes an unwanted animation at
the end of activation of desktop grid: desktops move in place and then
windows proceed to adjust themselves resulting in a double animation.

FIXED-IN: 5.25.5 5.26
2022-08-04 21:04:09 +03:00
Xaver Hugl
97939ceae8 backends/drm: fix blob updating
Two things about the code were wrong:
1. m_current is used in updateBlob() but was only updated afterwards
2. the assumption that the property having the same ID means it has the
same blob contents is not always true

BUG: 449285
2022-08-04 15:48:32 +00:00
Xaver Hugl
8955a2420e replace all uses of QScopedPointer with std::unique_ptr 2022-08-04 12:30:09 +00:00
Kai Uwe Broulik
3e820f71c3 useractions: Don't offer opening KCMs if they weren't built
Otherwise this add a few "Configure" entries to the window menu
which do nothing.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-04 10:57:38 +00:00
Kai Uwe Broulik
62008e7b62 plugin: Use kwin_export.h instead of kwinglobals.h
It only uses the `KWIN_EXPORT` macro in plugin.h.
kwinglobals.h comes from libkwineffects and not kwin core.

(`KWIN_PLUGIN_VERSION_STRING` comes from config-kwin.h)

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-04 11:44:48 +02:00
ivan tkachenko
2fd4106588
effects/private: Prevent fading windows from moving downward in WindowView effect
Inheriting "active" state was meaningless, since "active" state binds
position to a ExpoCell which itself is in a disabled state.

FIXED-IN: 5.25.5 5.26
2022-08-03 23:55:06 +03:00
ivan tkachenko
b6f6e7f15a
effects/desktopgrid: Fix panel opacity animation during transition
It did fade back in, but at the beginning of animation it used to just
instantly disappear.

FIXED-IN: 5.25.5 5.26
2022-08-03 00:59:10 +03:00
Xaver Hugl
76fbffb40b screenlockerwatcher: move singleton to Application 2022-08-02 21:37:41 +00:00
Xaver Hugl
497a78b7cf tabbox: move global to Workspace 2022-08-02 21:37:41 +00:00
Xaver Hugl
43b78e40d8 screens: move singleton to Workspace 2022-08-02 21:37:41 +00:00
Xaver Hugl
9439e7719d screenedge: move singleton to Workspace 2022-08-02 21:37:41 +00:00
Xaver Hugl
719147952d rulebook: move singleton to Workspace 2022-08-02 21:37:41 +00:00
Xaver Hugl
0d704b8913 placement: move singleton to Workspace 2022-08-02 21:37:41 +00:00
Xaver Hugl
3c56bd9723 refactor Outline and move its singleton into Workspace 2022-08-02 21:37:41 +00:00
Marco Martin
027ca22908 When an arrow key is not accepted look for adjacent views
When no qml items manage the arrow key event, the root item will manage it looking to give focus to a view in the given direction derived from the arrow key

BUG:455783
2022-08-02 15:59:26 +00:00
Xaver Hugl
369194ab72 effectshandler: ignore inputmethod on X11
BUG: 457402
2022-08-02 12:15:37 +02:00
l10n daemon script
5513291dbe SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-08-02 01:45:59 +00:00
l10n daemon script
84e5d92f67 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-31 01:49:29 +00:00
David Edmundson
63bf811200 Update QtQuick views at the start of the frame
Right now we update QtQuick views after a composition has rendered so
that we'll have them ready for our next frame.

One of my machines (With X11 + nvidia) was quite stuttery, profiling
shows we spend a huge amount of time with the CPU blocked waiting for
the vblank from the previous main compositing to finish swapping before
we could start processing the QtQuick rendering. Time when the CPU is
blocked is wasted time.

This patch does mean kwin's compositing cycle lasts longer but a recent
patch changes the rendering policy when we start a fullscreen effect anyway so
hopefully that should still give us enough time to render that first frame in time.
2022-07-29 15:27:40 +00:00
Aleix Pol
4384f9c5fd xkb: Use Ctrl+Mrys+Zenkaku_Hankaku to toggle the touchpad 2022-07-29 14:50:00 +00:00
Aleix Pol
aee8f5d648 xkb: Add a workaround to support Zenkaku_Hankaku keycode
It's not working otherwise and some hardware uses it for toggling the
touchpad.
2022-07-29 14:50:00 +00:00
Vlad Zahorodnii
c3d5c3db1d x11: Add a helper to get the default screen
Since the screen number is well-known, we can look up the default
screen on demand. Note that xcb_get_setup() is pretty cheap as it
simply returns a const pointer to pre-allocated data.
2022-07-29 14:15:12 +00:00
Aleix Pol
94ee33e9be wayland: Fix touch event delivery to subsurfaces
Use SurfaceInterface::inputSurfaceAt when deciding which surface are we
entering when sending a pointer event from a touch, in case it falls
onto a subsurface.

BUG: 452967
2022-07-29 11:39:12 +00:00
Aleix Pol
c73444dd12 wayland: Do not allocate a full list just to check if there's values 2022-07-29 11:39:12 +00:00
Vlad Zahorodnii
40044f21e1 effects: Honor transforms in OffscreenEffect
This ensures that transforms are honored with effects such as wobbly
windows.
2022-07-29 11:08:59 +00:00
Arjen Hiemstra
15fbddc3d6 Register KWin::SessionState with QMetaType
Otherwise it cannot be used in scripts - like the sessionquit effect
which uses it to check if we're actually shutting down.
2022-07-29 09:52:16 +00:00
Arjen Hiemstra
bb91c94855 Expose Workspace::showingDesktop and a setter as D-Bus api
This allows us to unify the X and Wayland codepaths that currently go
through window-system specific IPC. It also allows us to easily track
who called "setShowingDesktop" and cancel the effect when that client
disappears.

CCBUG: 449445
2022-07-29 09:52:16 +00:00
Nicolas Fella
e0a6d02984 [x11] Fix loading monitor edid
i is the counter for the crtc loop, not the monitor loop

This fixes loading the edid for all monitors and thus the output identifier effect
2022-07-29 01:41:06 +02:00
ivan tkachenko
54e74df57b
effects/private: Actually fade out minimized windows on exit
This is most likely just an oversight/omission from the times when the
component was actively developed. There are five states total, including
one for realtime interactions; four others need to be transitioned to.
2022-07-28 18:31:38 +03:00
ivan tkachenko
2bca18bc5f
effects/overview: Fix animation of windows scaling back from a desktop bar
Due to nondeterministic nature of signal propagation in QML, changing
both targetScale and state depending on dragHandler's activity could
result in targetScale wrongly updating before the state change(and thus
applied property changes and subsequent animated transition).

This fixes a bug when a window dragged to the top (but not onto another
desktop) would animate its position back to its original position on a
heap, but the scale would remain constant until the end of animation
and only then rapidly jump back to a normally scaled state.
2022-07-28 18:31:36 +03:00
Kai Uwe Broulik
4c6010b078 scenes/opengl: Check whether pixmap is valid before generating quads
Quad generation needs a valid surface pixmap. This did not surface
before as the pixmap was only accessed when looping the region which
typically was empty without a pixmap.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-07-28 14:15:44 +00:00
Kai Uwe Broulik
1e3a81249c SurfaceItem: Use pixmap() for quad generation
This uses the previous pixmap if the current one is invalid,
which ensures the generated quads have sane coordinates.

The issue caused flickering while resizing Chrome after
2f4fa23e61

While at it, move `size` out of the loop as it doesn't change.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-07-28 14:15:44 +00:00
David Edmundson
259f4d7838 Drop superfluous toPoint calls in input 2022-07-28 11:55:43 +00:00
David Edmundson
89be63f600 Port windowStepUserMovedResized to floating geometry 2022-07-28 11:55:43 +00:00
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