Skip to content

Commit

Permalink
Fix the wayland crash (#166)
Browse files Browse the repository at this point in the history
* Change connection from windowDeleted to windowClosed
* Add check when a windows size is zero
  • Loading branch information
matinlotfali authored Feb 6, 2024
1 parent 81de516 commit f0c3d0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ShapeCornersEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ShapeCornersEffect::ShapeCornersEffect()
for (const auto& win: KWin::effects->stackingOrder())
windowAdded(win);
connect(KWin::effects, &KWin::EffectsHandler::windowAdded, this, &ShapeCornersEffect::windowAdded);
connect(KWin::effects, &KWin::EffectsHandler::windowDeleted, this, &ShapeCornersEffect::windowRemoved);
connect(KWin::effects, &KWin::EffectsHandler::windowClosed, this, &ShapeCornersEffect::windowRemoved);
#if QT_VERSION_MAJOR < 6
connect(KWin::effects, &KWin::EffectsHandler::windowFrameGeometryChanged, this, &ShapeCornersEffect::windowResized);
#endif
Expand Down Expand Up @@ -207,9 +207,11 @@ bool ShapeCornersEffect::checkTiled(const bool& horizontal, double window_start,
}

if (DIM(w->x(), w->y()) == window_start) {
if (checkTiled(horizontal, window_start + DIM(w->width(), w->height()) + gap, screen_size, gap)) {
tiled = true; // Mark every tile as you go back to the first.
r = true;
if (DIM(w->width(), w->height()) + gap > 0) {
if (checkTiled(horizontal, window_start + DIM(w->width(), w->height()) + gap, screen_size, gap)) {
tiled = true; // Mark every tile as you go back to the first.
r = true;
}
}
}

Expand Down

0 comments on commit f0c3d0c

Please sign in to comment.