Skip to content

Commit d3958d5

Browse files
Fix large images being only partially copied when copying on close
1 parent c0475a6 commit d3958d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gradia/ui/window.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ def _finalize_close(self, copy: bool) -> None:
229229
self._on_close_finished()
230230

231231
def _on_close_finished(self) -> None:
232-
self.destroy()
232+
def delayed_destroy():
233+
self.destroy()
234+
return False
235+
self.hide()
236+
GLib.timeout_add(1000, delayed_destroy) # Large images need the extra milliseconds to be fully copied.
233237

234238
def _on_confirm_close_ok(self) -> None:
235239
self._finalize_close(copy=False)

0 commit comments

Comments
 (0)