forked from quickshell/quickshell
core: replace throws with qFatal
This commit is contained in:
parent
055b191a67
commit
9625129844
|
@ -64,7 +64,8 @@ LockWindowExtension* LockWindowExtension::get(QWindow* window) {
|
|||
}
|
||||
|
||||
bool LockWindowExtension::attach(QWindow* window, SessionLockManager* manager) {
|
||||
if (this->surface != nullptr) throw "Cannot change the attached window of a LockWindowExtension";
|
||||
if (this->surface != nullptr)
|
||||
qFatal() << "Cannot change the attached window of a LockWindowExtension";
|
||||
|
||||
auto* current = LockWindowExtension::get(window);
|
||||
QtWaylandClient::QWaylandWindow* waylandWindow = nullptr;
|
||||
|
|
|
@ -13,7 +13,6 @@ QSWaylandSessionLockIntegration::createShellSurface(QtWaylandClient::QWaylandWin
|
|||
if (lock == nullptr || lock->surface == nullptr || !lock->surface->isExposed()) {
|
||||
qFatal() << "Visibility canary failed. A window with a LockWindowExtension MUST be set to "
|
||||
"visible via LockWindowExtension::setVisible";
|
||||
throw nullptr;
|
||||
}
|
||||
|
||||
return lock->surface;
|
||||
|
|
|
@ -19,12 +19,10 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
|
|||
|
||||
if (this->ext == nullptr) {
|
||||
qFatal() << "QSWaylandSessionLockSurface created with null LockWindowExtension";
|
||||
throw nullptr;
|
||||
}
|
||||
|
||||
if (this->ext->lock == nullptr) {
|
||||
qFatal() << "QSWaylandSessionLock for QSWaylandSessionLockSurface died";
|
||||
throw nullptr;
|
||||
}
|
||||
|
||||
wl_output* output = nullptr; // NOLINT (include)
|
||||
|
@ -34,7 +32,6 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
|
|||
output = waylandScreen->output();
|
||||
} else {
|
||||
qFatal() << "Session lock screen does not corrospond to a real screen. Force closing window";
|
||||
throw nullptr;
|
||||
}
|
||||
|
||||
this->init(this->ext->lock->get_lock_surface(window->waylandSurface()->object(), output));
|
||||
|
|
|
@ -34,7 +34,7 @@ QSWaylandLayerSurface::QSWaylandLayerSurface(
|
|||
this->ext = LayershellWindowExtension::get(qwindow);
|
||||
|
||||
if (this->ext == nullptr) {
|
||||
throw "QSWaylandLayerSurface created with null LayershellWindowExtension";
|
||||
qFatal() << "QSWaylandLayerSurface created with null LayershellWindowExtension";
|
||||
}
|
||||
|
||||
wl_output* output = nullptr; // NOLINT (include)
|
||||
|
|
|
@ -25,7 +25,7 @@ LayershellWindowExtension* LayershellWindowExtension::get(QWindow* window) {
|
|||
|
||||
bool LayershellWindowExtension::attach(QWindow* window) {
|
||||
if (this->surface != nullptr)
|
||||
throw "Cannot change the attached window of a LayershellWindowExtension";
|
||||
qFatal() << "Cannot change the attached window of a LayershellWindowExtension";
|
||||
|
||||
auto* current = LayershellWindowExtension::get(window);
|
||||
|
||||
|
|
Loading…
Reference in a new issue