Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Graphics
Spectacle
Commits
f4dbec3f
Commit
f4dbec3f
authored
Aug 07, 2020
by
Méven Car
Committed by
Méven Car
Aug 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to use Immediate Shutter mode in Plasma 5.19.80+
parent
a5149896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
src/Platforms/PlatformKWinWayland.cpp
src/Platforms/PlatformKWinWayland.cpp
+11
-5
No files found.
src/Platforms/PlatformKWinWayland.cpp
View file @
f4dbec3f
...
...
@@ -91,9 +91,10 @@ Platform::GrabModes PlatformKWinWayland::supportedGrabModes() const
return
lSupportedModes
;
}
static
QPair
<
int
,
int
>
s_plasmaVersion
=
{
-
1
,
-
1
};
QPair
<
int
,
int
>
findPlasmaMinorVersion
()
{
if
(
s_plasmaVersion
==
QPair
<
int
,
int
>
(
-
1
,
-
1
))
{
static
std
::
array
<
int
,
3
>
s_plasmaVersion
=
{
-
1
,
-
1
,
-
1
};
std
::
array
<
int
,
3
>
findPlasmaMinorVersion
()
{
if
(
s_plasmaVersion
==
std
::
array
<
int
,
3
>
{
-
1
,
-
1
,
-
1
})
{
auto
message
=
QDBusMessage
::
createMethodCall
(
QStringLiteral
(
"org.kde.plasmashell"
),
QStringLiteral
(
"/MainApplication"
),
QStringLiteral
(
"org.freedesktop.DBus.Properties"
),
...
...
@@ -125,7 +126,12 @@ QPair<int, int> findPlasmaMinorVersion () {
qWarning
()
<<
"error parsing plasma minor version"
;
return
s_plasmaVersion
;
}
s_plasmaVersion
=
{
plasmaMajorVersion
,
plasmaMinorVersion
};
int
plasmaPatchVersion
=
splitted
[
2
].
toInt
(
&
ok
);
if
(
!
ok
)
{
qWarning
()
<<
"error parsing plasma patch version"
;
return
s_plasmaVersion
;
}
s_plasmaVersion
=
{
plasmaMajorVersion
,
plasmaMinorVersion
,
plasmaPatchVersion
};
}
return
s_plasmaVersion
;
}
...
...
@@ -134,7 +140,7 @@ Platform::ShutterModes PlatformKWinWayland::supportedShutterModes() const
{
// TODO remove sometime after Plasma 5.20 is released
auto
plasmaVersion
=
findPlasmaMinorVersion
();
if
(
plasmaVersion
.
first
!=
-
1
&&
(
plasmaVersion
.
first
!=
5
||
plasmaVersion
.
second
>=
20
))
{
if
(
plasmaVersion
.
at
(
0
)
!=
-
1
&&
(
plasmaVersion
.
at
(
0
)
!=
5
||
(
plasmaVersion
.
at
(
1
)
>=
20
||
(
plasmaVersion
.
at
(
1
)
==
19
&&
plasmaVersion
.
at
(
2
)
>=
80
))
))
{
return
{
ShutterMode
::
Immediate
|
ShutterMode
::
OnClick
};
}
else
{
return
{
ShutterMode
::
OnClick
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment