Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tiling-assistant@leleat-on-github/src/extension/moveHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ export default class TilingMoveHandler {

_onMoveFinished(window) {
try {
window.assertExistence();
// Ignore the expected error when the window was destroyed during the grab.
try {
window.assertExistence();
} catch {
return;
}

if (this._tileRect) {
// Ctrl-drag to replace some windows in a tile group / create a new tile group
Expand Down Expand Up @@ -293,6 +298,12 @@ export default class TilingMoveHandler {
this._dragSprite = null;
}
} finally {
// Leaving it pending would re-enter _edgeTilingPreview() on a destroyed window
if (this._latestMonitorLockTimerId) {
GLib.Source.remove(this._latestMonitorLockTimerId);
this._latestMonitorLockTimerId = null;
}

if (this._posChangedId) {
window.disconnect(this._posChangedId);
this._posChangedId = 0;
Expand Down Expand Up @@ -497,7 +508,8 @@ export default class TilingMoveHandler {
// Only update the monitorNr, if the latest timer timed out.
if (timerId === this._latestMonitorLockTimerId) {
this._monitorNr = global.display.get_current_monitor();
if (global.display.is_grabbed())
// check that the window still exists, and a grab is still active
if (global.display.is_grabbed() && window.get_compositor_private())
this._edgeTilingPreview(window, grabOp);
}

Expand Down
Loading