Commit graph

20012 commits

Author SHA1 Message Date
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