diff -Nru budgie-extras-0.4.4/debian/changelog budgie-extras-0.4.4/debian/changelog --- budgie-extras-0.4.4/debian/changelog 2018-04-08 16:39:33.000000000 +0100 +++ budgie-extras-0.4.4/debian/changelog 2018-05-16 20:17:16.000000000 +0100 @@ -1,3 +1,11 @@ +budgie-extras (0.4.4-0ubuntu1.1) bionic; urgency=medium + + * Bug-fix release + - Fix budgie panel hang when USB inserted (LP: #1771606) + dropby.patch + + -- David Mohammed Wed, 16 May 2018 20:17:16 +0100 + budgie-extras (0.4.4-0ubuntu1) bionic; urgency=medium * Bug-fix release diff -Nru budgie-extras-0.4.4/debian/patches/dropby.patch budgie-extras-0.4.4/debian/patches/dropby.patch --- budgie-extras-0.4.4/debian/patches/dropby.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-0.4.4/debian/patches/dropby.patch 2018-05-16 20:17:16.000000000 +0100 @@ -0,0 +1,102 @@ +Description: Fix budgie-panel hang when USB inserted + Occasionally popover for dropby sticks in the open + position. +Author: David Mohammed +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1771606 +Origin: upstream commits + 2907237e2ca5a7292de38f67ad12ed7aa1a18ad9 + f24ac719c569df23f7559d5ee5e67a507438ec3d +Last-Update: 2018-05-16 +Reviewed-By: David Mohammed + +--- budgie-extras-0.4.4.orig/budgie-dropby/budgie_dropby.py ++++ budgie-extras-0.4.4/budgie-dropby/budgie_dropby.py +@@ -7,6 +7,7 @@ import os + import dropby_tools as db + import subprocess + import psutil ++from threading import Thread + + + """ +@@ -95,25 +96,31 @@ class BudgieDropByApplet(Budgie.Applet): + self.popover = Budgie.Popover.new(self.box) + # grid to contain all the stuff + self.maingrid = Gtk.Grid() +- # setup bindings ++ # throw it in popover ++ self.popover.add(self.maingrid) ++ self.popover.get_child().show_all() ++ self.box.show_all() ++ self.show_all() ++ self.box.connect("button-press-event", self.on_press) ++ # thread ++ GObject.threads_init() ++ self.update = Thread(target=self.setup_watching) ++ # daemonize the thread to make the indicator stopable ++ self.update.setDaemon(True) ++ self.update.start() ++ self.refresh_from_idle() ++ ++ def setup_watching(self): + self.watchdrives = Gio.VolumeMonitor.get() + self.triggers = [ + "volume_added", "volume_removed", "mount_added", "mount_removed", + ] + for t in self.triggers: +- self.watchdrives.connect(t, self.refresh) ++ self.watchdrives.connect(t, self.refresh_from_idle) + # workaround to only open nautilus on our own action + self.act_onmount = False + # make the applet pop up on the event of a new volume + self.watchdrives.connect("volume_added", self.on_event, self.box) +- # initial situation +- self.refresh() +- # throw it in popover +- self.popover.add(self.maingrid) +- self.popover.get_child().show_all() +- self.box.show_all() +- self.show_all() +- self.box.connect("button-press-event", self.on_press) + + def do_get_settings_ui(self): + """Return the applet settings with given uuid""" +@@ -194,6 +201,12 @@ class BudgieDropByApplet(Budgie.Applet): + ) + self.set_spacers() + ++ def refresh_from_idle(self, subject=None, newvol=None): ++ GObject.idle_add( ++ self.refresh, subject, newvol, ++ priority=GObject.PRIORITY_DEFAULT, ++ ) ++ + def refresh(self, subject=None, newvol=None): + # empty grid + for c in self.maingrid.get_children(): +@@ -247,12 +260,22 @@ class BudgieDropByApplet(Budgie.Applet): + except psutil.NoSuchProcess: + return False + ++ def scrs_active_check(self): ++ return "screensaver is inactive" in subprocess.check_output([ ++ "gnome-screensaver-command", "-q" ++ ]).decode("utf-8") ++ + def on_event(self, box, *args): +- if not self.lockscreen_check(): +- self.manager.show_popover(self.box) ++ if all([ ++ not self.lockscreen_check(), self.scrs_active_check() ++ ]): ++ GObject.idle_add( ++ self.manager.show_popover, self.box, ++ priority=GObject.PRIORITY_DEFAULT, ++ ) + + def on_press(self, box, arg): +- self.refresh() ++ self.refresh_from_idle() + self.manager.show_popover(self.box) + + def do_update_popovers(self, manager): diff -Nru budgie-extras-0.4.4/debian/patches/series budgie-extras-0.4.4/debian/patches/series --- budgie-extras-0.4.4/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-0.4.4/debian/patches/series 2018-05-16 20:17:16.000000000 +0100 @@ -0,0 +1 @@ +dropby.patch