Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Discover
Commits
57dc3b72
Commit
57dc3b72
authored
Jan 04, 2021
by
David Edmundson
Browse files
Set startupID before raising
Otherwise it will be blocked correctly by window manager focus policies
BUG: 423857
parent
9ac2e94a
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
57dc3b72
...
...
@@ -11,7 +11,7 @@ find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set
(
CMAKE_MODULE_PATH
${
ECM_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake"
)
find_package
(
Qt5
${
QT_MIN_VERSION
}
REQUIRED CONFIG COMPONENTS Widgets Test Network Xml Concurrent DBus Quick
)
find_package
(
Qt5
${
QT_MIN_VERSION
}
REQUIRED CONFIG COMPONENTS Widgets Test Network Xml Concurrent DBus Quick
X11Extras
)
include
(
KDEInstallDirs
)
include
(
KDECMakeSettings
)
include
(
KDEFrameworkCompilerSettings NO_POLICY_SCOPE
)
...
...
discover/CMakeLists.txt
View file @
57dc3b72
...
...
@@ -36,6 +36,7 @@ target_link_libraries(plasma-discover PUBLIC
KF5::KIOWidgets
KF5::QuickAddons
Qt5::Quick
Qt5::X11Extras
Discover::Common
)
...
...
discover/main.cpp
View file @
57dc3b72
...
...
@@ -19,6 +19,9 @@
#include
"DiscoverVersion.h"
#include
<QTextStream>
#include
<QStandardPaths>
#include
<kstartupinfo.h>
#include
<QX11Info>
typedef
QHash
<
QString
,
DiscoverObject
::
CompactMode
>
StringCompactMode
;
Q_GLOBAL_STATIC_WITH_ARGS
(
StringCompactMode
,
s_decodeCompactMode
,
(
StringCompactMode
{
...
...
@@ -135,10 +138,18 @@ int main(int argc, char** argv)
}
QObject
::
connect
(
&
app
,
&
QCoreApplication
::
aboutToQuit
,
mainWindow
,
&
DiscoverObject
::
deleteLater
);
QObject
::
connect
(
service
,
&
KDBusService
::
activateRequested
,
mainWindow
,
[
mainWindow
](
const
QStringList
&
arguments
,
const
QString
&
/*workingDirectory*/
){
if
(
!
mainWindow
->
rootObject
())
QCoreApplication
::
instance
()
->
quit
();
mainWindow
->
rootObject
()
->
raise
();
auto
window
=
qobject_cast
<
QWindow
*>
(
mainWindow
->
rootObject
());
if
(
window
&&
QX11Info
::
isPlatformX11
())
{
KStartupInfo
::
setNewStartupId
(
window
,
QX11Info
::
nextStartupId
());
}
window
->
raise
();
if
(
arguments
.
isEmpty
())
return
;
QScopedPointer
<
QCommandLineParser
>
parser
(
createParser
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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