Commit graph

18681 commits

Author SHA1 Message Date
Vlad Zahorodnii
9b89a3d967 qpa: Merge OpenGL platform context classes
This makes our QPlatformOpenGLContext private subclass simpler.

As a slightly unrelated change, this patch also fixes a bug where our
platform opengl context may return a wrong surface format if surfaceless
contexts are unsupported.
2020-10-13 05:32:48 +00:00
Vlad Zahorodnii
b7bd8472f2 scene: Reduce the call cost of Platform::supportsQpaContext()
Every time Platform::supportsQpaContext() is called, we go through the
list of supported extensions and perform a string comparison op. This is
not really cheap.
2020-10-13 05:32:48 +00:00
Nicolas Fella
968b57fe2f Fix KWIN_EFFECT_FACTORY macros
The macros don't work because of the mismatching capitalization.
2020-10-12 20:28:22 +00:00
Nicolas Fella
aa9475e64e [effects] Fix documention sentence
It makes more sense this way to me
2020-10-12 19:36:32 +02:00
Vlad Zahorodnii
d3934be591 Prefer std::make_unique over std::unique_ptr(new T)
This way code is thinner and it is guaranteed that no memory leaks will
occur if an exception gets thrown for some reason.
2020-10-12 08:51:01 +03:00
l10n daemon script
faa06ea919 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"
2020-10-12 06:06:51 +02:00
l10n daemon script
5cb6f51ef6 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"
2020-10-11 06:01:48 +02:00
Vlad Zahorodnii
08263b534d Safely remove all internal clients and override-redirect windows
When we destroy all internal clients and override-redirect windows, we
assume that corresponding lists will be implicitly detached.

However, in some cases, that might be not the case. For example, if the
list is not shared, neither begin() nor end() will detach. Therefore, it
is possible to hit invalidated iterators if the list is modified inside
the loop.

This change prevents hitting invalidated iterators by making explicit
list copies.

CCBUG: 427373
2020-10-09 19:33:46 +03:00
Vlad Zahorodnii
a5b811dadb Rename the variable where override-redirect windows are stored
Prepend m_ to unmanaged so no one has to come up with original names if
they want to iterate over a shadow copy of it.
2020-10-09 18:49:32 +03:00
Aleix Pol
ec73f5eec8 Adapt to changes in wayland-server KeyStateInterface 2020-10-09 13:17:38 +00:00
Aleix Pol
daf693d3ed Restore building the wayland_backend without gbm
Disables the compilation on the few places that use it to allow creating
dmabufs easily.

Patch inspired by David Faure.
2020-10-09 13:15:12 +00:00
l10n daemon script
237d52be01 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"
2020-10-09 06:39:13 +02:00
Bhushan Shah
a13f5d4b06 inputmethod: remove the workarounds
- Do not set emit the enabledChanged of the text-input-v2 when it
  requests us to show input panel, it is already enabled when you get
  this request
- If we get the request to show input panel, reset the inputContext,
  there's two reason we can get this event: 1) when keyboard focus is
  activated or 2) when keyboard focus is changed to text field in same
  surface. In both cases, information in input method context is not
  valid anymore and should be reset.
- Also instead of ignoring the update_state events from client, adopt
  input method accordingly.
2020-10-08 17:56:44 +05:30
Ismael Asensio
23788ad9b9 [kcm/kwinrules] Add properties to a rule one-by-one
Change the labels to singular `Property` and close the property sheet
after clicking on one item.

The behaviour of the sheet is now more similar to a menu, and not so
much as a dialog which needs to be dismissed to go on.

The idea is to simplify the rule editor workflow and make it more evident
to the users. By making the `Add property` close after each selection,
the user can see immediately that the property has been added to the
rule list so they can edit it.

Also use ListView transitions to add visual hints when adding
or removing properties, and try to position the new added item
into the visible view.
2020-10-07 23:08:23 +02:00
Vlad Zahorodnii
f247e35c6d wayland: Fix initialization of dmabuf textures
Commit e459c8bf54 added a sanity check to
prevent recomputing the texture matrix if the y-inverted hint hasn't been
changed, which is totally reasonable!

However, code that initializes dmabuf textures implicitly assumes that
calling setYInverted() always results in updating the matrix. But it may
be not the case if the passed value matches current isYInverted().

This change adds missing calls to force updating the texture matrix.

Note that we don't need to check the buffer size every time the dmabuf
image has been modified externally because the window pixmap is going to
be re-created if the dimensions of the attached buffer have changed.

I've seen some reports on the internet about Firefox displaying garbage
instead of videos. 99% that bug is caused by this issue. But it seems
like Firefox no longer displays corrupted videos on my machine, so it's
hard to tell.
2020-10-07 11:43:43 +00:00
Benjamin Port
7546af6b4c KCM KWin Decoration: Add module data
depends on https://invent.kde.org/frameworks/kcmutils/-/merge_requests/19
2020-10-07 12:29:02 +02:00
Benjamin Port
5290583f8a KCM KWin Decoration: Remove isDefault
Custom code for isDefault is not needed. Indeed, testing dropdown value is not needed to know if we have a default value or not. Testing theme and border size auto is enough, and it's done automatically by KConfigXT
2020-10-07 10:14:07 +00:00
Méven Car
a7aa089ec4 ScreenshotEffect: fix ordering of screens in screenshotScreens 2020-10-06 17:07:05 +02:00
l10n daemon script
de4e429aed 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"
2020-10-06 06:04:18 +02:00
Xaver Hugl
b50f747876 Multi-GPU output support on Wayland
This commit sets up udev and the DrmBackend to list and use all GPUs.

BUG: 425586
BUG: 417323
2020-10-05 21:05:55 +00:00
l10n daemon script
1f6e615ec0 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"
2020-10-05 06:16:34 +02:00
Ismael Asensio
715f0dbbcc [kcm/kwinrules] Port to new Connections syntax
While at it remove `FIXME`comment that no longer applies
2020-10-02 23:19:59 +00:00
Andreas Hartmetz
9d77271011 Fix const / non-const iterator mismatch
Fixes the build for me. STL actually allows const and non-const
iterator comparsion, Qt containers... uh, sometimes? :>
2020-10-02 23:22:22 +02:00
Vlad Zahorodnii
0e7b02bc73 Export QDebug operator<<(QDebug , const Toplevel *)
It can be useful when debugging code in plugins, etc.
2020-10-02 13:44:10 +03:00
Vlad Zahorodnii
005377eff7 Unify code that setups client connections in EffectsHandlerImpl
Workspace::allClientList() returns all X11 and Wayland windows. So, we
don't need the two separate code paths.
2020-10-01 16:26:52 +00:00
Vlad Zahorodnii
0f9722ad69 Port DebugConsole to Workspace::allClientList()
This simplifies the code by porting the debug console away from
Workspace::clientList() to Workspace::allClientList(). The main
difference between the two is that the former returns only all X11
windows and the latter returns both X11 and Wayland windows.
2020-10-01 16:26:52 +00:00
David Edmundson
56f159dded Adapt to DataSource changes 2020-10-01 14:51:05 +00:00
Nicolas Fella
3694580e2b [kcms/effectmodel] Use KPluginMetaData to load scripted config
Instead of going through the semi-deprecated KPluginTrader and KPluginInfo we can use KPluginLoader directly.
2020-10-01 14:28:46 +00:00
Vlad Zahorodnii
bf4c67678f 3rdparty: Synchronize xcursor.{c,h} 2020-10-01 13:54:45 +03:00
Vlad Zahorodnii
1e9bd43368 scripting: Fix initialization of WorkspaceWrapper
Workspace::clientList() only returns X11 clients, while allClientList()
returns all managed clients (both X11 and Wayland).
2020-10-01 10:20:31 +00:00
Vlad Zahorodnii
1251b2cbb3 scripting: Make ClientFilterModel work for Wayland windows 2020-10-01 10:20:31 +00:00
Vlad Zahorodnii
faf6b8e049 scripting: Properly initialize clients model for Wayland windows
In some cases, a ClientLevel model may not contain all Wayland windows
because of missing if (waylandServer()) {} code path in init() method.
2020-10-01 10:20:31 +00:00
Cyril Rossi
a3caf7f6dd Port KCM KWin Decoration to SettingStateBinding 2020-10-01 09:19:32 +02:00
Albert Astals Cid
743b06d3a1 Fix kwin_rules_dialog not showing translated strings
BUGS: 427172
2020-10-01 00:29:13 +02:00
Nicolas Fella
abca052004 [kcm/decoration] Port to KPluginLoader
Summary: KPluginTrader's future is uncertain. KPluginLoader is enough here

Test Plan: Open deco KCM. Themes are listed

Reviewers: #kwin, dfaure

Reviewed By: dfaure

Subscribers: dfaure, zzag, kwin

Tags: #kwin

Maniphest Tasks: T12173

