Skip to content

Commit d1f599f

Browse files
committed
mintUpdate.py: Show window as busy immediately upon starting an
update operation. There was a delay between starting an install and blocking the ui to prevent further (undefined) interaction that could allow multiple dialogs to appear. Remove the idle delay from set_window_busy(), so it applies immediately when called, but keep it on an idle callback in finish_install(), which is not on the main thread. Fixes linuxmint/mint22.2-beta#34.
1 parent a5ea6ae commit d1f599f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

usr/lib/linuxmint/mintUpdate/mintUpdate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ def show_window(self, time=Gtk.get_current_event_time()):
730730
self.ui_window.present_with_time(time)
731731
self.hidden = False
732732

733-
@_idle
734733
def set_window_busy(self, busy):
735734
if self.ui_window.get_window() is None:
736735
return
@@ -2533,14 +2532,17 @@ def finish_install(self, refresh_needed):
25332532

25342533
self.uninhibit_pm()
25352534
self.cache_monitor.resume(False)
2536-
self.set_window_busy(False)
2535+
2536+
GLib.idle_add(self.set_window_busy, False)
25372537
if refresh_needed:
25382538
self.refresh(False)
25392539

25402540
def install(self, widget):
25412541
if self.dpkg_locked():
25422542
self.show_dpkg_lock_msg(self.ui_window)
25432543
else:
2544+
self.set_window_busy(True)
2545+
25442546
# Find list of packages to install
25452547
install_needed = False
25462548
self.packages = []
@@ -2589,7 +2591,6 @@ def install(self, widget):
25892591
iter = model.iter_next(iter)
25902592
self.settings.set_int("install-last-run", int(time.time()))
25912593
if install_needed:
2592-
self.set_window_busy(True)
25932594
self.cache_monitor.pause()
25942595
self.inhibit_pm("Installing updates")
25952596
self.logger.write("Install requested by user")

0 commit comments

Comments
 (0)