Commit graph

4579 commits

Author SHA1 Message Date
Xaver Hugl
d5a2c639a0 window: fix checkWorkspacePosition moveRight/Bottom
With QRectF, moveRight and moveBottom have an effective offset of 1 vs QRect
2022-11-02 17:58:29 +00:00
Xaver Hugl
264ecf40f8 placementtracker: fix some windows not being restored
If a window was moved by the user, it got effectively blacklisted from being
ever restored again. Instead of only tracking the last restore point, compare the
current window state with the state it had when the output configuration was last
seen. If either that or the last restore point match the window, restore the old
window state.
2022-11-02 17:58:29 +00:00
Xaver Hugl
84635c71ec plugins/screencast: centralize format querying into the RenderBackend
BUG: 460563
2022-11-02 17:10:10 +01:00
Vlad Zahorodnii
e73fedf2ae x11: Use moveResizeGeometry() instead of frameGeometry() where appropriate 2022-11-02 11:00:03 +00:00
Vlad Zahorodnii
a235cd6d26 build: Hardcode kwin name
We use KWIN_NAME, KWIN_INTERNAL_NAME_X11 and KWIN_INTERNAL_WAYLAND
properly only in a few places. In other, we use hardcoded names.

Let's not bother and hardcode kwin names everywhere rather than have one
foot in and one foot out, it's simpler.
2022-11-02 10:21:23 +00:00
Vlad Zahorodnii
1801421080 Forward declare Xkb in keyboard_input.h 2022-11-02 09:21:55 +00:00
Vlad Zahorodnii
391c777936 Remove unused keyboard_input.h include 2022-11-02 09:21:55 +00:00
l10n daemon script
33825b2e0a 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-11-02 02:00:07 +00:00
Nicolas Fella
3eb9106466 Expose enabledByDefault of input device to DBus 2022-11-01 18:21:42 +00:00
Vlad Zahorodnii
89607dfebd qAsConst -> std::as_const
We started using std::as_const() in some parts of kwin, so let's use it
everywhere for the code consistency sake.
2022-11-01 16:52:01 +02:00
l10n daemon script
2f7c77af18 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-11-01 01:53:35 +00:00
Weng Xuetian
fda53d8253 Fix blur/contrast for X11 window if Xwayland is not scaled.
X property from X11 window contains X native coordinates. Need to
apply transform to use them in the effects like blur/contrast.

BUG:461021
2022-10-31 22:42:10 +00:00
Xaver Hugl
9fd260c3c9 backends/drm: add logging for adding GPUs
We already log when a GPU gets removed, it only makes sense to also log
when it got added
2022-10-31 20:46:51 +00:00
Nicolas Fella
251e211c5b [effects/windowview] Don't allow setting non-global shortcuts
Only global shotcuts make sense here
2022-10-31 19:46:15 +00:00
Vlad Zahorodnii
29188eb7b2 Move InputDevice::{outputName,setOutputName} implementation to cpp file
Removes the need for Q_UNUSED macro.
2022-10-31 19:07:30 +00:00
Xaver Hugl
b5873ef792 backends/drm: fixes for bitmask drm properties 2022-10-31 17:05:26 +00:00
Xaver Hugl
420358709a backends/drm: don't test hardware rotation if not supported by the driver 2022-10-31 17:05:26 +00:00
Vlad Zahorodnii
d7b710a9a1 Fix -Wunused-variable warnings 2022-10-31 15:50:37 +00:00
Vlad Zahorodnii
7fffe99328 build: Add -Wno-unused-parameter compiler option
Due to being a compositor, kwin has to conform to some certain
interfaces. It means a lot of virtual functions and function tables to
integrate with C APIs. Naturally, we not always want to use every
argument in such functions.

Since we get -Wunused-parameter from -Wall, we have to plumb those
unused arguments in order to suppress compiler warnings at the moment.

However, I don't think that extra work is worth it. We cannot change or
alter prototypes in any way to fix the warning the desired way. Q_UNUSED
and similar macros are not good indicators of whether an argument is
used too, we tend to overlook putting or removing those macros. I've
also noticed that Q_UNUSED are not used to guide us with the removal no
longer needed parameters.

Therefore, I think it's worth adding -Wno-unused-parameter compiler
option to stop the compiler producing warnings about unused parameters.
It changes nothing except that we don't need to put Q_UNUSED anymore,
which can be really cumbersome sometimes. Note that it doesn't affect
unused variables, you'll still get a -Wunused-variable compiler warning
if a variable is unused.
2022-10-31 15:50:37 +00:00
Xaver Hugl
c308a262be kcmkwin/compositing: remove tearing prevention and scaling options
The option are confusing and noone should ever need to touch them.

BUG: 450279
2022-10-31 14:43:54 +00:00
Nicolas Fella
378006cc73 [effects/overview] Don't allow setting non-global shortcuts
Only global shotcuts make sense here
2022-10-31 13:28:15 +00:00
Xaver Hugl
3f3d41f259 backends/drm: fix common mode generation
There were overflows in the bandwidth estimation calculation. To simplify things,
also only generate common modes if the display doesn't advertise them on its own
already.
2022-10-31 12:49:25 +00:00
Aleix Pol
f649363a4e Address warnings
|-operator on bool
Comparison on technically different enums.
2022-10-31 12:23:06 +00:00
Albert Astals Cid
a9f5b56804 Make gettext happier
Seems we can't have a plural with an argument in singular and not in the
plural

a format specification for argument 2, as in 'msgstr[0]', doesn't exist in 'msgid_plural'
msgfmt: found 1 fatal error
2022-10-31 08:17:11 +00:00
l10n daemon script
365dfaa4c0 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-10-31 01:53:33 +00:00
Aleix Pol
8417492781 Include org.freedesktop.locale1 support
Makes it possible to follow the dbus service for locale configuration,
making it possible to have third parties integrate with Plasma.

This is done opt-in for now, it can be adopted generally in the future,
if necessary.
2022-10-30 23:03:55 +01:00
Yunus Erdem Ergül
96cfc411f0 scripting: Expose cursor position to the API
Added cursorPos property and cursorPosChanged signal to WorkspaceWrapper
2022-10-30 10:34:05 +00:00
Aleix Pol
47c3c2d143 libinput: Support switching the targetted output with a shortcut
I was told it's how artists are used to using these tablets so it makes
sense to support the workflow.
2022-10-29 22:30:03 +00:00
Aleix Pol
77c5198dc8 libinput: Allow setting an empty output name
For tablets, it signifies "follow the active output".
2022-10-29 22:30:03 +00:00
Aleix Pol
a11681918a OSD: Fix OSD::show from the non-main thread
If it's issued from a different thread, pass it to the main one so it's
eventually displayed.
Otherwise, it would just crash kwin.
2022-10-29 22:30:03 +00:00
l10n daemon script
ef60c8e53c 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-10-29 01:52:40 +00:00
Xaver Hugl
b3d0698126 backends/drm: rewrite most of EglGbmLayerSurface
This rewrite ensures that
- formats are tested for multi-gpu transfer
- dmabuf with either 10bpc or 8bpc buffers are preferred to cpu copy
- formats where drmModeAddFB2 fails are skipped
2022-10-28 16:09:10 +02:00
Xaver Hugl
cd6a219961 backends/drm: make the buffer target constant
There's no reason for it to be dynamic
2022-10-28 16:09:10 +02:00
Xaver Hugl
228575f0ae backends/drm: store creation flags in GbmBuffer 2022-10-28 16:09:10 +02:00
Kai Uwe Broulik
0902d91a42 nightcolormanager: Emit timing change only when they have actually changed
Avoids pointless DBus traffic.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-10-28 11:43:46 +00:00
Vlad Zahorodnii
d89feb33b2 Remove some Q_UNUSED
It's weird to wrap a return value in Q_UNUSED macro.
2022-10-28 09:40:08 +00:00
Vlad Zahorodnii
57eb60122b Make Atoms code more readable
It improves readability by making calling getReply() explicit.
2022-10-28 09:40:08 +00:00
Vlad Zahorodnii
b30e81cb22 x11: Keep compositing mode untouched if kwin crashes
kwin can crash for reasons that have nothing to do with compositing. If
that's the case, after two crashes compositing will be permanently
disabled and you would need to go to system settings to reenable it, the
timestamp based check in the x11 backend won't be effective.