Differential Revision: https://phabricator.kde.org/D25534
2020-09-30 15:50:52 +02:00
Bhushan Shah
0a3e18e5a6 Fix build 2020-09-30 16:16:45 +05:30
Bhushan Shah
474d0344ca autotests: rename to testInputMethod
Relevant class got renamed, also update the test name

Related: plasma/kwin!302
2020-09-30 16:04:49 +05:30
Méven Car
309a656e00 Screenshot effect: add a screenshotScreens(...) to screenshot specific screens 2020-09-30 07:44:30 +00:00
Cyril Rossi
99bed106bf KCM KWin Manage default Highlight indicator for settings not handled by KCModule
For the following KCM :
* KWin Options
* KWin Screen Edges
* KWin Tabbox

KCModule introduce an indicator to show which settings have changed from
default value. Unfortunately some KCM have settings' states which are not managed
automatically by the KCModule thus we have to handle it manually.

see https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/9
2020-09-30 09:10:23 +02:00
l10n daemon script
30b516eceb 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"
2020-09-30 06:16:48 +02:00
Bhushan Shah
222b558b04 virtualkeyboard: rename class to InputMethod
VirtualKeyboard class does not implement the relevant VirtualKeyboard
protocol but rather implements the InputMethod protcol and can in theory
be used by other input method like e.g. ibus.

Make class name consistent with what it does to avoid confusion in
future.

For now only rename of main class is done and dbus service is kept as-is
to provide retro-compatibility, when input method protocol is
implemented fully, we can think of what to do wrt the dbus interface
later when we fully implement zwp_input_method_unstable_v1 protocol.
2020-09-29 20:55:24 +05:30
Aleix Pol
f558115def scene: prefer calling mapToGlobal just once
It's the same top mapToGlobal()+operator& than the other way around and
we get to skip 1 call.
This path is the most common so we better save it.
2020-09-29 14:26:37 +00:00
Andrey Butirsky
db202f5c26 fix: redundant keyboard layout OSD notification
there is no need to display the OSD for window we are going to switch from

DIGEST:
BUG: 426122
2020-09-29 14:20:03 +00:00
Andrey Butirsky
2bbab06fc4 fix: wrong keyboard layout OSD notification
DIGEST:
BUG: 426120
2020-09-29 14:20:03 +00:00
Andrey Butirsky
769c8959d8 fix: no OSD indication when switching keyboard layout with Application Policy
When deciding do OSD or not, we need to consider not only last saved layout,
but last actual layout also, when comparing it to current one.

DIGEST:
BUG: 425590
2020-09-29 14:20:03 +00:00
Vlad Zahorodnii
4559d30399 Place internal osd windows according to placement policies
Currently, internal on screen display windows have the bypass window
manager hint set. If that hint is set, the osds must place themselves,
but they don't do it.

As far as I know, there is no any reason why internal OSDs have that
flag set.

By removing the Qt::BypassWindowManagerHint flag, we let kwin core
know that it's okay to place internal OSD windows.

BUG: 400675
2020-09-29 14:06:41 +00:00
Vlad Zahorodnii
6546ac2cae screencast: Replace EGLFence with a glFinish()
The way EGLFence is used is equivalent to calling glFinish().

CCBUG: 425869
2020-09-29 13:57:24 +00:00
Vlad Zahorodnii
6f153552da Allow calling setFrameGeometry() while the client is being resized
Currently, if some script attempts to resize a window while it's being
interactively resized, the corresponding change won't be propagated to
the X server.

The main reason for that is that we don't want to configure the frame
window, the wrapper window, and the client window twice. However, since
Xcb::Window keeps track of the last configured geometry, we can adjust
X11Client::updateServerGeometry() so it only configures windows that
have mismatching geometry.

By doing so, the setFrameGeometry() function can be called by scripts
even when the associated X11 window is being interactively resized.

Note that this bug doesn't affect Wayland windows.

BUG: 426988
2020-09-29 13:55:41 +00:00
Vlad Zahorodnii
ddb24eaf0a Fix ghost shadows left by context menus
If the shadow is destroyed immediately before the window is destroyed,
we need to schedule a workspace repaint in order to prevent showing a
"ghost" shadow.

BUG: 425294
2020-09-29 13:53:30 +00:00
Vlad Zahorodnii
12e59f9af8 Schedule workspace repaint for destroyed clients
We need to schedule a workspace repaint in case no effect is going to
animate the window.

The workspace repaint is issued before creating a Deleted because the
latter takes the owner of the effect window, which means that after an
instance of Deleted has been created, visibleRect() returns the frame
geometry.

CCBUG: 425294
2020-09-29 13:53:30 +00:00