diff --git a/kwin/client.cpp b/kwin/client.cpp index f0239c73..86962233 100644 --- a/kwin/client.cpp +++ b/kwin/client.cpp @@ -601,7 +601,7 @@ void Client::detectNoBorder() noborder = false; break; default: - abort(); + kFatal() << "Something strange happened"; } } diff --git a/kwin/composite.cpp b/kwin/composite.cpp index e0f638ff..29a5400e 100644 --- a/kwin/composite.cpp +++ b/kwin/composite.cpp @@ -997,7 +997,7 @@ bool Client::shouldUnredirect() const if (c->geometry().intersects(geometry())) return false; } - abort(); + kFatal() << "Something strange happened"; } return false; } @@ -1023,7 +1023,7 @@ bool Unmanaged::shouldUnredirect() const if (c->geometry().intersects(geometry())) return false; } - abort(); + kFatal() << "Something strange happened"; } return false; } diff --git a/kwin/effects.cpp b/kwin/effects.cpp index 7428390c..f2db6872 100644 --- a/kwin/effects.cpp +++ b/kwin/effects.cpp @@ -1543,21 +1543,24 @@ const EffectWindowGroup* EffectWindowImpl::group() const { if (Client* c = qobject_cast< Client* >(toplevel)) return c->group()->effectGroup(); - return NULL; // TODO + // TODO + return NULL; } void EffectWindowImpl::refWindow() { if (Deleted* d = qobject_cast< Deleted* >(toplevel)) return d->refWindow(); - abort(); // TODO + // TODO + kFatal() << "Something strange happened"; } void EffectWindowImpl::unrefWindow() { if (Deleted* d = qobject_cast< Deleted* >(toplevel)) return d->unrefWindow(); // delays deletion in case - abort(); // TODO + // TODO + kFatal() << "Something strange happened"; } void EffectWindowImpl::setWindow(Toplevel* w) diff --git a/kwin/effects/presentwindows/presentwindows.cpp b/kwin/effects/presentwindows/presentwindows.cpp index 47108407..a9ebe200 100755 --- a/kwin/effects/presentwindows/presentwindows.cpp +++ b/kwin/effects/presentwindows/presentwindows.cpp @@ -1863,7 +1863,8 @@ EffectWindow* PresentWindowsEffect::relativeWindow(EffectWindow *w, int xdiff, i } } - abort(); // Should never get here + // Should never get here + kFatal() << "Something strange happened"; } EffectWindow* PresentWindowsEffect::findFirstWindow() const diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp index 6465e53f..3a64c786 100644 --- a/kwin/geometry.cpp +++ b/kwin/geometry.cpp @@ -313,7 +313,7 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const case FullArea: return QRect(0, 0, displayWidth(), displayHeight()); } - abort(); + kFatal() << "Something strange happened"; } @@ -650,7 +650,7 @@ QRect Workspace::adjustClientSize(Client* c, QRect moveResizeGeom, int mode) SNAP_BORDER_LEFT break; default: - abort(); + kFatal() << "Something strange happened"; break; } @@ -779,7 +779,7 @@ QRect Workspace::adjustClientSize(Client* c, QRect moveResizeGeom, int mode) SNAP_WINDOW_C_LEFT break; default: - abort(); + kFatal() << "Something strange happened"; break; } } @@ -987,7 +987,7 @@ StrutRect Client::strutRect(StrutArea area) const ), StrutAreaLeft); break; default: - abort(); // Not valid + kFatal() << "Something strange happened"; // Not valid } return StrutRect(); // Null rect } @@ -2836,7 +2836,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) break; case PositionCenter: default: - abort(); + kFatal() << "Something strange happened"; break; } // adjust new size to snap to other windows/borders @@ -2936,7 +2936,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) break; case PositionCenter: default: - abort(); + kFatal() << "Something strange happened"; break; } @@ -3026,8 +3026,9 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) } if (moveResizeGeom.topLeft() != previousMoveResizeGeom.topLeft()) update = true; - } else - abort(); + } else { + kFatal() << "Something strange happened"; + } if (!update) return; diff --git a/kwin/group.cpp b/kwin/group.cpp index 6c025ec0..5a44310e 100644 --- a/kwin/group.cpp +++ b/kwin/group.cpp @@ -153,7 +153,7 @@ static void checkTransiency() if (!performTransiencyCheck()) { kDebug(1212) << "BT:" << transiencyCheckStartBt; kDebug(1212) << "CLIENT:" << transiencyCheckClient; - abort(); + kFatal() << "Something strange happened"; } transiencyCheckNonExistent = false; } diff --git a/kwin/kcmkwin/kwindecoration/kwindecoration.cpp b/kwin/kcmkwin/kwindecoration/kwindecoration.cpp index f28e4458..06c484d8 100644 --- a/kwin/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kwin/kcmkwin/kwindecoration/kwindecoration.cpp @@ -46,6 +46,7 @@ #include #include // KDE +#include #include #include #include @@ -54,7 +55,6 @@ #include #include #include -#include // KCModule plugin interface // ========================= @@ -124,7 +124,7 @@ void KWinDecorationModule::init() "The resource

kwin/kcm_kwindecoration/main.qml

could not be located in any application data path." "

Please contact your distribution

" "The application will now abort", "Installation Error"); - abort(); + kFatal() << "Something strange happened"; } KConfigGroup style(kwinConfig, "Style"); diff --git a/kwin/kcmkwin/kwinoptions/mouse.cpp b/kwin/kcmkwin/kwinoptions/mouse.cpp index 443e392b..526ce61b 100644 --- a/kwin/kcmkwin/kwinoptions/mouse.cpp +++ b/kwin/kcmkwin/kwinoptions/mouse.cpp @@ -273,7 +273,8 @@ static const char* tbl_num_lookup(const char* const arr[], int pos) return arr[ i ]; --pos; } - abort(); // should never happen this way + // should never happen this way + kFatal() << "Something strange happened"; } static int tbl_txt_lookup(const char* const arr[], const char* txt) @@ -291,20 +292,21 @@ static int tbl_txt_lookup(const char* const arr[], const char* txt) void KTitleBarActionsConfig::setComboText(KComboBox* combo, const char*txt) { - if (combo == m_ui->coTiDbl) + if (combo == m_ui->coTiDbl) { combo->setCurrentIndex(tbl_txt_lookup(tbl_TiDbl, txt)); - else if (combo == m_ui->coTiAct1 || combo == m_ui->coTiAct2 || combo == m_ui->coTiAct3) + } else if (combo == m_ui->coTiAct1 || combo == m_ui->coTiAct2 || combo == m_ui->coTiAct3) { combo->setCurrentIndex(tbl_txt_lookup(tbl_TiAc, txt)); - else if (combo == m_ui->coTiInAct1 || combo == m_ui->coTiInAct2 || combo == m_ui->coTiInAct3) + } else if (combo == m_ui->coTiInAct1 || combo == m_ui->coTiInAct2 || combo == m_ui->coTiInAct3) { combo->setCurrentIndex(tbl_txt_lookup(tbl_TiInAc, txt)); - else if (combo == m_ui->coTiAct4) + } else if (combo == m_ui->coTiAct4) { combo->setCurrentIndex(tbl_txt_lookup(tbl_TiWAc, txt)); - else if (combo == m_ui->leftClickMaximizeButton || + } else if (combo == m_ui->leftClickMaximizeButton || combo == m_ui->middleClickMaximizeButton || combo == m_ui->rightClickMaximizeButton) { combo->setCurrentIndex(tbl_txt_lookup(tbl_Max, txt)); - } else - abort(); + } else { + kFatal() << "Something strange happened"; + } } const char* KTitleBarActionsConfig::functionTiDbl(int i) @@ -427,18 +429,19 @@ KWindowActionsConfig::~KWindowActionsConfig() void KWindowActionsConfig::setComboText(KComboBox* combo, const char*txt) { - if (combo == m_ui->coWin1 || combo == m_ui->coWin2 || combo == m_ui->coWin3) + if (combo == m_ui->coWin1 || combo == m_ui->coWin2 || combo == m_ui->coWin3) { combo->setCurrentIndex(tbl_txt_lookup(tbl_Win, txt)); - else if (combo == m_ui->coWinWheel) + } else if (combo == m_ui->coWinWheel) { combo->setCurrentIndex(tbl_txt_lookup(tbl_WinWheel, txt)); - else if (combo == m_ui->coAllKey) + } else if (combo == m_ui->coAllKey) { combo->setCurrentIndex(tbl_txt_lookup(tbl_AllKey, txt)); - else if (combo == m_ui->coAll1 || combo == m_ui->coAll2 || combo == m_ui->coAll3) + } else if (combo == m_ui->coAll1 || combo == m_ui->coAll2 || combo == m_ui->coAll3) { combo->setCurrentIndex(tbl_txt_lookup(tbl_All, txt)); - else if (combo == m_ui->coAllW) + } else if (combo == m_ui->coAllW) { combo->setCurrentIndex(tbl_txt_lookup(tbl_AllW, txt)); - else - abort(); + } else { + kFatal() << "Something strange happened"; + } } const char* KWindowActionsConfig::functionWin(int i) diff --git a/kwin/kcmkwin/kwinscreenedges/monitor.cpp b/kwin/kcmkwin/kwinscreenedges/monitor.cpp index 2c5ed88a..399e30ff 100644 --- a/kwin/kcmkwin/kwinscreenedges/monitor.cpp +++ b/kwin/kcmkwin/kwinscreenedges/monitor.cpp @@ -167,7 +167,7 @@ int Monitor::selectedEdgeItem(int edge) const if (act->isChecked()) return popup_actions[ edge ].indexOf(act); } - abort(); + kFatal() << "Something strange happened"; } void Monitor::popup(Corner* c, QPoint pos) @@ -187,7 +187,7 @@ void Monitor::popup(Corner* c, QPoint pos) return; } } - abort(); + kFatal() << "Something strange happened"; } void Monitor::flip(Corner* c, QPoint pos) @@ -203,7 +203,7 @@ void Monitor::flip(Corner* c, QPoint pos) return; } } - abort(); + kFatal() << "Something strange happened"; } Monitor::Corner::Corner(Monitor* m) diff --git a/kwin/libkwineffects/kwineffects.cpp b/kwin/libkwineffects/kwineffects.cpp index 90c104d0..26cda02b 100644 --- a/kwin/libkwineffects/kwineffects.cpp +++ b/kwin/libkwineffects/kwineffects.cpp @@ -1223,7 +1223,7 @@ bool PaintClipper::Iterator::isDone() if (effects->compositingType() == XRenderCompositing) return data->index == 1; // run once #endif - abort(); + kFatal() << "Something strange happened"; } void PaintClipper::Iterator::next() @@ -1239,7 +1239,7 @@ QRect PaintClipper::Iterator::boundingRect() const if (effects->compositingType() == XRenderCompositing) return paintArea().boundingRect(); #endif - abort(); + kFatal() << "Something strange happened"; return infiniteRegion(); } @@ -1429,8 +1429,11 @@ void WindowMotionManager::apply(EffectWindow *w, WindowPaintData &data) void WindowMotionManager::moveWindow(EffectWindow *w, QPoint target, double scale, double yScale) { QHash::iterator it = m_managedWindows.find(w); - if (it == m_managedWindows.end()) - abort(); // Notify the effect author that they did something wrong + if (it == m_managedWindows.end()) { + // Notify the effect author that they did something wrong + kFatal() << "Something strange happened"; + return; + } WindowMotion *motion = &it.value(); diff --git a/kwin/main.cpp b/kwin/main.cpp index 9cb86da1..814d9099 100644 --- a/kwin/main.cpp +++ b/kwin/main.cpp @@ -265,10 +265,6 @@ bool Application::setup() // initting = false; // TODO - // This tries to detect compositing options and can use GLX. GLX problems - // (X errors) shouldn't cause kwin to abort, so this is out of the - // critical startup section where x errors cause kwin to abort. - // create workspace. (void) new Workspace(isSessionRestored()); diff --git a/kwin/useractions.cpp b/kwin/useractions.cpp index cf2b0b0b..96c57d19 100755 --- a/kwin/useractions.cpp +++ b/kwin/useractions.cpp @@ -193,8 +193,9 @@ void UserActionsMenu::helperDialog(const QString& message, const QWeakPointer