CCBUG: 452344
2022-10-28 09:38:38 +00:00
Vlad Zahorodnii
fd978838cc qpa: Geometry handling fixes
We don't need to emit {x,y,width,height}Changed signals ourselves. We
also need to send an expose event otherwise the window can be rendered
incorrectly if it's resized. The logic follows QtWayland implementation.
2022-10-28 08:47:48 +00:00
Vlad Zahorodnii
9774eacbbe Remove ServiceTypes info
Binary plugins don't need it. KPackage packages have "KPackageStructure"
property instead.
2022-10-28 06:58:44 +00:00
Vlad Zahorodnii
61644305f0 wayland: Drop unused field in XdgOutputManagerV1Interface 2022-10-27 11:57:52 +00:00
Vlad Zahorodnii
0c34957625 wayland: Hide XdgOutputV1Interface class
With the pull approach, the XdgOutputV1Interface class doesn't have to
be exposed in the public api and can be made private to simplify the
implementation of the xdg-output-v1 protocol.
2022-10-27 11:57:52 +00:00
Vlad Zahorodnii
b40d76d35c wayland: Prevent matching dnd actions after drop
Currently, kwin will continue matching dnd actions after a drop. This is
mainly needed in order to make "ask" action work.

However, it appears like there are clients in the wild that update offer
actions after receiving wl_data_source.dnd_drop_performed and wl_data_device.drop
events.

One could argue that's a client bug, and perhaps it is, but the spec is
vague about that. In meanwhile, let's make sure that dnd action matching
is active after drop only when the selected data source action is "ask."
2022-10-27 11:03:06 +00:00
Łukasz Patron
a9acef8573 x11: Don't force QT_QPA_PLATFORM=xcb
This is basically a cherry pick of 77ec43d5e (Don't force
QT_QPA_PLATFORM=wayland), except for X11.
2022-10-27 08:03:59 +00:00
Łukasz Patron
c2b4f03f96 x11: Don't force QT_NO_GLIB=1
This breaks certain apps, e.g. KDE System Settings when launched from
overview effect.

BUG: 460980
2022-10-27 08:03:59 +00:00
Vlad Zahorodnii
a9833dc9dd scripting: Prefer metadata.json over metadata.desktop in GenericScriptedConfig
KPluginMetaData in KF 6 doesn't load desktop files anymore. It means
that plasma packages need to come with json metadata files.

This change adjusts the generic scripted config loader so it can load
configuration even for packages with no metadata.desktop files.
2022-10-27 07:35:36 +00:00
l10n daemon script
109bdf8f42 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-10-27 01:50:21 +00:00
Xaver Hugl
2997fb24bb x11window: revert more from 3a28c02f
BUG: 461032
2022-10-26 23:17:36 +00:00
Xaver Hugl
1dcbc3c6f8 backends/drm: fix format sorting
As the drm format number of 10 bit colors is lower, the fallback sorting
preferred those formats, even if KWIN_DRM_PREFER_COLOR_DEPTH=24 was set.
To fix that, prefer 8 bit colors over something random.
2022-10-26 18:46:13 +00:00
Vlad Zahorodnii
8fa1883cd9 effects/invert: Make it fully responsible for inverting the screen
The X11 standalone backend has an obscure fallback to hw screen
inversion if compositing is disabled. While it's great, it conflicts
with existing features such as night color.

In order to make code cleaner and clean up dependencies, this change
moves screen inversion shortcut to the invert effect. While it can
potentially affect users that don't use compositing, I think the number
of such affected people is very small.

In hindsight, preferring hw over sw transform is nice, but I think we
need to analyze it first and then come up with a proper solution that
integrates with color management and works great both on x11 and wayland.
2022-10-26 18:18:36 +03:00
Vlad Zahorodnii
b18c6a4c52 backends/virtual: Drop VirtualBackend::captureOutput()
It's unused. Bring it back when there are usecases.
2022-10-26 14:08:38 +00:00
Arjen Hiemstra
11dc73c6ce effectshandler: Reset iterators when active effects changes
Clearing and resizing m_activeEffects invalidates iterators, so we need
to ensure we reset any iterators that were stored.
2022-10-26 11:50:57 +00:00
Arjen Hiemstra
4c8fd4b8ca OffscreenEffect: Use drawWindow instead of renderWindow when rendering contents
renderWindow bypasses all other effects and simply calls the code that
is responsible for the final render of the window. This means that any
effects that are active on the window are skipped, including things that
may change how the window is rendered like the invert effect. To fix
that, ensure we render the window with all effects applied.

BUG: 459417
2022-10-26 11:50:57 +00:00
Xaver Hugl
580396e377 x11window: partially revert 3a28c02f
In some cases it can cause rather than fix problems with maximization
2022-10-26 12:37:36 +02:00
Xaver Hugl
f6d14f1b44 effects/kscreen: don't stop effect when fade out animation is done
The screen needs to stay black until it gets enabled again, otherwise
slight timing differences can cause the screen to turn on full brightness
again immediately before turning off.

BUG: 460902
2022-10-26 11:52:03 +02:00
Vlad Zahorodnii
a4cb0e7fd8 Forward declare QAction in src/input.h 2022-10-26 07:04:47 +00:00
Vlad Zahorodnii
daa351a398 Remove KGlobalAccel bits from Platform
With the addition of KGlobalAccel::globalShortcutActiveChanged(),
there's a way to monitor all triggered actions without adding any
boilerplate code.

This change removes the KGlobalAccel bits from the Platform class. This
reduces the amount of boilerplate code; currently we need to be careful
about ensuring that Platform::setupActionForKGlobalAccel() is called.
Another reason behind this change is to simplify the api of Platform and
remove things that don't have anything to do with outputs.
2022-10-26 07:04:47 +00:00
l10n daemon script
fcc0b10fee 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-10-26 01:51:34 +00:00
Nicolas Fella
56c2afc749 Bump PlasmaWindowManagement version to 16
Needed for resource name
2022-10-25 15:52:19 +02:00
Vlad Zahorodnii
3de852cd4f wayland: Drop DataDeviceInterface::updateProxy()
It's unused.
2022-10-25 11:13:14 +00:00
Arjen Hiemstra
b637785f49 Replace some manual floored QPointF->QPoint conversion with flooredPoint calls 2022-10-25 08:44:05 +00:00
Arjen Hiemstra
88bc25b376 DecorationInputFilter: Use QPointF instead of QPoint for events
`QMouseEvent::globalPos()` returns QPoint rather than QPointF, which
internally rounds the screen position. This can result in mouse
positions that are outside the screen, leading to problems. Since
screenPos() seems to be the same, use that so we get a QPointF instead.
Additionally, apply similar changes to the other events.
2022-10-25 08:44:05 +00:00
Arjen Hiemstra
6ef2cdc332 Window: Floor rather than round when doing hitTest for the decoration
Otherwise we may end up with coordinates that are outside the decoration
and inadvertantly failing the hittest.

BUG: 460686
2022-10-25 08:44:05 +00:00
Arjen Hiemstra
2f900d84ab Add a helper function to convert QPointF to QPoint using floor instead of round
In a bunch of cases, we want to floor when converting to QPoint rather
than rounding. As it gets tedious to repeat the same code over and over,
add a helper function.
2022-10-25 08:44:05 +00:00
John Brooks
a1191bea18 wayland: Fix missing relative motion events
Use isNull on QSizeF to check for a zero delta instead of comparing it
with a default-constructed QSizeF, which in practice initializes to
(-1.0,-1.0). This caused relative motion events to be omitted if the
delta happened to be equal to (-1.0,-1.0), causing mouse jumping in some
applications.

BUG: 444510

Signed-off-by: John Brooks <john@fastquake.com>
2022-10-25 08:18:45 +00:00
Weng Xuetian
84f54e9ffa Implement a enableRequested signal for text-input-v3
The signal will be emitted if text-input-v3 applies a new enable state
if it's already enabled.

In Gtk's implementation, sending text_input_v3.enable for the second
time has the similar semantics of text-input-v2.showInputPanel. Try to
connect them together and add corresponding test.

See also: a95cfb1c45/gtk/gtkimcontextwayland.c (L555)
2022-10-25 04:34:26 +00:00
jrv ezg
7f7fa69135 kcmkwin/kwindecoration: use Kirigami.ActionToolBar for the footer actions
This way, the footer actions collapse into a menu when there's not enough space
to show them all, instead of being cut off.

