Fix spurious kompmgr crash dialogs

Disable irritating and obsolete warning dialog when kompmgr is enabled


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1245889 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent bd777c107e
commit 341ad02235

@ -1671,8 +1671,8 @@ bool KTranslucencyConfig::kompmgrAvailable()
void KTranslucencyConfig::showWarning(bool alphaActivated) void KTranslucencyConfig::showWarning(bool alphaActivated)
{ {
if (alphaActivated) // if (alphaActivated)
KMessageBox::information(this, i18n("<qt>Translucency support is new and may cause problems<br> including crashes (sometimes the translucency engine, seldom even X).</qt>"), i18n("Warning")); // KMessageBox::information(this, i18n("<qt>Translucency support is new and may cause problems<br> including crashes (sometimes the translucency engine, seldom even X).</qt>"), i18n("Warning"));
} }
#include "windows.moc" #include "windows.moc"

@ -2563,10 +2563,10 @@ void Workspace::startKompmgr()
kompmgr_selection = new KSelectionOwner( selection_name ); kompmgr_selection = new KSelectionOwner( selection_name );
connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr())); connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr()));
kompmgr_selection->claim( true ); kompmgr_selection->claim( true );
connect(kompmgr, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(restartKompmgr())); connect(kompmgr, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(restartKompmgr(KProcess*)));
options->useTranslucency = TRUE; options->useTranslucency = TRUE;
allowKompmgrRestart = FALSE; //allowKompmgrRestart = FALSE;
TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); //TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) );
TQByteArray ba; TQByteArray ba;
TQDataStream arg(ba, IO_WriteOnly); TQDataStream arg(ba, IO_WriteOnly);
arg << ""; arg << "";
@ -2601,47 +2601,49 @@ void Workspace::unblockKompmgrRestart()
allowKompmgrRestart = TRUE; allowKompmgrRestart = TRUE;
} }
void Workspace::restartKompmgr() void Workspace::restartKompmgr( KProcess *proc )
// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQT_SLOT(startKompmgr())); // this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQT_SLOT(startKompmgr()));
{ {
if (!allowKompmgrRestart) // uh-ohh if (proc->signalled()) { // looks like kompmgr crashed
{ if (!allowKompmgrRestart) // uh oh, it crashed recently already
delete kompmgr_selection; {
kompmgr_selection = NULL; delete kompmgr_selection;
options->useTranslucency = FALSE; kompmgr_selection = NULL;
KProcess proc; options->useTranslucency = FALSE;
proc << "kdialog" << "--error" KProcess proc;
<< i18n( "The Composite Manager crashed twice within a minute and is therefore disabled for this session.") proc << "kdialog" << "--error"
<< "--title" << i18n("Composite Manager Failure"); << i18n( "The Composite Manager crashed twice within a minute and is therefore disabled for this session.")
proc.start(KProcess::DontCare); << "--title" << i18n("Composite Manager Failure");
return; proc.start(KProcess::DontCare);
} return;
if (!kompmgr) }
return; if (!kompmgr)
return;
// this should be useless, i keep it for maybe future need // this should be useless, i keep it for maybe future need
// if (!kcompmgr) // if (!kcompmgr)
// { // {
// kompmgr = new KProcess; // kompmgr = new KProcess;
// kompmgr->clearArguments(); // kompmgr->clearArguments();
// *kompmgr << "kompmgr"; // *kompmgr << "kompmgr";
// } // }
// ------------------- // -------------------
if (!kompmgr->start(KProcess::NotifyOnExit, KProcess::Stderr)) if (!kompmgr->start(KProcess::NotifyOnExit, KProcess::Stderr))
{ {
delete kompmgr_selection; delete kompmgr_selection;
kompmgr_selection = NULL; kompmgr_selection = NULL;
options->useTranslucency = FALSE; options->useTranslucency = FALSE;
KProcess proc; KProcess proc;
proc << "kdialog" << "--error" proc << "kdialog" << "--error"
<< i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.") << i18n("The Composite Manager could not be started.\\nMake sure you have \"kompmgr\" in a $PATH directory.")
<< "--title" << i18n("Composite Manager Failure"); << "--title" << i18n("Composite Manager Failure");
proc.start(KProcess::DontCare); proc.start(KProcess::DontCare);
} }
else else
{ {
allowKompmgrRestart = FALSE; allowKompmgrRestart = FALSE;
TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) );
} }
}
} }
void Workspace::handleKompmgrOutput( KProcess* , char *buffer, int buflen) void Workspace::handleKompmgrOutput( KProcess* , char *buffer, int buflen)

@ -401,7 +401,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
void resetClientOpacity(); void resetClientOpacity();
void setTransButtonText(int value); void setTransButtonText(int value);
void unblockKompmgrRestart(); void unblockKompmgrRestart();
void restartKompmgr(); void restartKompmgr( KProcess *proc );
void handleKompmgrOutput( KProcess *proc, char *buffer, int buflen); void handleKompmgrOutput( KProcess *proc, char *buffer, int buflen);
void stopKompmgr(); void stopKompmgr();
// end // end

Loading…
Cancel
Save