Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Workspace
Commits
e096e86e
Commit
e096e86e
authored
Apr 16, 2012
by
Thomas Lübking
Browse files
detach killHelper process from KWin
BUG: 295940 FIXED-IN: 4.9 REVIEW: 104627
parent
26cbec3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
kwin/client.cpp
View file @
e096e86e
...
...
@@ -106,7 +106,7 @@ Client::Client(Workspace* ws)
,
tab_group
(
NULL
)
,
in_layer
(
UnknownLayer
)
,
ping_timer
(
NULL
)
,
process_killer
(
NULL
)
,
m_killHelperPID
(
0
)
,
user_time
(
CurrentTime
)
// Not known yet
,
allowed_actions
(
0
)
,
block_geometry_updates
(
0
)
...
...
@@ -1457,13 +1457,9 @@ void Client::gotPing(Time timestamp)
return
;
delete
ping_timer
;
ping_timer
=
NULL
;
if
(
process_killer
!=
NULL
)
{
process_killer
->
kill
();
// Recycle when the process manager has noticed that the process exited
// a delete process_killer here sometimes causes a hang in waitForFinished
connect
(
process_killer
,
SIGNAL
(
finished
(
int
,
QProcess
::
ExitStatus
)),
process_killer
,
SLOT
(
deleteLater
()));
process_killer
=
NULL
;
if
(
m_killHelperPID
&&
!::
kill
(
m_killHelperPID
,
0
))
{
// means the process is alive
::
kill
(
m_killHelperPID
,
SIGTERM
);
m_killHelperPID
=
0
;
}
}
...
...
@@ -1477,7 +1473,7 @@ void Client::pingTimeout()
void
Client
::
killProcess
(
bool
ask
,
Time
timestamp
)
{
if
(
process_killer
!=
NULL
)
if
(
m_killHelperPID
&&
!::
kill
(
m_killHelperPID
,
0
))
// means the process is alive
return
;
Q_ASSERT
(
!
ask
||
timestamp
!=
CurrentTime
);
QByteArray
machine
=
wmClientMachine
(
true
);
...
...
@@ -1493,25 +1489,16 @@ void Client::killProcess(bool ask, Time timestamp)
}
else
::
kill
(
pid
,
SIGTERM
);
}
else
{
process_killer
=
new
QProcess
(
this
);
connect
(
process_killer
,
SIGNAL
(
error
(
QProcess
::
ProcessError
)),
SLOT
(
processKillerExited
()));
connect
(
process_killer
,
SIGNAL
(
finished
(
int
,
QProcess
::
ExitStatus
)),
SLOT
(
processKillerExited
()));
process_killer
->
start
(
KStandardDirs
::
findExe
(
"kwin_killer_helper"
),
QStringList
()
<<
"--pid"
<<
QByteArray
().
setNum
(
unsigned
(
pid
))
<<
"--hostname"
<<
machine
<<
"--windowname"
<<
caption
()
<<
"--applicationname"
<<
resourceClass
()
<<
"--wid"
<<
QString
::
number
(
window
())
<<
"--timestamp"
<<
QString
::
number
(
timestamp
));
QProcess
::
startDetached
(
KStandardDirs
::
findExe
(
"kwin_killer_helper"
),
QStringList
()
<<
"--pid"
<<
QByteArray
().
setNum
(
unsigned
(
pid
))
<<
"--hostname"
<<
machine
<<
"--windowname"
<<
caption
()
<<
"--applicationname"
<<
resourceClass
()
<<
"--wid"
<<
QString
::
number
(
window
())
<<
"--timestamp"
<<
QString
::
number
(
timestamp
),
QString
(),
&
m_killHelperPID
);
}
}
void
Client
::
processKillerExited
()
{
kDebug
(
1212
)
<<
"Killer exited"
;
delete
process_killer
;
process_killer
=
NULL
;
}
void
Client
::
setSkipTaskbar
(
bool
b
,
bool
from_outside
)
{
int
was_wants_tab_focus
=
wantsTabFocus
();
...
...
kwin/client.h
View file @
e096e86e
...
...
@@ -675,7 +675,6 @@ private slots:
void
performMoveResize
();
void
removeSyncSupport
();
void
pingTimeout
();
void
processKillerExited
();
void
demandAttentionKNotify
();
void
repaintDecorationPending
();
...
...
@@ -896,7 +895,7 @@ private:
TabGroup
*
tab_group
;
Layer
in_layer
;
QTimer
*
ping_timer
;
QProcess
*
process_killer
;
qint64
m_killHelperPID
;
Time
ping_timestamp
;
Time
user_time
;
unsigned
long
allowed_actions
;
...
...
Write
Preview
Supports
Markdown
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