BUG: 460793
FIXED-IN: 5.26.2
2022-10-25 02:37:45 +00:00
l10n daemon script
ff3f5d8596 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-10-25 01:47:08 +00:00
Xaver Hugl
314b5327b6 inputpanelv1window: never hide overlay panels
Hiding them never makes sense, and the protocol specifies that the show
and hide requests are about virtual keyboards, not about overlay planels.
2022-10-24 10:53:57 +00:00
Xaver Hugl
f43c39879d inputmethod: reset m_shouldShowPanel when the tracked window changes 2022-10-24 10:53:57 +00:00
Xaver Hugl
75806ecff5 inputpanelv1window: show window when client maps it after setting the mode
BUG: 460537
2022-10-24 10:53:57 +00:00
Vlad Zahorodnii
5a227bf69d Make Compositor responsible for locking compositing type
It's something that Compositor cares, not necessarily the output backend.
2022-10-24 08:02:27 +00:00
l10n daemon script
c67660b0fa 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-10-24 01:51:05 +00:00
Xaver Hugl
3a28c02f28 x11window: don't change size for centering windows with maximization 2022-10-23 20:06:38 +00:00
Xaver Hugl
ceae717500 output: don't round geometry as often
CCBUG: 459373
2022-10-23 20:06:38 +00:00
l10n daemon script
2ecb57b713 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-10-23 01:43:00 +00:00
Vlad Zahorodnii
7c74b7de4a decorations/plastik: Provide metadata.json instead of metadata.desktop 2022-10-22 16:26:23 +00:00
Vlad Zahorodnii
2121ed72be Use correct text encoding when reading WM_CLASS, WM_NAME and WM_WINDOW_ROLE
All these properties have XCB_ATOM_STRING type. From the ICCCM spec
[2.7.1]

    STRING as a type or a target specifies the ISO Latin-1 character
    set plus the control characters TAB (octal 11) and NEWLINE (octal 12).
2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
13d88081d3 Change type of Window.wmCommand and Window.wmClientMachine to QString 2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
adbcb6a1a0 Change type of Window.desktopFileName to QString 2022-10-22 13:38:36 +00:00
Vlad Zahorodnii
aa838e1c02 Change type of Window.resourceName, Window.resourceClass, and Window.windowRole to QString
testDbusInterface fails with Qt 6 build because QCOMPARE detects the
type difference between QString and QByteArray.

Since these properties being byte arrays has caused reasonable amount of
discomfort, let's make them QStrings. It will fix the test and make some
scripted effect code more cleaner.
2022-10-22 13:38:36 +00:00
Volker Krause
346ac6f32b Add Qt 6 FreeBSD CI 2022-10-22 12:34:49 +00:00
Vlad Zahorodnii
f19957bdb2 autotests: Fix testWaylandSeat in Qt 6 build 2022-10-22 15:01:17 +03:00
Vlad Zahorodnii
e665c1c80a autotests: Fix testPointerConstraintsInterface with Qt 6 build
QTEST panics because of type difference (qsizetype vs int).
2022-10-22 11:12:52 +00:00
l10n daemon script
aebbce2f38 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-10-22 10:42:50 +00:00
l10n daemon script
1282d5e331 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-10-22 01:43:48 +00:00
Volker Krause
0ce90f4335 Add Qt 6 Linux CI
The CI now has the ability to limit the passing unit test requirements
to more specific platform configurations, so the not yet working Qt 6
unit tests shouldn't block this anymore.
2022-10-21 20:25:10 +00:00
Weng Xuetian
90df07157b Fix potential race condition when text input state change and focus change happened at the same time
In some cases, stateCommitted may fire after a new surface being focused
and in correctly set input method to be inactive. This can be reproduced
by switch client between an active text input v3 client and text input
v2 client.
2022-10-21 19:14:41 +00:00
Xaver Hugl
a587e426f8 add autotest for the drm platform 2022-10-21 17:54:55 +02:00
Arjen Hiemstra
85d46016a2 If SurfaceItem does not have a pixmap, return an empty WindowQuadList
Otherwise the caller needs to ensure that we're not calling on an item
without pixmap and if we don't, things crash.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
bb7f627acc Introduce RenderGeometry class and use it for clipping in device coordinates
RenderGeometry is a list of vertices that should be rendered. It's
needed so we can convert WindowQuadList to device coordinates and do
clipping in device coordinates. The intention is also to use it to
replace arbitrary float arrays in effects eventually.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
250d271b26 Add WindowQuad::bounds() as a convenience method to get a QRectF from it 2022-10-21 14:49:22 +00:00
Arjen Hiemstra
2ad497c8f9 Round buffer positions when calculating normalised UV coordinates
Otherwise we end up with UVs that are slightly off as the position is
fractional while the size is integer.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
64e42bbd04 Round window and geometry positions in OpenGL scene
This rounds the position of geometry in the OpenGL scene, which means
things that are fractionally scaled and end up between pixel boundaries
are instead aligned to pixels. This doesn't fully solve the fractional
scaling blurriness, as we still need the application to provide a buffer
with the correct size. If we do have a buffer with the correct size, we
will now render properly aligned. For example, internal clients should
now be correct.
2022-10-21 14:49:22 +00:00
Arjen Hiemstra
b8b9236ec4 Add "roundVector" function as convenience for rounding a QVector2D
Otherwise we constantly need to construct and deconstruct vectors.
2022-10-21 14:49:22 +00:00
Xaver Hugl
49ad013295 backends/drm: remove Wayland bits for drm leasing 2022-10-21 13:33:42 +02:00
Mouse Zhang
fcaf0cad9e effects/backgroundcontrast: Fix backgroundcontrast stripes when rounded window scaling 2022-10-21 10:01:17 +00:00
Mouse Zhang
8468eeafdd effects/blur: Fix blur stripes when rounded window scaling
BUG: 460412
2022-10-21 10:01:17 +00:00
l10n daemon script
c57b3750e7 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-10-21 01:56:05 +00:00
Volker Krause
3a4b8f65ce Don't rely on implicit 2D to 3D vector conversion
That is explicit with Qt 6.
2022-10-20 20:00:52 +00:00
Xaver Hugl
ed8d696698 backends/drm: use #pragma 2022-10-20 21:10:46 +02:00
Xaver Hugl
629a32a802 backends/drm: rename drm object files 2022-10-20 21:08:51 +02:00
ivan tkachenko
e489ad9a16
UserActionsMenu: Add "Move &To Current Desktop" action from task manager for X11
Task Manager has this option, so let's keep them consistent.
Surprisingly, when a window is set to "All Desktops", choosing "All
Desktops" again clears that flag, i.e. sets the window back to only
single desktop. But it is not intuitive at all. So let's have this
separate action to pin a window to current desktop.

Note: Wayland allows for multiple but not all desktops to be assigned to
a window, so it works differently there. Should we have a similar
option there too?

BUG: 458415
2022-10-20 17:08:09 +03:00
ivan tkachenko
d477b31842
UserActionsMenu: Remove duplicated code block 2022-10-20 17:08:07 +03:00
Vlad Zahorodnii
624886f0de wayland: Drop ScopedGlobalPointer 2022-10-20 12:27:51 +00:00
Vlad Zahorodnii
7115ea75a4 Drop WaylandOutput 2022-10-20 12:27:51 +00:00
Vlad Zahorodnii
c3f970b3c3 wayland: Make XdgOutputV1Interface pull information from Output 2022-10-20 12:27:51 +00:00
Xaver Hugl
e9e97e49bf backends/drm: set drm content type when available 2022-10-20 13:46:58 +02:00
Xaver Hugl
b99ae81b08 wayland: implement the content-type protocol 2022-10-20 13:46:58 +02:00
Vlad Zahorodnii
f0376367b1 Add explicit POSITION_INDEPENDENT_CODE 2022-10-20 09:37:00 +00:00
Vlad Zahorodnii
de3aa69c1e Fix some tests not building with Qt 6
Client-side wrappers for input-method-unstable-v1 fail to build because
wl_keyboard_interface is referenced in the header file generated by
wayland-scanner.

Unfortunately, qt6_generate_wayland_protocol_client_sources() forces
--include-core-only argument, this is addressed in Qt 6.4.1, but in
meanwhile let's ship a copy of Qt6WaylandClientMacros.cmake file until
the required Qt version is out.
2022-10-20 09:37:00 +00:00
Arjen Hiemstra
cc4787500d Allow specifying a render target scale for windows
This allows overriding the render target scale when rendering windows
and makes use of it in the screencasting plugin.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ec6b9ed67e Convert WindowPaintData's translation to device coordinates when rendering
Otherwise we're using a translation in logical coordinates as a
translation in device coordinates, which means we're not translating
enough.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ada87dbc60 Properly scale cursordelegate_opengl to device geometry
Rather than converting to logical to then later on convert back to
device.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
642bd06cef glide: Convert to device coordinates when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
40e7dadbfe offscreeneffect: Convert to device coordinates when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
154dd33857 touchpoints: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
0133de12c3 zoom: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
9e7a7afccc snaphelper: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
846f612fcc trackmouse: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
8d93ef0221 screencast: Account for output scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
dea0383719 mousemark: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
b730308e2f mouseclick: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
cb093bfae4 screenedge: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
f791eb8fa7 screenshot: Account for render target scale when rendering 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
239bbf93f4 magnifier: Account for output scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
6cfeb3e3e8 Require GLTexture::render() to provide an output scale
This ensures we render the texture at the right scale while providing
geometry information in logical coordinates.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
74ff3bf082 Account for render target scale when rendering a WindowThumbnailItem
Otherwise we get too large and cut off window thumbnails.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
5a85ecd8c4 Convert to device pixels when rendering an offscreen quick view
Rendering a texture needs to be done in device pixels, not logical
pixels.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
8a69432d76 EffectsHandler: Use QRectF for mapToRenderTarget 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
2609458c8b screentransform: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
78d2c1f7e0 showpaint: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
5ab9008ca6 blur: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
9b28744de0 backgroundcontrast: Account for render target scale when creating geometry 2022-10-20 08:20:51 +00:00
Arjen Hiemstra
822e6da569 Use a perspective matrix again for the Glide and Sheet effects
Since we now use an orthographic matrix as main projection matrix, the
glide and sheet effects don't really work as intended anymore. To fix
that, copy over the old perspective matrix and use that as base rather
than the current orthographic matrix.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
6ae32076f8 Use device coordinates for geometry in the OpenGL Scene
It is quite a bit easier to reason about the conversion to device
coordinates when we actually have code that does that, instead of
implicitly assuming OpenGL handles it. Additionally, it means we don't
need to convert back to logical coordinates again when we're rounding
pixel values.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
ebc5a6c638 Add scaledRect as a helper function to scale a QRectF by a scalar
I have no idea why QRectF doesn't have this...
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
3922f468b4 Only recalculate renderTargetMatrix if it is needed
If there's no changes then there's no need to recalculate the projection
matrix.
2022-10-20 08:20:51 +00:00
Arjen Hiemstra
695cc7c010 Use an orthographic projection matrix for rendering the scene
Rather than a perspective matrix, which is rather unexpected when coming
from something like QtQuick. Generally, when doing 2D you want an
orthographic matrix so Z values do not matter.

Apparently this was originally done for 3D effects, but there are only
two of those remaining (glide and sheet) and for those, the effects
themselves can set up a perspective projection matrix.
2022-10-20 08:20:51 +00:00
Vlad Zahorodnii
085e44cdf9 scripts: Convert desktop metadata files to json metadata files 2022-10-20 07:12:31 +00:00
Vlad Zahorodnii
acc2336833 effects: Convert desktop metadata files to json metadata files 2022-10-20 07:12:31 +00:00
Vlad Zahorodnii
0c28de5b42 wayland: Add support for ext-idle-notify-v1
Wayland protocols MR: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
2022-10-20 06:36:58 +00:00
Vlad Zahorodnii
28c19c8215 wayland: Make output subpixel info static
subpixel info cannot change.
2022-10-20 06:18:30 +00:00
Vlad Zahorodnii
146bed14bc wayland: Make OutputInterface pull information from Output
It's a necessary step towards killing src/waylandoutput.{h,cpp}. Besides
that, it makes OutputInterface more reusable and less error prone.
2022-10-20 06:18:30 +00:00
l10n daemon script
665b7bb989 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-10-20 02:05:10 +00:00
Nicolas Fella
f3471293bf [desktopchangedosd] Port from KQuickControlsAddons.QIconItem to PlasmaCore.IconItem 2022-10-19 19:51:04 +00:00
Vlad Zahorodnii
187f556f85 Drop Screens 2022-10-19 13:29:39 +00:00
Nicolas Fella
9cf60224e6 [aurorae] Port from KQuickControlsAddons.QIconItem to PlasmaCore.IconItem 2022-10-19 11:55:23 +00:00
Gabriel Karlsson
02145bddce Fix wording in action 'Switch to Screen'
This erroneous "Window" instead of "Switch" apparently broke stuff.

