Commit graph

984 commits

Author SHA1 Message Date
Vlad Zahorodnii
d228829abb Introduce Platform::outputAt()
With AbstractOutput being used more heavily, it makes sense to have
something like Screens::number() in the Platform class. As is, the steps
to get an output for a given point are awkward - first, get the screen
id, then use the screen id to get the output.
2021-08-27 21:51:05 +03:00
Vlad Zahorodnii
1dc749333e Remove desktop argument in AbstractClient::electricBorderMaximizeGeometry()
With the new virtual desktop model, we have an issue where the old
code that uses desktop() needs to be ported to desktops().

However, using no desktop() is better as we don't need to deal with
cases where a window can be on several desktops, which can be annoying
sometimes.

This change removes the desktop arg in electricBorderMaximizeGeometry()
and ports it to a Workspace::clientArea() overload that requires no
desktop.

Under the hood, Workspace::clientArea() still uses desktop(), but it
could also use a different strategy to compute the client area if the
window is on several virtual desktops, e.g. intersect client area on
every virtual desktop.
2021-08-27 15:12:59 +00:00
Vlad Zahorodnii
e5f6039a68 Remove desktop() usage in Workspace::activateClient()
Explicitly make the last virtual desktop current. This improves code
readability and gets rid of a desktop() usage.
2021-08-27 15:12:25 +00:00
Xaver Hugl
d6de38c1d6 platforms/drm: use drm formats instead of gbm formats
There's no need to guard the code, gbm and drm format definitions
are the same. Using GBM_BO_FORMAT_* even caused bugs, as that is
an enum and not a proper format identifier.

BUG: 441253
2021-08-27 11:56:36 +00:00
Xaver Hugl
092660613a platforms/drm: fix legacy mode
CCBUG: 441253
2021-08-27 11:50:02 +00:00
Vlad Zahorodnii
fff32f64e6 effects: Drop EffectsHandler::screenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
ff87b33a8a Port away from EffectsHandler::screenGeometryChanged() to EffectsHandler::virtualScreenGeometryChanged()
It's confusing to have two signals (virtualScreenGeometryChanged() and
screenGeometryChanged()) that indicate the same thing.

This change ports parts of kwin from the screenGeometryChanged() signal
to the virtualScreenGeometryChanged() signal with the main motivation to
drop the former.

The virtualScreenGeometryChanged() signal was chosen as the replacement
for the consistency sake with EffectsHandler's virtualScreenGeometry and
virtualScreenSize properties.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
894ed68ff4 effects: Wire EffectsHandler::screenGeometryChanged() to Screens::geometryChanged()
Currently, the EffectsHandler has two signals that are emitted when the
combined geometry of all outputs change - virtualScreenGeometryChanged()
and screenGeometryChanged(). Having two signals is most likely a
historical artifact.

This change untangles the screenGeometryChanged() signal from the
Workspace and makes it the same as the virtualScreenGeometryChanged()
signal.
2021-08-27 09:23:33 +00:00
Vlad Zahorodnii
6c62f12bc1 effects/overview: Specify effect chain position
The present windows effect specifies a chain position of 70. Do the
same in the overview effect.
2021-08-27 12:02:35 +03:00
Vlad Zahorodnii
bd6d04b417 x11: Pass the output name to X11Output constructor
The output name is static, i.e. it cannot change, so there's no point
for having a setter.
2021-08-27 08:23:22 +00:00
Vlad Zahorodnii
a8810e0c33 x11: Rework how X11 outputs are queried
Currently, there are a couple of issues with output querying on X11:

(a) if an output is changed, for example its transform has been changed,
    then all outputs will be destroyed and created again

(b) it's possible to encounter the case where the platform has no
    outputs. The X11Platform destroys all outputs, then queries new
    outputs. The Workspace and AbstractClient sub-classes handle having
    no outputs very poorly! It's even possible to hit a crash.

With this change, outputs will be queried similar to how it's done on
Wayland.
2021-08-27 08:23:22 +00:00
Nate Graham
205fb923cb [effects/overview] Speed up animation
The current duration is 300ms, which is inappropriate for two reasons:

1. It's too slow
2. It doesn't match one of the standard durations. The effect should
   ideally use those durations directly, but if this is not possible
   for technical reasons, it should use the effective value of one of
   those durations. Units.longDuration is 200ms which is the most
   appropriate one to use here.

Therefore, change the animation duration from 300ms to 200ms to match
the standard Units.longDuration duration.

BUG: 441308
FIXED-IN: 5.23
2021-08-26 16:15:39 +00:00
Vlad Zahorodnii
0931e4f8cc effects/overview: Pad screen borders in qml
This makes it easier to spot if the effect is activated while there is
only one maximized window.

Note that anchors.margins cannot be used unfortunately as it won't take
effect until the ExpoLayout item is fully constructed. It may take a
couple of cycles for the geometry to settle down, which makes reasoning
about how the effect works difficult.

BUG: 312146
2021-08-26 19:11:27 +03:00
Vlad Zahorodnii
028421c4d7 effects/overview: Disable animations until started
Once an animation starts due to property change, it cannot be easily
re-targeted. This can cause undesired animation jumps if a property
changes during startup (for example from 0 to its final value).

With this change, the window heap's animation will be disabled until
the effect starts the intro animation.
2021-08-26 19:11:27 +03:00
Vlad Zahorodnii
8e0264d034 effects/overview: Delay starting the intro animation
The ExpoLayout delays relayouting for optimization purposes. However,
this means that new geometry will be available only after returning to
the event loop.

This change delays starting the intro animation so it can be started
with new geometries.
2021-08-26 19:11:27 +03:00
Xaver Hugl
83ccfbb571 platforms/drm: exit more cleanly if we can't find a buffer config 2021-08-26 16:10:26 +00:00
Xaver Hugl
ef48c247e6 platforms/drm: re-add some logging for egl configs
But only print it when KWin can't find a fitting config

CCBUG: 441253
2021-08-26 17:38:58 +02:00
Vlad Zahorodnii
035d0077dc Remove AbstractWaylandOutput::internal()
It's unused.
2021-08-26 17:16:35 +03:00
Vlad Zahorodnii
8d422f3005 Remove globalPos() in AbstractWaylandOutput
It's confusing to have globalPos() and geometry() as both can return the
same information.

This change drops globalPos() function as it's not used outside the
AbstractWaylandOutput class and renames setGlobalPos() to moveTo() to
avoid having a setter without matching getter.
2021-08-26 16:35:41 +03:00
Vlad Zahorodnii
d841733ed8 effects/overview: Call base QQuickItem::geometryChanged() in ExpoLayout
According to the Qt documentation, if an item overrides the
geometryChanged() method, it must call the base class method.

QQuickItem::geometryChanged() is responsible for emitting signals such
as xChanged(), yChanged(), etc.
2021-08-26 08:34:59 +00:00
Ahmad Samir
2c2469f991 Fix clazy warning: Use QString() multi-arg
No need to use arg(QString::number(int )), when arg() already has a int
overload.

Also replace "endl" with "Qt::endl".

GIT_SILENT
2021-08-25 20:09:55 +00:00
Vlad Zahorodnii
ac7eb252f1 Remove Workspace::hasClient() micro-optimization
Workspace::hasClient(X11Client *) is unused and not worth optimizing as
it doesn't appear in any hot path.
2021-08-25 18:54:45 +00:00
Vlad Zahorodnii
c5d22b68b6 wayland: Simplify startup sequence
If there are no outputs, the drm backend will create a placeholder
output, so continueStartupWithScreens() can be removed.
2021-08-25 18:54:19 +00:00
Vlad Zahorodnii
78b5330824 Drop VirtualDesktopManager::name()
It's confusing to have two ways to query the same information.
2021-08-25 20:12:07 +03:00
Vlad Zahorodnii
ad6039c7c3 Remove unused Workspace::clientArea() overload 2021-08-25 15:14:27 +00:00
Aleix Pol
30959c2efb Include a transform effect
It should be used to decorate changes on the display like rotation.
2021-08-25 14:44:03 +00:00
Aleix Pol
9a4bbdf226 Make it possible for an effect to render a screen
Useful in case it needs the contents of the screen but they can't be
blitted, as the state of the framebuffer is unknown.
2021-08-25 14:44:03 +00:00
Aleix Pol
4d1f30301b Make KWin::TimeLine::progress() public
This way we can have animations that act slightly different in different
parts of the animation
2021-08-25 14:44:03 +00:00
Aleix Pol
24cc93ec5b effects: Allow exposing an EffectScreen::transform
This way an effect can know the transformation that is applied on a
display.
2021-08-25 14:44:03 +00:00
Aleix Pol
34cfc6680b effects: Include signals notifying about outputs changing 2021-08-25 14:44:03 +00:00
Xaver Hugl
5cc5d81cea guard gbm version for gbm_bo_get_fd_for_plane 2021-08-25 14:39:35 +00:00
Vlad Zahorodnii
a234e5aaf4 Forbid passing "-1" as screen to Workspace::clientArea()
This simplifies Workspace::clientArea() implementation. Also, it will be
very handy with transition from int-based screens to AbstractOutput.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
fddbd57d09 Port Workspace::clientArea() to VirtualDesktop
This makes Workspace APIs that take virtual desktops more consistent.
2021-08-25 14:31:30 +00:00
Vlad Zahorodnii
5b3c87f105 Rename LayerShellV1Client::output() to desiredOutput()
This is to avoid hitting bugs if the Toplevel class gains an output
property. The new name also better describes what the function returns.
2021-08-25 13:58:49 +00:00
Xaver Hugl
1be65e818c Port screenId based rendering methods to AbstractOutput 2021-08-25 13:53:33 +02:00
Xaver Hugl
e6cab81b53 platforms/drm: multi-gpu buffer import with modifiers 2021-08-25 13:30:49 +02:00
Aleix Pol
35ec9b87a7 Port away from KPluginMetaData::instantiate
It's deprecated according to the documentation, QPluginLoader works just
as well (it's what kcoreaddons was using anyway).
2021-08-25 10:46:40 +00:00
Vlad Zahorodnii
7ffd72cbfa Decouple activation feedback from window management 2021-08-25 09:35:57 +00:00
l10n daemon script
e227e93792 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"
2021-08-25 01:15:54 +00:00
David Edmundson
2fb52274d0 Only try to deactivate overview whilst activate
BUG: 441325
2021-08-24 21:45:17 +02:00
Xaver Hugl
fbff8636b9 platforms/drm: fix gpu removal
As soon as m_backends.removeOne(*it) returns, "it" no longer
points to the same value.

CCBUG: 441372
2021-08-24 12:36:44 +00:00
l10n daemon script
6f6944058b 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"
2021-08-24 01:20:52 +00:00
Ahmad Samir
731564f04d Fix clazy warnings: potential Qt containter detaches in range-for loops
GIT_SILENT
2021-08-23 23:03:06 +00:00
Ahmad Samir
9f41691684 fix clazy warning: Pass a context object as 3rd connect parameter
GIT_SILENT
2021-08-23 23:02:46 +00:00
Xaver Hugl
1e572a4299 platforms/drm: make debug logging less verbose 2021-08-23 21:53:21 +00:00
l10n daemon script
5246408660 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"
2021-08-23 01:27:10 +00:00
l10n daemon script
76d1de48a8 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"
2021-08-22 01:17:35 +00:00
Xaver Hugl
1490215f0d effects/overview: exit on background click
BUG: 441301
2021-08-21 22:08:04 +02:00
l10n daemon script
17b161213c 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"
2021-08-21 01:16:14 +00:00
Alexey Varfolomeev
6336bb71ba No symbolic icons 2021-08-20 19:34:28 +00:00
Aleix Pol
e729478d09 plasma-window-management: Support new activation concepts 2021-08-20 07:05:34 +00:00
Vlad Zahorodnii
1eb0c09292 scripting: Make ClientFilterModel take VirtualDesktop 2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
5419e3df4a scripting: Introduce workspace.currentVirtualDesktop property
It's the same as the currentDesktop except that it's a VirtualDesktop
object.

The main advantage of the currentVirtualDesktop property is that it
doesn't change if a virtual desktop is added or removed in the middle.
It also makes dealing with virtual desktop changes easier.
2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
9a2a1c0435 scripting: Add desktops property to AbstractClient
With the new virtual desktops model, a window can be on several virtual
desktops. Currently, scripts have no any way to get the list of desktops
the window is on. This change addresses that.
2021-08-20 06:54:27 +00:00
Vlad Zahorodnii
fc52531f44 effects/overview: Make the window heap cover the maximize area
Currently, window thumbnails may be placed behind the panel, which
doesn't look good.

With this, the window heap will cover the same area as the maximize
area.
2021-08-19 16:35:28 +00:00
David Redondo
bc17d0aebd xwl: Use direct way of syncing clipboard
Like the primary selection, sync the clipboard directly without
doing any roudntrips through the internal connection.
2021-08-19 14:59:13 +00:00
Vlad Zahorodnii
66d74f4398 effects/overview: Use Kirigami.ScenePosition
This makes the WindowHeap more robust to layout changes. Currently, the
main issue with it is that thumbnails will be misplaced if the heap's
scene position changes.

Kirigami.ScenePosition automagically keeps track of the item's scene pos.
2021-08-19 14:27:19 +00:00
Vlad Zahorodnii
ba0f5981bf Port Workspace::slotWindowToDesktop*() to VirtualDesktop 2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
b85edc08d2 Port Workspace::switchWindow() to VirtualDesktop
If a window is on several virtual desktops, Workspace::switchWindow()
will not work as expected because AbstractClient::desktop() returns the
id of the last virtual desktop.

Since the active window is most likely on the current virtual desktop,
we can use that for filtering out irrelevant windows.
2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
7937aa78ef Port X11 desktop user actions menu to VirtualDesktop
It's mostly identical to the virtual desktop user actions menu on
Wayland.
2021-08-19 11:08:32 +00:00
Vlad Zahorodnii
d5c2518973 Add Workspace::clientArea() that take no desktop
The new overloads take the client (as context) and the desired screen id
or a point and return the client area.

The main motivation behind this change is to make the transition to the
new virtual desktop model where a window can be on several desktops less
painful.
2021-08-19 10:49:40 +00:00
David Edmundson
2b88432b17 Export our nested environment to kwin's env
In the recent refactor we made it so environment variables got synced to
the Application::processStartupEnvironment.

It then seemed safe and cleaner to remove the qputenv calls, but this
was not the case. It regressed the unit tests on CI and kglobalaccel
which is another path where kwin spawns clients.
2021-08-19 09:17:43 +00:00
David Redondo
6104dc50cf xwl: Sync primary selection
Syncs the primary selection from wayland to X and from X to wayland.
Instead of doing it through the internal connection like the clipboard,
this sets/reacts to changes in SeatInterface::prrimarySelection directly.

BUG:422426
FIXED-IN:5.23
2021-08-19 06:46:23 +00:00
David Redondo
fddb83200f Fix typo
GIT_SILENT
2021-08-19 06:46:23 +00:00
Vlad Zahorodnii
4f66cd4c78 effects/overview: Make expo layout spacing configurable
This allows setting "hidpi-aware" spacing on X11.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
6132329c2c Add Overview effect
This effect is meant to be as a replacement for the present windows and
the desktop grid effect. It is written using QML.

So far, this effect implements only the basic features of the present
windows effect. Desktop management features will be added later.

CCBUG: 295775
CCBUG: 303438
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
30da8f497c scripting: Draw window thumbnails with drop shadows 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c66f38ba7d kwineffects: Add properties to EffectScreen
This allows exposing EffectScreen to effects that use js or qml.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
9675da6325 kwineffects: Allow specifying render window for EffectQuickView
QtQuick can use the render window to compute the device pixel ratio for
the managed QQuickWindow.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c51de0f370 wayland: Don't track last focused internal window
QGuiApplication::focusWindow() can be used instead.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
dd6a60beea qpa: Implement QPlatformWindow::requestActivateWindow() 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
c79d7f56dd kwineffects: Disable OpenGLContext sharing check in EffectQuickView
On Wayland, QOpenGLContext::shareContext() will always return null even
if the newly created context has a share context.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
b32592f54e kwineffects: Allow disabling automatic frame scheduling in EffectQuickView 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
212090d990 Add Toplevel.stackingOrder property
This primarily targets QML scripts.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
2b06957f6f scripting: Register Workspace singleton type 2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
5435865329 scripting: Introduce ClientModel V3
ClientModel V3 is much easier to extend and maintain than the one in V2.
2021-08-19 06:30:55 +00:00
Vlad Zahorodnii
cecf2ee7a1 scripting: Move old ClientModel in V2 namespace 2021-08-19 06:30:55 +00:00
Ismael Asensio
f6f027aa10 kcm/kwindecoration: Fix window thumbnail sizes
Caused by a stray `units` context property that no longer exists.
2021-08-18 23:07:30 +02:00
Vlad Zahorodnii
1fbd99b572 Simplify Workspace::sendClientToDesktop()
This allows changing the type of desk to QVector<VirtualDesktop *>.

Based on the dont_activate flag, Workspace::sendClientToDesktop() will
try to focus the window if it's moved to the current virtual desktop.

In order to implement that, it needs to know whether the window has been
on the current desktop. c->isOnDesktop(desk) is a much sophisticated way
to do that.
2021-08-18 06:40:50 +00:00
Xaver Hugl
2e0336681f platforms/drm: consider KWIN_DRM_DEVICES for hotplugged gpus 2021-08-17 19:23:35 +02:00
David Edmundson
ff99100ec5 Fix build 2021-08-17 13:17:27 +01:00
Vlad Zahorodnii
0c0118f5e8 Port Workspace::takeActivity() to VirtualDesktop
Workspace::takeActivity() forces the modal dialog and its parent window
to be on the same virtual desktop. It uses int-based desktop ids for
that purpose.

This change ports the relevant parts of Workspace::takeActivity() to the
VirtualDesktop object.
2021-08-17 11:16:16 +00:00
David Edmundson
ad6ff56468 [kwin_wrapper] Port kwin_wrapper to not block
Functionally the same, but will be useful for some pending startup
changes where we have other operations.
2021-08-17 09:42:19 +01:00
David Edmundson
f541d851ed [kwin_wrapper] Transfer ownership of Xwayland socket creation and Xauthority to the wrapper
This way if kwin_wayland crashes we don't need to ensure that new
environment variables need to get synced across the new env.

This fixes an issue where spawning an xwayland application from a
wayland window that survives a crash would fail.

By moving the logic here we no longer need to wait for kwin_wayland to
start before starting plasmashell or even ksmserver as all environment
variables are set. As long as the wrapper is ready we can continue
starting and clients will just block on connect.

That should still allow for both a lot of optimisations both for speed
and cleaning up the startplasma-wayland scripts.

This will be addressed in follow up patches.

Use of kwin_wayland directly with xwayland is still supported for
testing.
2021-08-17 09:41:57 +01:00
David Edmundson
9692b49219 [kwin_wrapper] pass the wayland socket name via arguments rather than the env
The initial goal of kwin_wrapper was that it would set up all relevant
environment variables that will be used by the clients of kwin.

This meant having to cache old variables before we overrode them and
pass additional settings to the backends for the old wayland_display. It
works, but with X11 about to move too ends up being unnecessarily
complex. In hindsight it's easier for kwin to have the environment
represent the platform it is currently on, and have kwin explicitly set
variables in the QProcessEnvironment of the session it forks itnto.

This patch is changed so that we set the wayland socket name used by the
wrapper explicitly which is then used by the process environment kwin
uses for the main session.
2021-08-17 07:00:08 +00:00
Vlad Zahorodnii
9962a9fe59 Consider only windows on current desktop when snapping them
If a window is on several desktops, AbstractClient::desktop() will
return the id of the last desktop.

For example, if a window is on virtual desktops A and B, the desktop()
function will return the id of desktop B. This can be the culprit for
bugs such as window snapping not working as expected when moving a
window on virtual desktop A, e.g.

- moved window is on desktops A, and C. desktop() returns the id of C
- snap candidate (l) is on desktops A, and B. desktop() returns the id
  of B

Even though the snap candidate window and the moved window are both on
the same desktop (A), the moved window won't be snapped because the
desktop() function returns garbage values.

To fix that, the workspace needs to check whether the window is on the
current desktop.

For what it's worth, that's also how the workspace handles windows being
on multiple activities.
2021-08-17 06:24:19 +00:00
Vlad Zahorodnii
7c8d9c5b1c Port FocusChain to VirtualDesktop 2021-08-17 06:23:52 +00:00
Vlad Zahorodnii
42f2afd80d Port Workspace::findDesktop() to VirtualDesktop 2021-08-17 06:23:52 +00:00
Vlad Zahorodnii
b75f089981 Port Workspace::topClientOnDesktop() to VirtualDesktop
This patch has one behavioral change - raiseOrLowerClient() will not
work if the client is not on the current virtual desktop.

However, raiseOrLowerClient() can be called only in two cases:

* user triggers the raise or lower shortcut for the active client. Since
  the active client is on the current virtual desktop, it's not an issue

* an x11 window restacks itself. It makes no sense if an x11 window
  restacks itself while it's inactive or not on current virtual desktop.
  Also, the Opposite restack mode is rarely used, some window managers
  don't even bother implementing it. So, having such a constraint should
  not be a problem.

The main reason for not allowing raiseOrLowerClient() for windows that
are not on the current virtual desktop is that a window can be on
multiple virtual desktops. If a window is on A and B virtual desktops,
the only logical option is to toggle stacking position if the window is
on the current desktop. It's the only viable option as kwin does not
maintain per virtual desktop stacking order.
2021-08-17 06:23:52 +00:00
Ismael Asensio
76e74d7660 [kcm/kwinrules] Adapt width to new breeze style spinboxes
Also port from a stray `units` context property.
2021-08-16 15:12:34 +00:00
Vlad Zahorodnii
f5a883dc17 Port virtual desktops user action menu to VirtualDesktop
VirtualDesktop objects are more reliable than int-based desktop ids.
2021-08-16 15:00:01 +00:00
Xaver Hugl
566223b190 platforms/drm: fix crashing debug operator 2021-08-16 14:58:34 +00:00
Xaver Hugl
26dff99f78 platforms/drm: explicit modifiers
IN_FORMATS contains information about which buffer formats can be
scanned out with a given drm plane. Using these plane-specific
format+modifier combinations as well as explicit modifiers in
general can yield bandwidth and performance improvements,
especially in multi-gpu systems.
2021-08-16 16:56:32 +02:00
Vlad Zahorodnii
19cc22102c Change VirtualDesktop::id type from QByteArray to QString
This removes a lot of UTF-16 - UTF-8 conversions.
2021-08-16 16:15:57 +03:00
Vlad Zahorodnii
7f883fa724 Make EGL_KHR_surfaceless_context mandatory
We use surfaceless contexts with internal windows. We also require
the EGL_KHR_surfaceless_context extension for making context current
without outputs.

Arguably, we could use pbuffers, but since mainstream drivers (Mesa and
NVIDIA) support surfaceless contexts, the extra complexity doesn't buy
us anything.
2021-08-16 10:56:46 +00:00
Vlad Zahorodnii
4af9674f17 Revert "screenshot: Reuse GLTexture::toImage"
This reverts commit ac16bef409.

It causes crashes and color channels seem to be swapped.

GLTexture::toImage() needs more work before it can be used in the
screenshot effect, or maybe dropped.
2021-08-16 12:28:40 +03:00
David Edmundson
46980c0bb4 Fix crash in nested wayland backend on startup
In a recent refactor screens are only created when our xdg_surface has
been acked. This leaves a window where m_waylandCursor is null and
events are still being processed.
2021-08-16 08:09:42 +00:00
Vlad Zahorodnii
2a04a3d42c Remove Platform::sceneEglContext()
It's unused.
2021-08-16 08:08:31 +00:00
Vlad Zahorodnii
e315b0f9fe Remove Platform::sceneEglConfig()
With per-screen rendering, every output may have different EGLConfig.
Having a single global EGLConfig doesn't work out well.

This change removes Platform::sceneEglConfig(). It's used primarily to
create the global share context. In hindsight, the global share context
can be created without EGLConfig as it's never made current.

EGL_NO_CONFIG_KHR is part of EGL_KHR_no_config_context extension, which
is supported by both Mesa and NVIDIA driver so it should be safe to make
it mandatory.
2021-08-16 08:08:31 +00:00
Vlad Zahorodnii
bc7b28bb65 Fix a typo
At this point, desktop() is -1 since the client hasn't been moved to any
virtual desktop yet.

It seems like checking desktop() is a typo. It makes more sense to check
desktopId.
2021-08-16 06:32:43 +00:00
Vlad Zahorodnii
7f04d730e6 Make WindowRules::checkDesktop take a list of desktops
This ports relevant apis in WindowRules to the VirtualDesktop class.

If the client has no desktop rule, the desktop list that has been passed
to the checkDesktops() function will be returned.

If the client has a desktop window rule, the checkDesktop() function
will return a list with a single VirtualDesktop object or none if the
window is forced to be on all virtual desktops.
2021-08-16 06:32:43 +00:00
Vlad Zahorodnii
8e8fc55b0b Simplify desktop check in AbstractClient::setOnAllDesktops() 2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
86fa79c33b Use more Toplevel::isOnCurrentDesktop() 2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
43d773730d Unify virtual desktop removal handling on X11 and Wayland
On X11, a window can be only on a single virtual desktop or all, so the
platform specific code paths are not needed.
2021-08-16 06:31:59 +00:00
Vlad Zahorodnii
7f1baf66f9 Port some code away from AbstractClient::setDesktop() to AbstractClient::setDesktops()
The main motivation behind this change is to reduce the number of usages
of int-based virtual desktop apis. int-based desktop ids are highly
unreliable. For example, if a new virtual desktop is inserted in the
middle or removed in the middle, the desktop ids will change. This makes
working with virtual desktops code more challenging due to its behavior.
This is not an issue with VirtualDesktop objects.
2021-08-16 06:31:59 +00:00
Manuel Stoeckl
2aa3ed0005 Use texture unpacking for QImage uploads when possible
This change avoids unnecessary copying of QImage data when updating
textures using QImages that have non-ARGB32_Premultiplied formats.

There are three cases where texture unpacking can not be done/is
not worth doing: if GLES is used, and the extension for unpacking
subimages is not supported; if the entire image is being updated;
or if a format conversion needs to be done, in which case only the
region to update will have its format converted, and the resulting
image can be passed directly to glTexSubImage2d without setting
unpacking parameters.
2021-08-16 06:30:59 +00:00
l10n daemon script
214a318811 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"
2021-08-16 01:12:48 +00:00
l10n daemon script
d6f16882ff 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"
2021-08-14 01:18:16 +00:00
Méven Car
c5907e8f36 Fix a few compile warnings 2021-08-13 20:56:45 +02:00
Vlad Zahorodnii
3982f8399f Remove some redundant addWorkspaceRepaint() calls
These repaints were added to fix visual artifacts that appear when
shadow is removed, but since items schedule repaints when needed, we can
remove these two.
2021-08-13 06:28:18 +00:00
Vlad Zahorodnii
ec8a9f7cf7 Add isOnDesktop() overload that takes VirtualDesktop
int-based desktop ids are unreliable, but VirtualDesktop are not. So far
virtual desktop objects aren't used widely in kwin, but it's a good start.
2021-08-13 06:27:46 +00:00
Vlad Zahorodnii
a7cb034513 Simplify Toplevel::isOnDesktop() and Toplevel::isOnAllDesktops()
Wayland- and X11-specific code paths are not needed.

If the window is on all virtual desktops, Toplevel::desktops() will be
an empty list.

If the window is on a particular virtual desktop, Toplevel::desktops()
will contain that desktop. On X11, the desktops list can have at most
only one item.
2021-08-13 06:27:46 +00:00
Xaver Hugl
724f9a5db0 Correct check for when VRR should be active
The old calculation ignored the render time and safety margin of the
frame scheduling algorithm, which makes VRR activate properly only when
the refresh rate is much lower than the maximum refresh rate.
2021-08-12 20:38:45 +00:00
Vlad Zahorodnii
ef9d541487 Remove unused XCB includes in toplevel.h
Damage handling has been moved to SurfaceItemX11.
2021-08-12 20:57:17 +03:00
Vlad Zahorodnii
363177f36f Remove unused markedAsZombie signal 2021-08-12 17:52:24 +00:00
Vlad Zahorodnii
7e9c6587db Remove scene window traces in scene items
This further decouples scene items from scene windows. The SurfaceItem
still needs to access the underlying window, I would like to re-iterate
over that later.

With this change, it will be possible to introduce WindowItem factory
function in the Toplevel class.
2021-08-12 17:52:24 +00:00
Vlad Zahorodnii
a13fd02ea8 Remove virtualdesktops.h include in toplevel.h
toplevel.h is included in many places. Changing virtualdesktops.h may
trigger rebuild of all kwin.

With this change, only cpp files that use virtualdesktops.h will need to
be recompiled.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
f71686894d Remove unused includes in x11client.h 2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
a848fb6374 Remove input.h include in toplevel.h
It's unused.
2021-08-12 17:23:15 +00:00
Vlad Zahorodnii
0197d770ab Drop Toplevel::transparentRect()
It can be computed via other means (Toplevel::frameMargins()) and its
name is confusing. It specifies the inner decoration rect.
2021-08-12 17:22:49 +00:00
Aleix Pol
ac16bef409 screenshot: Reuse GLTexture::toImage
Cleans the code a bit. It also makes use of the more performant
Qt::Format_RGBA8888_Premultiplied, which is nice to come by.
2021-08-12 16:00:52 +00:00
Aleix Pol
1473466ef7 inputmethod: Remove the SNI entirely
It can be replaced with an ad-hoc plasmoid that gets to be a bit more
specific and interactive.
2021-08-12 16:00:15 +00:00
Vlad Zahorodnii
ad4f183a76 x11: Drop support for _NET_WM_FRAME_OVERLAP
The main idea behind _NET_WM_FRAME_OVERLAP is to extend the borders of
the server-side decoration so the application can draw on top of it. It
was inspired by similar feature in Windows.

However, _NET_WM_FRAME_OVERLAP is basically unused. Neither GTK nor Qt
support it and I have never seen any application that uses it.

At the moment, kwin is the only compositing window manager that supports
_NET_WM_FRAME_OVERLAP. Neither mutter nor compiz nor compton and so on
support it.

Since _NET_WM_FRAME_OVERLAP is practically unused, there's no point for
keeping supporting it.

This change shouldn't affect any existing app as _NET_WM_FRAME_OVERLAP
atom is not listed in _NET_SUPPORTED.
2021-08-12 11:44:40 +00:00
Vlad Zahorodnii
4ca287641f wayland: Destroy xdg shell clients when corresponding roles are about to be destroyed
This ensures that surface role objects can be still accessed when either
XdgToplevelClient or XdgPopupClient is destroyed. As far as I know, it
doesn't cause any problems right now, but this makes resource destruction
handling consistent, we tend to perform cleanup in aboutToBeDestroyed
signal slots.
2021-08-12 13:03:35 +03:00
Manuel Stoeckl
51d82fc6e5 Replace an old workaround for alpha-only shadows
SceneOpenGLShadow::prepareBackend used to use QImage::Format_Indexed8,
plus a special code path in GLTexture, to create single-channel OpenGL textures.
Now that Qt supports QImage::Format_Alpha8, this workaround can be removed.
2021-08-11 23:32:18 -04:00
l10n daemon script
4ab4f928f0 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"
2021-08-12 01:14:37 +00:00
Vlad Zahorodnii
4912c7cfa2 scenes/opengl: Calculate item transforms differently
Currently, a vertex coordinate is transformed first, then mapped to
the global screen coordinates. This causes a problem if a transform
is applied to the top-most item and child items are not at (0, 0).
For example, scaled windows may have popping out sub-surfaces, etc.

With this change, the item transforms will be computed differently. For
example, if the parent item is transformed, a child's transform will
look as follows

  [Parent's translation][Parent's transform][Child's translation]

instead of

  [Parent's translation][Child's translation][Parent's transform]

In the future, I'd like to get rid of the Item::setTransform() call in
OpenGLWindow::performPaint() and have either AnimationEffect or
libkwineffects call Item::setTransform().

BUG: 440201
2021-08-11 19:43:31 +03:00
David Edmundson
60255fd7a9 Teardown view before QQuickRenderControl
Deleting QQuickWindow will force any remaining runnables to complete.
This is important for any items (such as our new ThumbnailItem) that
deletes resources in queued cleanups.

We need to invoke this manually whilst we still have an active render
control with a valid context, otherwise remaining runnables will no-op.

We also then want to manually delete our scene contents before the view
so they're not orphaned temporarily.

This fixes a memory leak observed with the new Overview effect.
2021-08-11 07:31:53 +00:00
Vlad Zahorodnii
fdb1914a83 wayland: Wire in surface mapped state
If a sub-surface should be considered unmapped, make the corresponding
item invisible.

Note that this must apply only to sub-surfaces. Whether the main surface
should be visible is up to kwin. It may want to play an animation when
the toplevel surface is unmapped, etc.
2021-08-11 06:41:00 +00:00
Manuel Stoeckl
aa386896f1 Rename QImage to GL format conversion table
Also expand the comment describing it.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
b440be5bd2 Avoid converting images when updating GLTexture
In GLTexture::update, reuse the mechanism from the GLTexture(QImage, ...)
constructor to upload QImage data directly when the QImage format
has compatible GL format and type codes. Before this change, all QImage
formats other than ARGB32_Premultiplied required a format conversion.
2021-08-10 14:21:48 +00:00
Manuel Stoeckl
9be3513348 platforms/wayland: Delay setup until first configure
As per the xdg-shell specification, the compositor can only attach
a wl_buffer to an xdg_surface once the compositor has sent an
xdg_surface.configure event. Previously, there was a race condition
in which WaylandOutput objects were added/enabled on creation, making
it possible for the EglWaylandOutputs to be set up and for
EglWaylandBackend to draw a frame (thereby attaching a buffer), all
before the xdg_surface.configure configure event was received.
Compositors other than kwin would then send an unconfigured buffer
error and close the connection.

This commit avoids the problem by not marking the WaylandBackend
ready for use until all the output surfaces constructed at startup
have received their initial configure event. (In practice, this
takes one additional roundtrip.)
2021-08-10 14:21:12 +00:00
Alexander Volkov
1bf901cfbf Use c++ version of True to make sure it will compile
kwin fails to build for me because of missing 'True'.
Besides, 'true' is used in other places.
2021-08-10 10:46:07 +00:00
Nicolas Fella
050b4945ce [kcms/decoration] Try loading decoration KCMs without plugin keyword
We're porting away from using plugin keywords (and have done that for
the breeze and oxygen decoration). However to allow that we need to
adjust the loading code.

Keep the old codepath for compatibility.

BUG: 440786
2021-08-10 10:14:24 +00:00
Fabian Vogt
11c7e7a64d scenes/opengl: Avoid blending for entirely opaque SurfaceItems
Blending is quite expensive especially with software rendering.
In the case of Firefox on Wayland, it uses a ARGB8888 buffer but marks the
entire surface as opaque, so the alpha channel can be ignored.

CCBUG: 440386
2021-08-09 06:52:12 +00:00
Xaver Hugl
1041ef8275 platforms/drm: introduce virtual outputs
When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.

CCBUG: 420160
CCBUG: 438839
2021-08-07 17:18:40 +02:00
l10n daemon script
f7e2f5504a 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"
2021-08-07 01:15:04 +00:00
Vlad Zahorodnii
1dae29175f kwineffects: Fix potential image detaching
QImage is implicitly shared. However, methods such as QImage::bits() may
detach. In order to avoid the detach, one either needs make the image
const or use QImage::constBits() method.

Currently, the GLTexture class uses QImage::bits() all over the place.
It prevents implicit detaching by storing images in const variables. Such
code is fragile. Adding an intermediate (optional) conversion step may
result in odd performance regressions.
2021-08-06 07:20:54 +00:00
l10n daemon script
f4c0e19935 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"
2021-08-06 01:16:36 +00:00
Xaver Hugl
7879450cdf platforms/drm: work around tigerlake bug
CCBUG: 440361
2021-08-05 12:25:54 +00:00
Vlad Zahorodnii
e94fbcd853 Copy shape region to Deleted
Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.

If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.

BUG: 440001
BUG: 438458
BUG: 435378
2021-08-05 06:03:11 +00:00
l10n daemon script
d47b27f9cd 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"
2021-08-05 01:15:06 +00:00
Alexander Lohnau
e34d8bbed6 Consistently name kpackage structures
This will allow kpackage to load the structures by their path.

Task: https://phabricator.kde.org/T14757
Conceptually the same direction as https://phabricator.kde.org/T14499.
2021-08-04 18:42:31 +00:00
Alexander Lohnau
9fe294776d Define new KPackageStructure property in kpackage structures
Task: https://phabricator.kde.org/T14563
2021-08-04 18:42:31 +00:00
Alexander Lohnau
370f0c0b22 Clean up unneeded service type definitions in kpackage structures
Task: https://phabricator.kde.org/T14483
2021-08-04 18:42:31 +00:00
Xaver Hugl
81136a0448 platforms/drm: drop unused methods 2021-08-04 15:06:43 +02:00
l10n daemon script
7db6ea0c15 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"
2021-08-04 01:15:43 +00:00
Aleix Pol
896880be96 Revert "Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372"
https://invent.kde.org/plasma/kwin/-/merge_requests/1220

This reverts commit 44ad9437c4 because it
breaks build:
platforms/x11/common/eglonxbackend.cpp:224:66: error: cannot initialize a parameter of type 'EGLNativeWindowType' (aka 'unsigned long') with an rvalue of type 'xcb_window_t *' (aka 'unsigned int *')
        surface = eglCreateWindowSurface(eglDisplay(), config(), &window, nullptr);
                                                                 ^~~~~~~
2021-08-03 18:09:04 +02:00
nerdopolis turfwalker
44ad9437c4 Fix compile issue in https://bugs.kde.org/show_bug.cgi?id=440372 2021-08-03 08:28:04 -04:00
l10n daemon script
b90d92a8fb 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"
2021-08-03 01:15:25 +00:00
Andrey Butirsky
998bbf4eba fix wrong cursor hotspot under Wayland on VMs 2021-08-02 09:03:07 +00:00
David Edmundson
47e38b7141 Disconnect frame renders when ThumbnailItem has no window
It is perfectly valid to have a case where an item exists but has no
window. During these times the item will never be rendered.

Rather than guard in updateOffscreenTexture, it's more economical to
disable the frame rendering in the first place. Especially as then it's
easy to extend to item visibility.

BUG: 440318
2021-08-02 08:43:27 +00:00
l10n daemon script
cf9c60a0c0 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"
2021-08-02 01:12:21 +00:00
Xaver Hugl
2e473a21fb platforms/drm: small logging improvements 2021-08-01 23:26:49 +02:00
l10n daemon script
d2aac8cb05 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"
2021-08-01 01:21:11 +00:00
David Redondo
3b9ffdfbf6 Revert "Do not pass input to windows that are not painted"
This reverts commit 09f786a209.
2021-07-30 17:08:48 +02:00
David Redondo
09f786a209 Do not pass input to windows that are not painted
Passing input to windows that we do not paint is confusing as what happens
is different from what is visible on the screen.
2021-07-30 16:22:37 +02:00
l10n daemon script
141f627413 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"
2021-07-30 01:11:30 +00:00
l10n daemon script
ac438d6bb3 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"
2021-07-29 01:15:05 +00:00
Aleix Pol
475993db70 kscreen effect: Work per screen
Makes it possible to apply the dpms settings per screen instead of
applying it to all of them, which is wrong at many levels.
Will be even more important with other effects like rotation.
2021-07-28 10:57:27 +00:00
Alex Richardson
ed57ac39e2 Convert the KPackage plugin metadata to .json 2021-07-28 11:09:38 +01:00
Nate Graham
9f00c29c67 [kcmkwin/kwinrules] Port OverlaySheet headers to use title: property
This was added to Kirigami in
https://invent.kde.org/frameworks/kirigami/-/merge_requests/314
and simplifies and standardizes the creation of simple text-based
headers in OverlaySheet. This commit ports the KWin Rules KCM to
use it.
2021-07-27 15:17:41 -06:00
David Edmundson
beedf2be71 Fix minor typo 2021-07-27 13:20:24 +01:00
David Edmundson
0c6a8e7b88 Avoid setting crash count to 0 when restarted
If kwin is explicitly restarted (kwin_wayland --replace) we reset the
crash count so that you can run it more than 10 times without exiting to
the logout screen.

Resetting to 0 causes a issue as that triggers ksplash to be shown
again.

BUG: 434489
2021-07-27 12:18:29 +00:00
David Edmundson
ec9c2c3e68 Port kwin_wayland_wrapper to Qt/C++
We inintially created the wrapper to be light so avoided the QtCore
dependency and did it all in C.

In hindsight changing requirements means we want to add several more
features in here. The first step is to port to a more readable language
and toolkit.
2021-07-27 12:18:29 +00:00
l10n daemon script
5317ca9da0 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"
2021-07-27 01:25:25 +00:00
Vlad Zahorodnii
ca301d1914 Drop Scene::ImageFilterType
It's unused, GL_LINEAR filter is used by default now.
2021-07-26 14:56:21 +00:00
Vlad Zahorodnii
cb219da766 Remove screenGeometryChanged() in OpenGLBackend and QPainterBackend
The screenGeometryChanged() function is very X11-specific. On Wayland,
it's effectively unused.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
4ecb00889c scene: Move overlay window resizing to backends
The concept of an overlay window is not universal, it's X11 specific.
2021-07-26 14:55:54 +00:00
Vlad Zahorodnii
e171555f2d Remove stray friend class 2021-07-26 16:25:02 +03:00
David Redondo
d84198f3b8 Set component display name for touchpad and keyboard shortcuts
Otherwise they appear as "KWin" in the settings when we want them
to be "Touchpad" and "Keyboard Layout Switcher".
BUG:440259
FIXED-IN:5.23
2021-07-26 10:37:48 +02:00
Vlad Zahorodnii
d4c7486fe1 Remove Q_UNUSED
damage is used.
2021-07-26 08:40:41 +03:00
Vlad Zahorodnii
3ab2ea40c4 Remove mask arg in Scene::paintScreen()
Render backends don't pass anything to the scene.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
d2b6d7ee59 platforms/wayland: Add support for buffer age in qpainter backend 2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
1cbf232b98 platforms/wayland: Report correct damage to host compositor
damageHistory.first() is the previous damage region, we need to report
the current instead.
2021-07-25 09:59:04 +03:00
Vlad Zahorodnii
e087b2ce2f platforms/drm: Add buffer age support in qpainter backend
Currently, the entire screen will be repainted when using the qpainter
render backend. With this change, kwin will repaint only the dirty parts
on the screen.
2021-07-25 09:59:00 +03:00
Vlad Zahorodnii
603db353a3 scenes/qpainter: Avoid setting brush in paintBackground()
Calling QPainter::setBrush() without saving the current state, produces
mysterious black rectangles around clip region rects.
2021-07-24 16:32:16 +03:00
Vlad Zahorodnii
501298b0e0 Introduce DamageJournal helper 2021-07-24 16:32:13 +03:00
Vlad Zahorodnii
2fe102768a Remove QPainterBackend::needsFullRepaint()
A better alternative is to return the damage region in the beginFrame()
function. This way, the render backend can force full screen repaints or
indicate what parts of the buffer needs to be repainted (for buffer age)
2021-07-24 14:54:17 +03:00
Vlad Zahorodnii
4abbb6f0d6 Make OpenGLBackend and QPainterBackend QObjects
Almost all their subclasses are QObjects. This simplifies the class
hierarchy by making OpenGLBackend and QPainterBackend qobjects.
2021-07-24 11:30:13 +03:00
Vlad Zahorodnii
d543c0dff6 Remove unused mask param in QPainterBackend::endFrame()
It is unused and it is not a good idea to pass Scene's mask to the
render backend as it results in higher coupling between Platform and
Scene.
2021-07-23 20:42:59 +00:00
Nicolas Fella
a317a3f6bc Remove unused include 2021-07-23 19:51:11 +02:00
Vlad Zahorodnii
85654236d7 Fix build 2021-07-23 18:45:54 +03:00
Vlad Zahorodnii
964c487d4f wayland: Switch to ClientBuffer
The main motivation behind the split is to simplify client buffer code
and allow adding new features easier, for example referencing the shm
pool when a shm buffer is destroyed, or monitoring for readable linux
dmabuf file descriptors, etc.

Also, a referenced ClientBuffer cannot be destroyed, unlike the old
BufferInterface.
2021-07-23 15:33:38 +00:00
Andrey Butirsky
95e954da30 [tabbox] prevent dangling popups when switching on Wayland
If some popups of active window present, there was glitches on switching
such as stale popups or the popup happened below window.
Dismissing all the popups solves the problem.

BUG: 431046
2021-07-23 12:12:03 +00:00
Andrey Butirsky
b45f5c3a66 fix No globalshortcuts with popup grab
BUG: 431046
2021-07-23 12:12:03 +00:00
Nicolas Fella
25b85607d0 Port from KPluginLoader::pluginsById to KPluginMetaData::pluginById
The latter gives us only a single plugin which makes the code a bit more concise
2021-07-22 22:59:13 +02:00
Aleix Pol
05f3939cf1 inputmethod: Use the command as the availability metric 2021-07-22 20:12:54 +02:00
Aleix Pol
278da74eab inputmethod: Add a property to tell whether an input method is running 2021-07-22 17:42:53 +02:00
Vlad Zahorodnii
f431b6ad96 wayland: Cache last surface-to-buffer matrix
If window quads need to be generated after the wl_surface is destroyed,
the SurfaceItemWayland::mapToBuffer() function will return wrong values.

In order to fix that, we need to store the last surface-to-buffer matrix
in SurfaceItem.
2021-07-22 06:26:00 +00:00
l10n daemon script
068c1d4970 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"
2021-07-22 01:15:50 +00:00
Nicolas Fella
2faff3b1d0 [kcms/kwinoption] Remove obsolete desktop files and factory registrations
These appear to be remnants from a time where the current tabs were individual KCMs.

Remove some unneeded stuff and convert the only relevant registration to the normal K_PLUGIN_FACTORY macro
2021-07-21 19:42:45 +00:00
Nicolas Fella
cff33e7e40 [GenericScriptedConfig] Remove unused parameter
The passed value is always the same and never used
2021-07-21 19:42:15 +00:00
Nicolas Fella
55c6de1790 [kcms/effects] Remove unneeded X-KDE-PluginKeyword 2021-07-21 21:15:26 +02:00
Nicolas Fella
2f9adf4715 [effectsmodel] Simplify generic config plugin loading
We know exactly which plugin we want to load

No need to go through findPlugins()
2021-07-21 16:10:19 +02:00
Aleix Pol
422522d15b inputmethod: Also expose the visibility on dbus
Since we adapted inputmethod to support methods like ibus, the input
method can be active but not have a visible panel.
This includes an extra property that will indicate us if the panel is
visible at any time. This will allow us to properly render the virtual
keyboard hide button in Plasma Mobile (or wherever we need it).
2021-07-21 13:10:30 +02:00
Aleix Pol
abf22570c7 inputmethod: Reduce consecutive activation+deactivation+activation sequences
So far calling setActive(true) would issue a deactivation then another
activation. This sometimes makes maliit crash and we can achieve the
same result just by just issuing a reset.
2021-07-21 13:10:30 +02:00
Aleix Pol
638174ae09 inputmethod: Make sure the menu is only created when we create the SNI
It always does the same anyway, this way we make sure we don't leak
2021-07-21 13:10:30 +02:00
Aleix Pol
0169bca6e0 inputmethod sni: return early for readability 2021-07-21 13:10:29 +02:00
Michal Malý
d2ceea83b7 (Wayland) Allow moving windows from one virtual desktop to another with a single action 2021-07-21 10:43:58 +00:00