The issue was pointed out on Reddit here: [https://www.reddit.com/r/kde/comments/y78qps/comment/istrj6t/](https://www.reddit.com/r/kde/comments/y78qps/comment/istrj6t/)
2022-10-19 05:33:11 +00:00
Xaver Hugl
850ae0cfe9 backends/drm: don't crash if connector has no modes 2022-10-18 11:21:45 +00:00
David Edmundson
50b4e988a4 [windowthumbnails] Guard against software QtQuick backend
If we are using the software renderer
QQuickWindow::createTextureFromNativeObject returns null. We already
checking for kwin using GL compositing so we can expand to check
QtQuick's usage.
2022-10-18 08:19:20 +00:00
Vlad Zahorodnii
1a87e9c9ac effects: Make WindowHeap try to fill gaps 2022-10-18 07:03:32 +00:00
Aleix Pol
212a19da38 screencast: Don't report damage on the full screen every time
I think this was added as a debug measure and we (I) forgot to remove
it.
While at it, make sure we always send the damage on the cursor changes.
2022-10-17 15:03:01 +00:00
David Edmundson
1df10c3518 Handle scale override in locked and confined pointers
BUG: 460532
2022-10-17 13:40:03 +01:00
David Edmundson
dae7d738a3 Move installPointerConstraint calls into the constraint handlers 2022-10-17 13:36:56 +01:00
David Edmundson
a43ef8ac91 Guard against reconfiguring wayland specific input on X11
reconfigure is hooked up to a config watcher that is applicable on X11
and wayland.

A runtime check is added to reconfigure, if we're not initialised we
have nothing to reconfigure. initialise calls reconfigure at the end of
the method.
2022-10-17 10:00:10 +00:00
Vlad Zahorodnii
28899df485 Make Workspace::outputAt() more robust to extreme values
Since QPointF can have values that exceed INT_MAX, "distance <
minDistance" may not be triggered for the first output.

In order to make Workspace::outputAt() more robust to such extreme
cases, this patch changes the type of minDistance from int to qreal to
avoid truncation and adds an explicit check to initialize bestOutput
when we see the first workspace output.

It would be also great to add size hints sanitization code in kwin, but
it can be done later.

BUG: 460446

---

Should close:

* https://errors-eval.kde.org/organizations/kde/issues/321
* https://errors-eval.kde.org/organizations/kde/issues/341
2022-10-17 09:34:20 +00:00
Vlad Zahorodnii
207e78386a Fix resizing by dragging top-right window corner
The top-right corner case was overlooked when switching from QRect to
QRectF, which results in the window having wrong size.

BUG: 460501
2022-10-17 08:07:26 +00:00
l10n daemon script
0f8ec3fcd2 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-10-17 01:50:44 +00:00
Aleix Pol
d454a2981c Prefer invokeMethod on a function pointer
Rather than a char* that needs lookup at runtime.
2022-10-16 22:44:24 +00:00
l10n daemon script
babbf00578 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-10-16 01:57:21 +00:00
Albert Astals Cid
19694fb046 Future proof the code for C++20
warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
2022-10-14 13:30:24 +00:00
Vlad Zahorodnii
186ef5e588 wayland: Fix handling of removed outputs in DpmsInterface
If an output is removed, its handle is invalid, which can lead to a
crash.
2022-10-14 14:53:42 +03:00
Vlad Zahorodnii
71bcbf852e wayland: Sync output device's enabled property
The output can be already disabled when the output device is created.

BUG: 460247
2022-10-14 09:28:52 +00:00
Vlad Zahorodnii
f2df2aa0e1 effects/blur: Fix clipping when sliding virtual desktops
When the slide effect paints a virtual desktop, it translates both
windows and the clip region.

Since the clip region slides too, the blur effect needs to be careful.

At the moment, the blur effect computes the blur region as follows:

- get the value of the blur region hint from client, map it to the
  global coordinate space, and intersect it with the clip region
- apply translation and scale to the blur region
- pass the blur region to doBlur()

However, the translation transform must be applied before intersecting
the blur region with the clip region.

BUG: 460382
2022-10-14 10:17:55 +03:00
Vlad Zahorodnii
c56517eccc backends/drm: Fix leaving dangling dpms input event filter
If the output is turned back on before m_turnOffTimer expires, the
dpms input event filter won't be reset and all input events will go to
the void.

BUG: 460322
2022-10-13 13:00:36 +00:00
Vlad Zahorodnii
f4b32c0580 effects/screenshot: Avoid capturing hidden cursor
BUG: 460358
2022-10-13 15:38:22 +03:00
Vlad Zahorodnii
4f795dee20 Make "switch to screen" and "window to screen" code less error-prone 2022-10-13 10:43:14 +00:00
Vlad Zahorodnii
4340a020d1 Fix "window to screen" and "switch to screen" shortcuts
BUG: 460337
2022-10-13 10:43:14 +00:00
David Edmundson
36440a9d91 Fix scripted shader effect animations
AnimationEffect inherits from CrossfadeEffect as it may do a crossfade,
but it also has to perform non-crossfading activities with a custom
shader.

For crossfades we want to draw the old and new window, but this isn't
needed where the crossFadeProgress remains at 0.

BUG: 460277
2022-10-12 11:28:25 +00:00
David Edmundson
4d0f8e417c Drop shaderTrait adjustment on crossfade
Crossfade is now hanlded by regular scene painting, only by offscreen
effects. There is no need for scene code to have awareness and use a
more expensive shader.
2022-10-12 08:47:56 +00:00
Nate Graham
f56c67698d Wayland: don't allow minimizing applet popups either 2022-10-11 18:49:54 +00:00
Vlad Zahorodnii
35606fd9ee Add TabletEvent QPointingDevice constructor workaround for Qt 6 2022-10-11 18:34:00 +03:00
Vlad Zahorodnii
7f80c47758 Port SwitchEvent from QInputEvent
Otherwise we need to pass a QInputDevice.
2022-10-11 18:33:46 +03:00
Vlad Zahorodnii
c147340878 wayland: Add support for high resolution scrolling
In libinput 1.19, three new pointer axis events were added in order to
provide support for high-resolution scrolling.

LIBINPUT_EVENT_POINTER_AXIS is de-facto deprecated and new users of
libinput should use instead SCROLL_WHEEL, SCROLL_FINGER, and
SCROLL_CONTINUOUS.

Discrete deltas were replaced with v120 delta values. 120 corresponds to
a single discrete delta. Smaller values correspond to "partial" wheel
ticks.

https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72
2022-10-11 14:04:13 +03:00
Xaver Hugl
22e6b944b2 wayland: don't allow maximization of applet popups 2022-10-11 08:33:12 +00:00
Vlad Zahorodnii
459d842772 effects: Drop EffectWindow::hasAlpha()
It's impossible to properly map EffectWindow::hasAlpha() to wayland
abstractions, where a window can have subsurfaces.

The main motivation behind this change is to move Window::hasAlpha() and
Window::depth() to X11Window.

At the moment, EffectWindow::hasAlpha() is used as a micro-optimization.
API and ABI breaking change in libkwineffects.
2022-10-11 07:14:05 +00:00
Vlad Zahorodnii
eedbde464e utils: Drop updateXTime() 2022-10-11 06:43:25 +00:00
Vlad Zahorodnii
f950cbd3d1 Move Platform::updateX11Time() to Application
Platform can be viewed as an output backend and updating X11 time has
nothing common with that.
2022-10-11 06:43:25 +00:00
Vlad Zahorodnii
903e18d88c Merge Window::maximize() and Window::changeMaximize() 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
a1d5849d81 Make X11Window responsible for emitting clientMaximizedStateChanged signal 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
40a4cd13a4 Make Window::changeMaximize() take MaximizeMode 2022-10-11 06:21:15 +00:00
Vlad Zahorodnii
b044a7d5ff Drop adjust argument in Window::changeMaximize() 2022-10-11 06:21:15 +00:00
Volker Krause
74ae78d4c6 Adapt to Qt XkbCommon header changes in Qt 6 2022-10-10 17:07:37 +02:00
Vlad Zahorodnii
a119218c8b x11: Move Unmanaged damage initialization hack into SurfaceItemX11
It's unnecessary on wayland and there's a bug in m_isDamaged
initialization. We need to set m_isDamaged to true otherwise
SurfaceItemX11 won't attempt to query the damage.
2022-10-10 13:10:12 +00:00
Vlad Zahorodnii
bcd43ff44d backends/x11: Implement own keyboard interception
At the moment, the keyboard interception code in the effects system
relies on Qt code processing key events. However, since QDesktopWidget
is removed in Qt 6, this is a blocker for Qt 6 port.

This change ports the X11 backend to private xkb keymap as indicates in
the todo comment. It allows us to drop the last QDesktopWidget usage.
2022-10-10 09:16:50 +00:00
Joshua T
b0682129f9 kcmkwin/kwindecoration: Add "Shadow" to list of keywords
Since the window decoration settings includes the size of a window’s shadow,
the word "shadow" should be one of the keywords.
2022-10-09 14:26:00 +00:00
Xaver Hugl
e0120aa387 kwingltexture: port away from manual memory management 2022-10-07 14:50:10 +02:00
Xaver Hugl
7bca6267b0 decorationbridge: wrap factory in a std::unique_ptr 2022-10-07 14:50:10 +02:00
Xaver Hugl
e482556d58 screenedge: modernize some code 2022-10-07 14:50:10 +02:00
Xaver Hugl
1c7eb138ff backends: port more code to std::unique_ptr 2022-10-07 14:50:10 +02:00
Vlad Zahorodnii
cd1def8c55 effects/slide: Remove SlideDocks option
SlideDocks option was added after receiving negative feedback about
sliding docks. SlideBackground option was added to provide smooth
transition path for old users.

In hindsight, adding SlideDocks option was a mistake. It provides
excessive configurability in exchange for more code complexity.
2022-10-07 07:49:49 +00:00
Vlad Zahorodnii
94486e0cc1 backends/virtual: Stop creating a dummy output during backend initialization
With the virtual backend, it makes more sense to create outputs on
demand. It makes code clear, it would be also nice to use the virtual
backend for virtual outputs rather than have every backend implement its
own virtual outputs.
2022-10-06 18:04:35 +00:00
A. Meyer
bf00ab6f94 Change description for window border shortcut
Changes the "Hide Window Border" shortcut description to "Toggle Window
Border", which more accurately describes the feature.

BUG: 348549
2022-10-06 17:40:25 +00:00
Volker Krause
f50046524b Remove public declaration of the KWin::FPx2 debug stream operator
Qt 6 insists on this being exported, which in turns fails as this is
actually not implemented. There seemingly is an implementation, but that's
in a different namespace, so this can never have been used from the
outside anyway.
2022-10-06 16:43:47 +02:00
Vlad Zahorodnii
cddb2177f1 effects: Fix window highlighting in WindowHeap
Currently, windows are not highlighted as expected in the window view
effect if the keyboard focus belongs to another screen view.

In general, it makes more sense to apply "Window.window.activeFocusItem"
constraint only to heap.selected.
2022-10-06 07:35:56 +00:00
Vlad Zahorodnii
7eca5f44db x11: Reset SurfaceItemX11::m_isDamaged when the damage handle is destroyed 2022-10-05 14:17:09 +03:00
Vlad Zahorodnii
b3214db0b7 x11: Make damage region fetching code more robust to errors
With DamageReportNonEmpty damage report level, the x server will
send kwin a DamageNotify when the damage region changes from empty to
not empty.

The damage region will be made empty when SurfaceItemX11 calls
xcb_damage_subtract().

It appears like xcb_generate_id() can return us an already associated
XID, which eventually results in xcb_damage_subtract() failing and
breaking state tracking in SurfaceItemX11. KWin will no longer receive
DamageNotify events and some windows will freeze.

In order to make getting BadIdChoice less catastrophic, this change
makes the SurfaceItemX11 reset m_isDamaged after successfully fetching
the damage region. If xcb_generate_id() returns us a bad id, kwin will
try to fetch the damage again in the next frame.

BUG: 456511
2022-10-05 10:10:25 +03:00
Vlad Zahorodnii
d2899928cd Reset m_delayFocusWindow in Workspace::cancelDelayFocus()
CCBUG: 459860
2022-10-05 06:38:25 +00:00
Vlad Zahorodnii
2bb3299533 effects/fullscreen: Prevent playing animation for invisible windows
It makes no sense to play the animation if the window is invisible. It
can also produce unexpected results if the window is not on current virtual
desktop as animate() will temporarily force the window to be visible.
2022-10-04 14:14:40 +00:00
Xaver Hugl
18a72f7187 backends/drm: also force linear layout for dumb buffer cursors
While it usually shouldn't make a difference, it ensures that the buffer import
always works properly

CCBUG: 456306
2022-10-04 07:33:59 +00:00
Vlad Zahorodnii
6ba44deee4 effects/maximize: Prevent playing animation for invisible windows
If an invisible window is animated, e.g. minimized window, the maximize
effect will temporarily make it visible in order to play the animation,
which is unexpected.
2022-10-04 06:48:43 +00:00
Laurent Montel
1b57b27b76 Use POSITION_INDEPENDENT_CODE for static lib for helping to build against qt6 2022-10-04 08:28:40 +02:00
Xaver Hugl
ae4dd73e99 backends/drm: use linear buffers for multi gpu where necessary 2022-10-03 10:44:51 +00:00
Xaver Hugl
1f92dc5e5d backends/drm: correct test buffer check
There can be situations where the surface fits but there's no test buffer yet
2022-10-03 10:44:51 +00:00
Volker Krause
2bda46d5b9 Don't try to create a QChar from a non-char key enum
Asserts with Qt 6. Instead, check with the static QChar::isLetter, that
handles invalid input properly.
2022-10-03 09:12:19 +00:00
David Edmundson
3649ec474b [x11window] Remove duplicate activities check
We check if activities are valid in Window::setActivities. We don't need
to do it when we read the X11 properties.
2022-09-30 07:10:50 +00:00
David Edmundson
ad95b495ac Sync activities after kwin restart
Activities are loaded async. During this time any fetch of activity
information is incorrect as we will treat any settings as invalid.

We need to ignore attempts to set activities during this time, but also
refresh Window's concept of activities once we are loaded.

BUG: 438312
2022-09-30 07:10:50 +00:00
Méven Car
e60f26e0ab Disable PrimarySelection in seat setPrimarySelection
BUG: 456167
2022-09-29 10:32:03 +00:00
Vlad Zahorodnii
4c07daec3f effects/slide: Increase spring constant
We've got complaints that the animation is too slow.

BUG: 455450
2022-09-28 15:41:04 +00:00
l10n daemon script
b4cd4f645e 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-09-28 01:57:42 +00:00
Nate Graham
5322f32cf0 Set bugReportUrl for all KCMs in this repo
CCBUG: 204364
2022-09-27 12:15:26 -06:00
Vlad Zahorodnii
f343f3fb80 wayland: Use true logical geometry in Display::outputsIntersecting()
Display::outputsIntersecting() computes the logical geometry using the
oriented mode size and the scale factor, but OutputInterface's scale
factor is ceil()ed up, so the resulting logical geometry can be incorrect.

BUG: 459733
2022-09-27 12:07:03 +00:00
David Edmundson
388350f8bf [effects/private] Don't sync natural size to intended sizes
X/Y/Width/Height all get changed in the polish event so this only has
any effect in bindings before the first frame.

It seems this was leftover from development where we didn't have initial
values synced up properly.
2022-09-27 12:03:27 +00:00
Arjen Hiemstra
9a6c1e60e8 X11 backend: Retry enabling compositing when it was disabled a while ago
This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.

BUG: 452344
2022-09-27 10:23:04 +00:00
Xaver Hugl
21b833f9f5 effects: bump minor version 2022-09-27 08:57:20 +00:00
Xaver Hugl
4b82c639e0 effects/contrast: use effect-local data instead of window data 2022-09-27 08:57:20 +00:00
Xaver Hugl
cc0434d34c effects/blur: use effect-local data instead of window data for blur regions 2022-09-27 08:57:20 +00:00
Vlad Zahorodnii
1d8c9c62cf backends/drm: Fix 100% cpu usage after tty switch
The drm fd can get stuck in readable state, in which case the
QSocketNotifier will fire the activated signal as often as it can
leading to high cpu usage.

We need to read() the drm fd in order to make the socket notifier stop
firing QSocketNotifier::activated.

This change removes the m_platform->isActive() check to ensure that
drmHandleEvent() gets called, in general, it should be safe as we only
notify the outputs about completed pageflips.

BUG: 452726
2022-09-27 07:29:05 +00:00
Aleix Pol
2c874fc3e0 tablet: Ensure persistency of the outputName property
With this change, when the specified output is disconnected, it will
just behave as if none were selected but when it's connected again it
will pick it back up.

BUG: 456857
2022-09-27 07:11:38 +00:00
ivan tkachenko
e45cc7a807 effects/windowview: Add ExposeClassCurrentDesktop shortcut to KCM
See also: f2defd1dfa
2022-09-27 06:29:20 +00:00
David Edmundson
105af544c9 Don't accept space and enter key events in empty WindowHeaps
This fixes being able to select an empty desktop.

CCBUG: 457910
2022-09-27 06:26:38 +00:00
David Edmundson
e924b1cb23 Fix clamping in screenContainsPos
QRect.contains(somePointF.toPoint()) will round the values.

This is problematic for the case of a mouse being at -0.4, we will
consider it in bounds for the screen, but obviously this doesn't match
any surfaces.

The detection and confineToBoundingBox need to behave the same and
floor.

BUG: 459328
2022-09-26 10:37:53 +01:00
Andreas Cord-Landwehr
0a22d390d6 Explicitly include cmath 2022-09-25 17:20:33 +02:00
Aleix Pol
95742bf2e5 inputpanel: Do not start a display process while shutting the panel down
The panel is getting destroyed and shouldn't be shown anymore.
2022-09-24 20:21:48 +00:00
Xaver Hugl
b4e9443820 inputpanelv1window: fix showing and hiding
Instead of InputMethod directly calling showClient() on the input panel,
call methods that properly show or hide the panel as needed, with readyForPainting
set appropriately. This removes the cases where it's shown without being ready for
painting, which causes crashes.

BUG: 459404
2022-09-24 20:21:48 +00:00
l10n daemon script
1c6a95bceb 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-09-24 01:48:13 +00:00
David Redondo
16a5831fee Implement xwayland-keyboard-grab protocol
Only XWayland can see and bind to this global.
When a XWayland surface is focused that has a grab, shortcuts
are inhibited.
BUG:455159
FIXED-IN:5.26
2022-09-23 15:49:01 +02:00
Xaver Hugl
3af2d93c2e waylandserver: handle lock state changing properly
BUG: 316734
2022-09-23 14:48:49 +02:00
Vlad Zahorodnii
3546cc0541 wayland: Send wl_data_offer.source_actions before wl_data_device.enter
This makes kwin's behavior consistent with other wayland compositors
(sway, GNOME Shell, etc) and it's reasonable to provide all the
information about the data source before wl_data_device.enter. It also
makes Firefox happier.

Relevant discussion upstream: https://gitlab.freedesktop.org/wayland/wayland/-/issues/322

CCBUG: 445661
2022-09-23 11:43:41 +03:00
Vlad Zahorodnii
7b3ae310e6 Emit clientMaximizedStateAboutToChange when maximized mode is actually about to change
Window rules code can call maximize(requestedMaximizeMode()), in which
case the Window will emit clientMaximizedStateAboutToChange but the
maximize mode may not actually change.

This change moves the emission of of the clientMaximizedStateAboutToChange
signal to Window::changeMaximize(). The reason for doing so is that
window rules have the final decision what the maximize mode will be.

CCBUG: 459301
2022-09-22 12:16:56 +00:00
ivan tkachenko
f2defd1dfa
effects/windowview: Make sure "Toggle Present Windows…" shortcuts are initialized
The last fix was not complete without registering the shortcut from the
start. It worked after changing it in system settings at runtime though.

Amends 984388dba4.
2022-09-22 09:55:36 +03:00
Vlad Zahorodnii
169c784c51 wayland: Bump plasmashell protocol version
See https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/48
2022-09-21 13:46:55 +00:00
l10n daemon script
1680fa1318 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-09-21 01:47:35 +00:00
ivan tkachenko
501136b222
effects/windowview: Animate the placeholder just like the search field
FIXED-IN: 5.26
2022-09-20 12:37:08 +03:00
ivan tkachenko
8ac4901068
effects/windowview: Turn placeholder on when there are actually no visible windows
This may happen when all windows are minimized, and the effect was
started in "Window class on current desktop" mode (Ctrl+F7).

BUG: 459244
FIXED-IN: 5.26
2022-09-20 12:35:24 +03:00
Vlad Zahorodnii
d32aebb747 Lower severity of "Got invalid timestamp" message
BUG: 459405
2022-09-20 10:59:08 +03:00
Vlad Zahorodnii
d6234d0411 effects/windowview: Re-order placeholder text and window heap
This ensures that the proxy thumbnail item is stacked above the
placeholder text.
2022-09-19 19:26:52 +00:00
Vlad Zahorodnii
14513ebcda effects/mousemark: Specify effect chain position
BUG: 457639
2022-09-19 19:10:57 +00:00
Nicolas Fella
fdb40395f0 [kcms/scripts] Make plugin id and translation domain match
KQuickAddons::ConfigModule sets the translation domain based on the plugin id

That is kcm_kwin_scripts. However the translation domain is kcm-kwin-scripts, which breaks loading translations

Also fix Messages.sh to extract from QML

BUG: 458438
2022-09-19 15:01:21 +00:00
Vlad Zahorodnii
4696bdaa05 scripting: Add js object <-> QRectF/QSizeF/QPointF conversion helpers
The js code contains code such as

    window.frameGeometry = {x: 42, y: 42, width: 100, height: 50};

However, QJSEngine doesn't know how to convert js object to QRect. For
that purpose, we need to register conversion functions.

So far, we kept registering converter functions only for integer based
geometry types, i.e. QRect, QSize and QPoint. In 5.26, Window was ported
to QRectF, QSizeF and QPointF, but the corresponding conversion helpers
were not added.

BUG: 459369
2022-09-19 13:58:44 +00:00
Aleix Pol Gonzalez
b81123865d tabbox: Makes sure we are not calling a null pointer
The desktopClient is a weak pointer and therefore can be null. This
makes sure that we are not calling a null instance of it.

It seems likely it was introduced here 45486ce515

This is a blind non-reproduced fix for the issue here:
https://errors-eval.kde.org/organizations/kde/issues/158/
2022-09-19 13:49:14 +00:00
ivan tkachenko
ab79fe47ce
effects/private: Add another guard for multi-screen Drag&Drop
Unlike D&D actions, this method does not return any feedback as to
whether an item drop was accepted by any other screen, and so whether it
is going through destruction process already, so the best we can do is
add another typeof/undefined check after calling that method.

Fixes the following error:

    file:///usr/lib/qml/org/kde/kwin/private/effects/WindowHeapDelegate.qml:415:
    TypeError: Cannot read property 'deleteDND' of undefined
2022-09-19 15:13:13 +03:00
Vlad Zahorodnii
d8faf8ab08 Fix multi-screen drag-and-drop in WindowHeap
DND was failing with the following error

file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:96: TypeError: Cannot read property 'mapToGlobal' of undefined
2022-09-19 13:09:29 +03:00
Eric Edlund
6d9f740d6f Better handle windows on all desktops in slide effect
Change the render cycle for slide effect. Now, windows will be drawn on each desktop or not in the paintWindow() loop instead of the paintScreen() loop. This allows us to respect stacking order better by painting all of the same window together instead of per VD.

BUG: 457486
BUG: 458622
2022-09-19 07:00:42 +00:00
Nicolas Fella
3ee921a7a9 [kcms/scripts] Enable Apply button when clicking Defaults
BUG: 459320
2022-09-18 13:20:10 +02:00
ivan tkachenko
d7c6a87f39
effects/overview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:11 +03:00
ivan tkachenko
de6c0289a0
effects/overview: Implement the searchText backing property
It is used in QML code, just like in windowview (Present Windows)
effect, but developers forgot to copy the implementation in C++
backend.

BUG: 459202
FIXED-IN: 5.26
2022-09-17 14:44:05 +03:00
ivan tkachenko
a3c6db3ee7
effects/windowview: Bind to search field using textEdited signal
This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

FIXED-IN: 5.26
2022-09-17 11:12:18 +03:00
ivan tkachenko
984388dba4
effects/windowview: Fix "Toggle Present Windows (Window class on current desktop)" shortcut
The effect was not turning off when pressing a shortcut again, unlike
other flavors of this effects.

BUG: 156155
FIXED-IN: 5.26
2022-09-17 01:57:35 +03:00
ivan tkachenko
3aa1411d94
effects/desktopgrid: Fix background highlight having extra size
Without window title being shown, background highlight should shrink as
well, otherwise it created a questionable gap at the bottom e.g. in a
Desktop Grid effect.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
ivan tkachenko
5cf4320040
effects/desktopgrid: Replace highly opmitized animators with animations which work
Unfortunately, *Animator QML types have some problems with rendering,
sometimes affecting general smoothness, other times (like here, for me)
just not animating entirely. On my NVIDIA graphics system the animation
or a desktop returning from drag just looks like a freeze for a second,
then it suddenly jumps back to {0,0}. So let's just replace with less
optimal NumberAnimation which works fine.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
ivan tkachenko
9889e0df11
effects/desktopgrid: Fix cursor shape being lost while dragging a desktop
DragHandler does not travel along with its target heap, so it only
affects the cursor shape when the mouse pointer is directly over it; but
when a desktop is dragged far outside, the cursor resets.

Besides, this is how we already implemented it in WindowHeapDelegate.

FIXED-IN: 5.26
2022-09-16 21:37:35 +03:00
Fabian Vogt
494feb2eea Fix build with older libgbm
The code for the !HAVE_GBM_BO_GET_FD_FOR_PLANE case needed an explicit
constructor call.
2022-09-16 17:51:36 +00:00
Xaver Hugl
fa538edc74 waylandserver: don't emit windowRemoved if it's not been added yet
This can happen when a client destroys the window before it ever got ready
for painting
2022-09-16 17:13:34 +00:00
ivan tkachenko
574b51f095
Amend "effects/Overview: Use SearchField from PlasmaExtras"
This commit amends 4eefd27f61.

Changes were pushed to the wrong branch, so the MR got merged not in its
final state.
2022-09-16 19:40:26 +03:00
ivan tkachenko
3af565b616
Amend "effects/private: Merge two state machines into one with substates"
This commit amends 9897afa55f.

Changes were pushed to the wrong branch, so the MR got merged not in its
final state.
2022-09-16 19:40:18 +03:00
ivan tkachenko
96a8980861
effects/Overview: Add "pressed" effect to desktop bar 2022-09-16 18:02:56 +03:00
ivan tkachenko
4eefd27f61
effects/Overview: Use SearchField from PlasmaExtras 2022-09-16 18:02:55 +03:00
ivan tkachenko
4a6879e6ee
effects/Overview: Move delegate handlers to the bottom close to each other 2022-09-16 18:02:55 +03:00
ivan tkachenko
329731be2d
effects/private: Encapsulate DND management, and clean up the store
Use methods with semantic naming instead of raw data manipulation, and
make sure to perform clean up of DND data, so it won't haunt us back
later e.g. when a window delegate is recreated not because of a drag
of itself but due to a desktops rearrangement.
2022-09-16 18:02:55 +03:00
ivan tkachenko
1f0a0c893a
effects/private: Nuke an unnecessary loop
Yes, Marco, there is a more efficient way.
2022-09-16 18:02:55 +03:00
ivan tkachenko
d3a5a72a46
effects/private: Fix crash when shutting down desktop grid and overview
Because of const/non-const issues, iterator got invalidated in the loop,
which led to a crash.

Cases that trigger it: interaction with a thumbnail while the effect is
returning to initial state and shuts down. For example, slightly
dragging and releasing a thumbnail such that both TapHandler & DragHandler
would react and play each their own transition (yes, it's another bug);
or by pressing Escape key while dragging.
2022-09-16 18:02:54 +03:00
ivan tkachenko
9897afa55f
effects/private: Merge two state machines into one with substates
Having one state machine instead of two somehow simplifies the code and
makes it less fragile.

The new property `substate`, which replaces `thumbSource.state` still
supports imperative assignments that are so important for Drag&Drop,
and still triggers state updates. However, now a substate may not
become an active state: that behavior didn't make sense in previous
iterations, and has led to a glitch where a window won't resize during
return-to-initial animation. The glitch happened because two state
transitions were starting almost-simultaneously (and by Murphy's law in
the worst possible order, of course), and both animations were playing,
but one animation was supposed to to a property that is managed by the
other. But since QtQuick animations cache their from/to values before
they start, the dependent transition essentially didn't animate at all.
2022-09-16 18:02:53 +03:00
Vlad Zahorodnii
74af27dc55 Add missing QPointer
The Compositor is destroyed after the Workspace, so the placeholder has
shorter lifespan. We need to guard the destructor of EffectScreenImpl
from accessing a dangling pointer. For what it's worth, the destructor
of EffectScreenImpl was written with QPointer in mind, but it was never
added.
2022-09-16 11:44:53 +00:00
Marco Martin
e853f5fe07 Don't check for workspace->initializing()
the existence of Window is bound to the one of workspace so it
will always be there.
We also need to check the window sizes before workspace is done
initializing,
otherwise when KWin restarts and there are maximized windows, they won't
be resized to take panels into account and will always span the full
screen.
2022-09-16 09:57:07 +00:00
Xaver Hugl
1a902b1dec backends/drm: supress warning for disconnected connector
It just pollutes the log with useless information
2022-09-16 01:43:08 +02:00
Aleix Pol Gonzalez
fdf2011b34 Wayland backend: Don't crash when terminating
Remember to release all resources before the wayland socket goes:
- release the seat as we give up a seat
- release the ssdManager
- release the output decoration with the output itself
Otherwise they leak and stay dangling.
2022-09-15 16:43:04 +00:00
Aleix Pol
d7cba6b625 Fix handling of different signals (SIGTERM et al) by using KSignalHandler
When debugging something I realised that SIGTERM was always making KWin
crash like I'd never seen it crash. It turns out we are calling
QApplication::exit() on the signal handler which is highly forbidden as
the handler preempts the process altogether.
Use KSignalHandler instead which takes this issue into account.
2022-09-15 15:35:03 +00:00
Marco Martin
7addb06b0f Snap to shaded windows
Allow snapping to a shaded window

BUG:375740
2022-09-15 10:51:28 +00:00
Vlad Zahorodnii
be784ba5d2 effects/windowview: Fix "active class" mode
Each screen has its own WindowHeap. So setting WindowHeap.activeClass
won't be visible on other screens.

In order to address that limitation, we could monitor
Workspace.activeClient property.

BUG: 455974
2022-09-15 06:39:08 +00:00
Xaver Hugl
bc964ffd37 effects: increase animation speed for overview, windowview and desktop grid
It's now set to 300ms, which is what the old effects used. This should provide
a smooth looking animation without making it unnecessarily slow
2022-09-14 17:19:31 +02:00
David Edmundson
8ba77139e3 Fix truncation in quad clipping
Transforms may not be on the logical grid in the case of CSD clients
with scaling.
2022-09-14 14:21:33 +00:00
Xaver Hugl
eccfbbd6fd backends/drm: turn all outputs on when new output is hotplugged
Otherwise only the new output is turned on, which is a bit weird
2022-09-14 12:58:39 +02:00
Vlad Zahorodnii
6d3f00e82c autotests: Remove QVERIFY(signalSpy.isValid())
We use the PMF syntax so the isValid() check is unnecessary as the
compiler will notify about wrong signal at compile time. It makes
writing autotests feel less boilerplaty.
2022-09-14 09:21:29 +00:00
Vlad Zahorodnii
98b8a5d4ba autotests: Use PMF syntax in QSignalSpy 2022-09-14 09:21:29 +00:00
Arjen Hiemstra
817d13d8c0 Ensure move() calls in placement move in integer values
Otherwise we run the risk of placing windows at floating coodinates,
which leads to interpolated rendering which doesn't look nice.

BUG: 457143
2022-09-14 09:00:47 +00:00
Vlad Zahorodnii
a1e1d72f4b backends/drm: Emit Platform::outputsQueried signal after removing virtual output
It's needed so the Workspace can react to output removal.
2022-09-13 18:53:47 +00:00
Marco Martin
9965ca7fc0 Reset the count while the user keeps moving the mouse
re-trigger the edge *only* if the user keeps the mouse still for at
least edges()->reActivationThreshold() - edges()->timeThreshold()

so that the user has to actually keep moving.
if the user keeps moving the cursor in the direction of the edge, it
wion't continuously retrigger it

BUG:457280
2022-09-13 17:26:09 +00:00
Marco Martin
5dd8bf8e8b Manage Drag in a TapHandler which accepts also touch
the Drag attached was set to active in a taphandler which didn't
accept touch, breaking drag and drop on wayland+touch
moving the logic on the other handler makes it work everywhere
2022-09-13 13:38:55 +02:00
ivan tkachenko
ed4f5d3e7e
Overview: Hide "Delete Desktop" button while dragging a window
It's not relevant, and only gets in the way by flashing here and there.
2022-09-13 11:05:57 +03:00
ivan tkachenko
94e4c529cb
Overview: Place mask source inside actual OpacityMask component
Just to keep them close to each other.
2022-09-13 11:05:57 +03:00
ivan tkachenko
d6ee83bf90
Overview: Center-align edited desktop name 2022-09-13 11:05:55 +03:00
Aleix Pol
d268ac449e tablet: destroy resources when they are asked to
CCBUG: 458793
2022-09-13 06:41:04 +00:00
l10n daemon script
ed811a7810 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-09-13 01:46:02 +00:00
ivan tkachenko
6d0f27161c
effects/desktopgrid: Encourage developers explore the code instead 2022-09-13 01:49:27 +03:00
ivan tkachenko
b01ea99c01
effects/desktopgrid: Restore position correctly when dropping a window
This required a bit of a magic on the WindowHeap side to store and
restore global position of a WindowHeapDelegates' window thumbnails.

An additional property bool animationEnabled on a delegate level enables
the heap to restore position without playing unneeded initial animation,
just like the heap itself.

Windows that are being dragged or already returning form a drop are
positioned higher than others on a z-stack.

BUG: 453995
2022-09-13 01:49:27 +03:00
ivan tkachenko
9b282672a2
effects/private/ExpoLayout: Expose updatePolish to QML via forceLayout()
This is consistent with QtQuick library types like Grid and Flow. It
might come in handy when imperatively adding or removing children.
2022-09-13 01:49:26 +03:00
ivan tkachenko
b30302e342
effects/private: Move highlight inside thumbnail component
..so that they always match in size, regardless of different
  combinations of drag&drop and animation states.

And also fix selected property to use id-qualified access.
2022-09-13 01:49:25 +03:00
Oliver Beard
2a6c9f7f7c runner: Use larger pixmap
This avoids a low-quality icon being visible in search results lists.
2022-09-12 22:24:03 +00:00
Xaver Hugl
5f886d72cf backends/fakeinput: port away from QObject memory management 2022-09-12 20:55:32 +00:00
Xaver Hugl
b0c852aa76 backends/wayland: port away from most remaining manual memory management 2022-09-12 20:55:32 +00:00
Xaver Hugl
297971006b backends/x11: port away from most remaining manual memory management 2022-09-12 20:55:32 +00:00
Natalie Clarius
5412ccb71c plugins/nightcolor: show osd in preview 2022-09-12 22:15:38 +02:00
Vlad Zahorodnii
d1de19e212 Make Workspace process batched output updates
Currently the Workspace processes output updates as they occur, e.g.
when the drm backend scans connectors, the Workspace will handle
hotplugged outputs one by one or if an output configuration changes the
mode of several outputs, the workspace will process output layout
updates one by one instead of handling it in one pass. The main reason
for the current behavior is simplicity.

However, that can create issues because it's possible that the output
layout will be temporarily in degenerate state and features such as
sticking windows to their outputs will be broken.

In order to fix that, this change makes the Workspace process batched
output updates. There are several challenges - disconnected outputs have
to be alive when the outputsQueried signal is emitted, the workspace
needs to determine what outputs have been added or removed on its own.
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
e0945886ed Rename Platform::screensQueried() to Platform::outputsQueried()
It makes the vocabulary consistent. We use the word "output" more than
"screen."
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
dbef4fa3f0 backends/drm: Rework GPU removal
The proposed way to handle unplugged gpus allows us to ensure that
removed outputs' lifetime can be extended to the moment when the
Platform::outputsQueried signal is emitted.

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

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

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

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

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

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

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

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

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

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

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

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

BUG:458844
2022-09-08 19:45:55 +00:00
David Edmundson
7927b17d40 Avoid rounding issues in Surface damage tracking
When a buffer is damaged via damage_buffer we have to map things to
logical space. This mapping can involve floating numbers, most notably
with the X11 override, right now that's via a QRegion which is always
integer. For damage we always want to round outwards to the larger
space, not to the nearest space.
2022-09-08 16:18:12 +01:00
Kai Uwe Broulik
63258ab076 kcmkwin/kwintabbox: Remove API not supported by KWin core
WindowThumbnailItem in scripting doesn't support any of the
'brightness', 'saturation', 'clipTo' anymore, so it makes
no sense to support it in the KCM's preview.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-09-08 06:43:02 +00:00
Vlad Zahorodnii
3d1b3c9c66 backends/drm: Store hardware and virtual outputs in two different lists
Currently, we effectively almost everywhere need DrmOutput outputs,
DrmVirtualOutput outputs are needed only in a couple of places. There's
not a lot that we gain from storing real and virtual outputs in one
list, it adds unnecessary casting, etc. Ideally, virtual outputs must
come from a different backend, the current approach is not scalable.
2022-09-07 17:40:51 +00:00
Nate Graham
f73cb8f1e5 effects/windowview: fade Searchfield in and out just like background
The Overview effect manipulates the opacity of the desktop bar and
search field along with that of the blurred background so that they
all fade in and out in sync, but Window View does not, leading to a
discrepancy between them that looks weird.
2022-09-07 13:27:53 +00:00
Marco Martin
31d1f885ce Restore the crossfade effect
This enables again the crossfade between the old window picture and the new one in the maximize and morphingpopup effects.
It does that with the OffScreenEffect redirect() feature.

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

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

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-09-05 09:25:06 +02:00
Vlad Zahorodnii
8b4ffd5cc9 wayland: Relax conditions in strut edge heuristics
When the output layout changes, it's possible that the bottom panel
will float in the middle of the screen, e.g. left edge of the panel
touches the left screen edge while top and bottom panel edges touch no
screen edge.

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

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

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

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

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

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

But some ANSI US keyboards have a numberpad with a Plus key, and many
other keyboards without numberpads also have a Plus key, so we should
allow users of those keyboards to trigger "zoom in" as easily as users
of ANSI US keyboards.
2022-09-01 12:21:44 -06:00