Hello community,

here is the log from the commit of package mate-applet-dock for 
openSUSE:Factory checked in at 2016-08-31 00:10:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mate-applet-dock (Old)
 and      /work/SRC/openSUSE:Factory/.mate-applet-dock.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mate-applet-dock"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mate-applet-dock/mate-applet-dock.changes        
2016-07-27 16:12:30.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.mate-applet-dock.new/mate-applet-dock.changes   
2016-08-31 00:11:44.000000000 +0200
@@ -1,0 +2,25 @@
+Sun Aug 28 12:34:58 UTC 2016 - [email protected]
+
+- Update to version 0.74:
+  * Correct position of window lists on non-expanded panels.
+  * Fix for window list flickering on bottom aligned panels on MATE
+    built with Gtk3.
+  * Increase the delay before window lists are shown when the mouse
+    hovers over an application icon. It was 0.5 seconds, and is now
+    1 second.
+  * Shortened pin/unpin window list text. It now says
+    'Pin <application name>' rather than
+    'Pin <application name> to the dock', and the Unpin text is
+    similarly shortened.
+  * Fix a bug that would cause Pin/Unpin actions to act upon
+    previously highlighted application icons, rather than the one
+    that is currently highlighted.
+  * When starting to drag an application icon, the window list is
+    now hidden.
+  * The applet can now display progress bars and counts on
+    application icons for applications which support this e.g. the
+    Ubuntu software updater.
+  * Fix for improved matching of binary packaged applications on
+    Gentoo.
+
+-------------------------------------------------------------------

Old:
----
  mate-dock-applet-0.73.tar.gz

New:
----
  mate-dock-applet-0.74.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mate-applet-dock.spec ++++++
--- /var/tmp/diff_new_pack.ownylg/_old  2016-08-31 00:11:47.000000000 +0200
+++ /var/tmp/diff_new_pack.ownylg/_new  2016-08-31 00:11:47.000000000 +0200
@@ -18,7 +18,7 @@
 
 %define _name   mate-dock-applet
 Name:           mate-applet-dock
-Version:        0.73
+Version:        0.74
 Release:        0
 Summary:        Dock applet for the MATE panel
 License:        GPL-2.0+
@@ -34,8 +34,8 @@
 Requires:       python3-cairo
 Requires:       python3-gobject
 Requires:       python3-gobject-cairo
-Requires:       python3-scipy
 Requires:       python3-xdg
+Recommends:     libunity
 %glib2_gsettings_schema_requires
 %if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
 Requires:       python3-gobject-Gdk
@@ -75,7 +75,8 @@
 
 find %{buildroot}%{_libdir}/ -type f -name '*.py' | while read py; do
     # Create Python bytecode.
-    rm -f *.pyc *.pyo __pycache__/
+    rm -rf *.pyc *.pyo __pycache__/
+    touch -c *.py
     %py3_compile .
     if [[ "$(head -c2 "$py"; echo)" == "#!" ]]; then
         chmod a+x "$py"

++++++ mate-dock-applet-0.73.tar.gz -> mate-dock-applet-0.74.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/ChangeLog 
new/mate-dock-applet-0.74/ChangeLog
--- old/mate-dock-applet-0.73/ChangeLog 2016-07-20 09:17:33.000000000 +0200
+++ new/mate-dock-applet-0.74/ChangeLog 2016-08-24 09:18:29.000000000 +0200
@@ -1,3 +1,21 @@
+V0.74  Fix for improved matching of binary packaged apps on Gentoo .
+    Amended README.me to include the availability of an overlay for the applet
+    on Gentoo.
+    Corrected position of window lists on non-expanded panels.
+    Fix for window list flickering on bottom aligned panels on MATE Gtk3
+    Increased the delay before window lists are shown when the mouse hovers 
over an
+    app icon. It was 0.5 seconds, and is now 1 second.
+    Shortened pin/unpin window list text. It now says 'Pin <app name>' rather 
than
+    'Pin <app name> to the dock', and the Unpin text is similarly shortened.
+    Fixed a bug that would cause Pin/Unpin actions to act upon previously 
highlighted app
+    icons, rather than the one that is currently highlighted.
+    When starting to drag an app icon, the window list is now hidden.
+    The applet can now display progress bars and counts on app icons for apps 
which
+    support this e.g. the Ubuntu software updater.
+
+V0.73   Added drag and drop rearranging ing of dock icons (Gtk3 only). Window 
list
+        reworked and prettified.
+
 V0.72   The applet now works on and can be built for both GTK2 and GTK3 
versions of MATE.
     Aside from the changes to layout containers (i.e. GTK2 VBox & HBoxes 
become GTK3
     Boxes/Grids), underlying differences between the two toolkits meant that 
the code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/README.md 
new/mate-dock-applet-0.74/README.md
--- old/mate-dock-applet-0.73/README.md 2016-07-20 09:17:33.000000000 +0200
+++ new/mate-dock-applet-0.74/README.md 2016-08-24 09:18:29.000000000 +0200
@@ -37,6 +37,10 @@
 
 For Arch users there's a 
[package](http://aur.archlinux.org/packages/mate-applet-dock-git) available in 
the AUR.
 
+### Gentoo based distributions
+
+An ebuild is available via the 
[mate-de-gentoo](https://github.com/oz123/mate-de-gentoo)
+
 ### Other distributions
 
 Users of other distros will need to install from source, so first install the 
required dependencies:
@@ -45,7 +49,6 @@
 * gir1.2-wnck-1.0
 * libglib2-dev
 * Python Imaging Library
-* SciPy
 * Python 3 Cairo bindings
 
 then cd to the directory containing all of the development files and run:
@@ -81,9 +84,16 @@
 
 From this point the instructions above for compiling from source should be 
followed.
 
+### Note for Compiz Users
+
+In order for window minimizing and maximizing to work correctly under Compiz, 
the Focus Prevention Level setting must be set to off in CompizConfig Settings 
Manager (General Options, Focus and Raise Behaviour)
 
 ### Obligatory screen shots
 
+GTK3 version of the applet running on Ubuntu MATE 16.10 Alpha 1
+
+![GTK3 Ubunbtu Mate](https://github.com/robint99/screenshots/raw/master/16.10 
win-list.png)
+
 Running on Arch with a Unity style layout
 
 ![Arch 
screenshot](https://github.com/robint99/screenshots/raw/master/arch_V0.6_ss.png)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/configure.ac 
new/mate-dock-applet-0.74/configure.ac
--- old/mate-dock-applet-0.73/configure.ac      2016-07-20 09:17:33.000000000 
+0200
+++ new/mate-dock-applet-0.74/configure.ac      2016-08-24 09:18:29.000000000 
+0200
@@ -1,4 +1,4 @@
-AC_INIT([Dock Applet], [0.73])
+AC_INIT([Dock Applet], [0.74])
 
 AM_INIT_AUTOMAKE
 AM_PATH_PYTHON([3.0])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/src/dock.in 
new/mate-dock-applet-0.74/src/dock.in
--- old/mate-dock-applet-0.73/src/dock.in       2016-07-20 09:17:33.000000000 
+0200
+++ new/mate-dock-applet-0.74/src/dock.in       2016-08-24 09:18:29.000000000 
+0200
@@ -8,6 +8,8 @@
 Respond to window opening and closing events from libwnck
 Respond to changes to the Gtk icon theme and update all docked apps
 Load and save dock settings (e.g. pinned apps and indicator type)
+Respond to Unity API DBus messages so that apps can display counts and
+progress meters on their icons
 
 respond to selections made in the applet right click menu, specifically
     : allow apps to be pinned to the dock
@@ -65,6 +67,8 @@
 import os.path
 import sys
 from time import sleep
+import dbus
+from dbus.mainloop.glib import DBusGMainLoop
 
 import docked_app
 import dock_prefs
@@ -335,7 +339,7 @@
 
         self.app_win_list = dock_win_list.DockWinList(self.wnck_screen)
         self.app_win_list.icontheme = self.icontheme
-        self.win_list_delay = 500
+        self.win_list_delay = 1000
         self.win_list_timer = None
 
         self.panel_x = 0
@@ -356,10 +360,31 @@
 
         self.panel_cc = dock_color_changer.PanelColorChanger()
 
+        # we need to monitor the Unity dbus interface
+        DBusGMainLoop(set_as_default=True)
+        self.session_bus = dbus.SessionBus()
+
+        # claim the Unity bus (Unity won't be using it...) so that clients know
+        # to start using it
+        self.session_bus.request_name("com.canonical.Unity",
+                                      dbus.bus.NAME_FLAG_ALLOW_REPLACEMENT)
+
+        # add a handler to listen in Unity dbus messages
+        self.session_bus.add_signal_receiver(self.unity_cb_handler,
+                        dbus_interface = "com.canonical.Unity.LauncherEntry",
+                        signal_name="Update")
+
         # instantiate a timer to perform further setup once the applet has been
         # fully created
         GObject.timeout_add(1000, self.do_delayed_setup)
 
+    def __del__(self):
+        """ Clean up ...
+        """
+
+        # release the unity bus
+        self.session_bus.release_name("com.canonical.Unity")
+
     def do_delayed_setup(self):
         """ Perform setup operations that we couldn't do until the dock was
             fully instantiated
@@ -805,9 +830,9 @@
             move_right_action.set_label("Move %s to the right on the dock" % 
app.app_name)
 
         if pin_action.is_visible():
-            pin_action.set_label("Pin %s to the dock" % app.app_name)
+            pin_action.set_label("Pin %s" % app.app_name)
         else:
-            unpin_action.set_label("Unpin %s from the dock" % app.app_name)
+            unpin_action.set_label("Unpin %s" % app.app_name)
 
         # set the actions for selecting specific windows
 
@@ -900,39 +925,63 @@
         """Perform the app's 1st .desktop file specified shortcut/action
         """
 
-        if self.right_clicked_app is not None:
-            self.right_clicked_app.run_rc_action(1)
+        # get the app in question
+        if self.app_win_list is None:
+            return # shouldn't ever happen...
+        the_app = self.app_win_list.the_app
+
+        if the_app is not None:
+            the_app.run_rc_action(1)
 
     def df_shortcut_2(self, data=None):
         """Perform the app's 1st .desktop file specified shortcut/action
         """
 
-        if self.right_clicked_app is not None:
-            self.right_clicked_app.run_rc_action(2)
+        # get the app we need in question
+        if self.app_win_list is None:
+            return  # shouldn't ever happen...
+        the_app = self.app_win_list.the_app
+
+        if the_app is not None:
+            the_app.run_rc_action(2)
 
     def df_shortcut_3(self, data=None):
         """Perform the app's 1st .desktop file specified shortcut/action
         """
+        # get the app in question
+        if self.app_win_list is None:
+            return  # shouldn't ever happen...
+        the_app = self.app_win_list.the_app
 
-        if self.right_clicked_app is not None:
-            self.right_clicked_app.run_rc_action(3)
+        if the_app is not None:
+            the_app.run_rc_action(3)
 
     def df_shortcut_4(self, data=None):
         """Perform the app's 1st .desktop file specified shortcut/action
+
+        The app is specfied from the winwdow list
         """
+        # get the app win quesion
+        if self.app_win_list is None:
+            return  # shouldn't ever happen.
+        the_app = self.app_win_list.the_app
 
-        if self.right_clicked_app is not None:
-            self.right_clicked_app.run_rc_action(4)
+        if the_app is not None:
+            the_app.run_rc_action(4)
 
     def unpin_app(self, data=None):
         """Unpin an app from the dock
 
+        This action is performed from the window list
         Unpin the app and update the dock settings.
 
         If the app is not running, remove it from the dock also
         """
 
-        the_app = self.right_clicked_app
+        # get the app we need to unpin
+        if self.app_win_list is None:
+            return # shouldn't ever happen...
+        the_app = self.app_win_list.the_app
 
         if the_app is not None:
             the_app.is_pinned = False
@@ -946,7 +995,11 @@
 
         Pin the app and update the dock settings"""
 
-        the_app = self.right_clicked_app
+        # get the app we need to pin
+        if self.app_win_list is None:
+            return  # shouldn't ever happen...
+
+        the_app = self.app_win_list.the_app
         if the_app is not None:
             the_app.is_pinned = True
             self.write_settings()
@@ -1075,16 +1128,18 @@
             two integers, the x and y coordinates
         """
 
+        dock_x, dock_y = self.get_dock_root_coords()
+
         if (self.panel_orient == "top") or (self.panel_orient == "bottom"):
-            min_x = self.applet_pos + 1 + \
+            min_x = dock_x + \
                     (self.get_app_position_in_dock(app) * 
app.drawing_area_size)
             if build_gtk2:
                 min_x += self.get_app_position_in_dock(app)
 
-            min_y = self.panel_y + 1
+            min_y = dock_y
         else:
-            min_x = self.panel_x + 1
-            min_y = self.applet_pos + 1 + \
+            min_x = dock_x
+            min_y = dock_y + \
                     (self.get_app_position_in_dock(app) * 
app.drawing_area_size)
             if build_gtk2:
                 min_y += self.get_app_position_in_dock(app)
@@ -1098,12 +1153,17 @@
             two integers, the x and y coordinates
         """
 
-        if (self.panel_orient == "top") or (self.panel_orient == "bottom"):
-            dock_x = self.applet_pos + 1
-            dock_y = self.panel_y + 1
+        # get root coord from the applet window rather from panel settings...
+        win = self.applet.props.window
+        # check validity of win - can be None during applet creation...
+        if win is None:
+            return 0, 0
+
+        if build_gtk2:
+            # win.get_origin doesn't work on gtk2, so...
+            dock_x, dock_y = win.get_root_coords(0, 0)
         else:
-            dock_x = self.panel_x + 1
-            dock_y = self.applet_pos + 1
+            thing, dock_x, dock_y = win.get_origin()
 
         return dock_x, dock_y
 
@@ -1838,7 +1898,33 @@
         """
 
         self.app_list.remove(app)
-        self.box.remove(app.drawing_area)
+        num_apps = len(self.box.get_children())
+
+        if build_gtk2:
+            self.box.remove(app.drawing_area)
+        else:
+            # the row/column which contains the app needs to be
+            # removed, so get the app's position in the grid
+            pos = 0
+            while pos < num_apps:
+                if self.box.orientation == Gtk.Orientation.VERTICAL:
+                    left = 0
+                    top = pos
+                else:
+                    left = pos
+                    top = 0
+
+                if self.box.get_child_at(left, top) == app.drawing_area:
+                    # we've found the app
+                    if self.box.orientation == Gtk.Orientation.VERTICAL:
+                        self.box.remove_row(pos)
+                    else:
+                        self.box.remove_column(pos)
+
+                    app = None
+                    return
+
+                pos += 1
 
         app = None
 
@@ -2152,8 +2238,8 @@
         """ Show the the list of open windows and actions for the currently
             highlighted app
 
-        Get the currently highlighted app. If the highlighted app is not
-        running or a window list is already being displayed for it, or a user
+        Get the currently highlighted app. If the highlighted app is being
+        launched or a window list is already being displayed for it, or a user
         interaction has already dismissed the window list, then do nothing
 
         Otherwise, fill the window list, set the window position and set the
@@ -2169,97 +2255,97 @@
         if (highlighted_app is None):
             return
 
-        if highlighted_app is not None:
-
-            self.set_actions_for_app(self.app_with_mouse)
-
-            # first of all, add any shortcut actions specifedd in the app's
-            # .desktop file
+        # is the app being launched?
+        if highlighted_app.is_pulsing:
+            self.win_list_timer = None
+            return False
 
-            df_shortcut_1_action = 
self.dock_action_group.get_action("df_shortcut_1_action")
-            df_shortcut_2_action = 
self.dock_action_group.get_action("df_shortcut_2_action")
-            df_shortcut_3_action = 
self.dock_action_group.get_action("df_shortcut_3_action")
-            df_shortcut_4_action = 
self.dock_action_group.get_action("df_shortcut_4_action")
-            pin_action = self.dock_action_group.get_action("pin_action")
-            unpin_action = self.dock_action_group.get_action("unpin_action")
+        # always recreate the window list e.g. to account for windows being
+        # opened/closed, the app being pinned/unpinned etc.
 
-                # recreate the window every time
-            if self.app_win_list is not None:
-                self.app_win_list.destroy()
+        if self.app_win_list is not None:
+            self.app_win_list.destroy()
 
-            self.app_win_list  = dock_win_list.DockWinList(self.wnck_screen)
-            self.app_win_list.icontheme = self.icontheme
+        self.set_actions_for_app(self.app_with_mouse)
 
-            # set the background colour of the window list to the
-            # colour of the panel
-            pr, pg, pb = self.get_applet_panel_rgb()
-            self.app_win_list.set_bg_col(pr, pg, pb)
+        # first of all, add any shortcut actions specified in the app's
+        # .desktop file
 
-            self.app_win_list.the_app = highlighted_app
+        df_shortcut_1_action = 
self.dock_action_group.get_action("df_shortcut_1_action")
+        df_shortcut_2_action = 
self.dock_action_group.get_action("df_shortcut_2_action")
+        df_shortcut_3_action = 
self.dock_action_group.get_action("df_shortcut_3_action")
+        df_shortcut_4_action = 
self.dock_action_group.get_action("df_shortcut_4_action")
+        pin_action = self.dock_action_group.get_action("pin_action")
+        unpin_action = self.dock_action_group.get_action("unpin_action")
 
+        self.app_win_list  = dock_win_list.DockWinList(self.wnck_screen)
+        self.app_win_list.icontheme = self.icontheme
 
-            if df_shortcut_1_action.is_visible():
+        # set the background colour of the window list to the
+        # colour of the panel : Note: not properly implemented yet
+        pr, pg, pb = self.get_applet_panel_rgb()
+        self.app_win_list.set_bg_col(pr, pg, pb)
+
+        self.app_win_list.the_app = highlighted_app
+
+        if df_shortcut_1_action.is_visible():
+            self.app_win_list.add_to_list(False,
+                                          df_shortcut_1_action.get_label(),
+                                          None, df_shortcut_1_action,
+                                          True)
+            if df_shortcut_2_action.is_visible():
                 self.app_win_list.add_to_list(False,
-                                              df_shortcut_1_action.get_label(),
-                                              None, df_shortcut_1_action,
+                                              df_shortcut_2_action.get_label(),
+                                              None,
+                                              df_shortcut_2_action,
                                               True)
-                if df_shortcut_2_action.is_visible():
-                    self.app_win_list.add_to_list(False,
-                                                  
df_shortcut_2_action.get_label(),
-                                                  None,
-                                                  df_shortcut_2_action,
-                                                  True)
-                if df_shortcut_3_action.is_visible():
-                    self.app_win_list.add_to_list(False,
-                                                  
df_shortcut_3_action.get_label(),
-                                                  None,
-                                                  df_shortcut_3_action,
-                                                  True)
-                if df_shortcut_4_action.is_visible():
-                    self.app_win_list.add_to_list(False,
-                                                  
df_shortcut_4_action.get_label(),
-                                                  None,
-                                                  df_shortcut_4_action,
-                                                  True)
-                self.app_win_list.add_separator()
-
-            # add any open windows
-            if highlighted_app.is_running():
-                self.app_win_list.setup_list(self.win_from_cur_ws_only)
-                self.app_win_list.add_separator()
-
-            if pin_action.is_visible():
-                self.app_win_list.add_to_list(False, pin_action.get_label(),
-                                              None, pin_action, False)
-            else:
-                self.app_win_list.add_to_list(False, unpin_action.get_label(),
-                                              None, unpin_action, False)
+            if df_shortcut_3_action.is_visible():
+                self.app_win_list.add_to_list(False,
+                                              df_shortcut_3_action.get_label(),
+                                              None,
+                                              df_shortcut_3_action,
+                                              True)
+            if df_shortcut_4_action.is_visible():
+                self.app_win_list.add_to_list(False,
+                                              df_shortcut_4_action.get_label(),
+                                              None,
+                                              df_shortcut_4_action,
+                                              True)
+            self.app_win_list.add_separator()
 
-            self.app_win_list.clear_mouse_areas()
+        # add any open windows
+        if highlighted_app.is_running():
+            self.app_win_list.setup_list(self.win_from_cur_ws_only)
+            self.app_win_list.add_separator()
 
-            applet_x, applet_y = self.get_dock_root_coords()
-            applet_w = applet_h = highlighted_app.drawing_area_size
+        if pin_action.is_visible():
+            self.app_win_list.add_to_list(False, pin_action.get_label(),
+                                          None, pin_action, False)
+        else:
+            self.app_win_list.add_to_list(False, unpin_action.get_label(),
+                                          None, unpin_action, False)
 
-            self.app_win_list.set_applet_details(applet_x, applet_y,
-                                                 applet_w, applet_h)
-            self.app_win_list.set_panel_orient(self.applet.get_orient())
-            app_x, app_y = self.get_app_root_coords(highlighted_app)
-            self.app_win_list.set_app_root_coords(app_x, app_y)
+        self.app_win_list.clear_mouse_areas()
 
-            self.app_win_list.show_all()
+        applet_x, applet_y = self.get_dock_root_coords()
+        applet_w = applet_h = highlighted_app.drawing_area_size
 
-            self.win_list_timer = None
-            return False
+        self.app_win_list.set_applet_details(applet_x, applet_y,
+                                             applet_w, applet_h)
+        self.app_win_list.set_panel_orient(self.applet.get_orient())
+        app_x, app_y = self.get_app_root_coords(highlighted_app)
+        self.app_win_list.set_app_root_coords(app_x, app_y)
+
+        self.app_win_list.show_all()
+
+        self.win_list_timer = None
+        return False
 
     def hide_win_list(self):
         """ Hide the window list """
 
         if self.app_win_list is not None:
-            if build_gtk2:
-                self.app_win_list.hide()
-            else:
-                self.app_win_list.destroy()
-                self.app_win_list = None
+            self.app_win_list.hide()
 
     def minimize_or_restore_windows(self, app, event):
         """ Minimize or restore an app's windows in response to a left click of
@@ -2500,6 +2586,38 @@
 
         return self.get_app_at_mouse(x, y)
 
+    def unity_cb_handler(self, app_uri, args):
+        """ Handler for Unity API dbus messages
+
+        If the specified app is in the dock, forward the set the progress
+        and/or count, and redraw the app's icon
+
+        Args:
+            app_uri : the basename of the .desktop file of the app
+            args : the contents of the dbus message
+
+        """
+
+        # remove the leading part of the app uri
+        df = app_uri.split("://")[1]
+
+        # search for the an app which has the same desktop file name
+        for app in self.app_list:
+            app_df_path, app_df = os.path.split(app.desktop_file)
+            if app_df == df:
+                # we've found the app - update it...
+
+                if "count-visible" in args:
+                    app.set_counter_visible(args["count-visible"])
+                if "count" in args:
+                    app.set_counter_value(args["count"])
+
+                if "progress-visible" in args:
+                    app.set_progress_visible(args["progress-visible"])
+                if "progress" in args:
+                    app.set_progress_value(args["progress"])
+                break
+
 
 def win_activation_timer(args):
     """ Timer function to be called by GObject.timeout_add and which
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/src/dock_applet.in 
new/mate-dock-applet-0.74/src/dock_applet.in
--- old/mate-dock-applet-0.73/src/dock_applet.in        2016-07-20 
09:17:33.000000000 +0200
+++ new/mate-dock-applet-0.74/src/dock_applet.in        2016-08-24 
09:18:29.000000000 +0200
@@ -180,14 +180,12 @@
     if app is not None:
         app.has_mouse = True
         app.queue_draw()
+
         the_dock.app_with_mouse = app
 
         # set up the available options for the app
         the_dock.set_actions_for_app(app)
 
-        the_dock.reset_win_list_timer()
-
-
 def applet_leave_notify(widget, event, the_dock):
     """Leave notifiy event handle for the applet
 
@@ -204,7 +202,7 @@
         the_dock.app_with_mouse.queue_draw()
         the_dock.app_with_mouse = None
 
-    the_dock.stop_win_list_timer()
+        the_dock.stop_win_list_timer()
 
 
 def applet_motion_notify(widget, event, the_dock):
@@ -325,6 +323,10 @@
 
         the_dock.start_drag_motion_timer(the_dock.app_with_mouse)
 
+        # finally, hide the window list if it was being shown
+        the_dock.hide_win_list()
+
+
 def applet_drag_data_get(widget, drag_context, data, info, time):
     """
         Handler the for drag-data-get event
@@ -374,7 +376,6 @@
         app.set_dragee(False)
         app.queue_draw()
 
-
 def applet_fill(applet):
     """
     Create the applet
@@ -470,6 +471,3 @@
 
 if __name__ == "__main__":
     main()
-
-#timer object to check the mouse x and y as a substitute for drag-motion
-#need to convert root coords to applet window coords - use applet 
window.get_origin to get its root coords
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/src/dock_win_list.in 
new/mate-dock-applet-0.74/src/dock_win_list.in
--- old/mate-dock-applet-0.73/src/dock_win_list.in      2016-07-20 
09:17:33.000000000 +0200
+++ new/mate-dock-applet-0.74/src/dock_win_list.in      2016-08-24 
09:18:29.000000000 +0200
@@ -440,6 +440,8 @@
             if len(self.__list_store) == 0:
                 self.set_win_position()
 
+        self.start_mouse_area_timer()
+
     def set_win_position(self):
         """
             Move the window so that it appears near the panel and centrered on
@@ -579,11 +581,23 @@
 
         self.move(win_x, win_y)
 
-        if self.__timer_id is not None:
-            GObject.source_remove(self.__timer_id)
+    def start_mouse_area_timer(self):
+        """ Start the timer that that monitors the mouse position
+        """
+
+        # remove any old timer...
+        self.stop_mouse_area_timer()
 
         self.__timer_id = GObject.timeout_add(CONST_TIMER_DELAY, self.do_timer)
 
+    def stop_mouse_area_timer(self):
+        """ Stop the timer that monitors the mouse position
+        """
+        #
+        if self.__timer_id is not None:
+            GObject.source_remove(self.__timer_id)
+            self.__timer_id = None
+
     def win_configure(self, widget, event):
         """ Event handler for the window's configure event
 
@@ -611,7 +625,9 @@
 
             self.set_win_position()
 
-    # TODO: investigate reason for shape_combine_region not working
+    # TODO: keep checking status of this bug:
+    # https://bugzilla.gnome.org/show_bug.cgi?id=667959
+    # and when a fix is available shape_combine_region for rounded windows...
     #def size_allocate(self, widget, allocation):
     #    def rounded_rectangle(cr, x, y, w, h, r=20):
     #        # Attribution:
@@ -809,9 +825,7 @@
 
         """
 
-        if self.__timer_id is not None:
-            GObject.source_remove(self.__timer_id)
-            self.__timer_id = None
+        self.stop_mouse_area_timer()
 
     def query_tooltip(self, widget, x, y, keyboard_mode, tooltip):
         """ Handler for the query-tooltip event to determine whether or not
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/src/docked_app.in 
new/mate-dock-applet-0.74/src/docked_app.in
--- old/mate-dock-applet-0.73/src/docked_app.in 2016-07-20 09:17:33.000000000 
+0200
+++ new/mate-dock-applet-0.74/src/docked_app.in 2016-08-24 09:18:29.000000000 
+0200
@@ -71,6 +71,7 @@
 import os
 import os.path
 import subprocess
+import re
 
 from collections import namedtuple
 
@@ -333,6 +334,13 @@
 
         is_dragee  : boolean - indicates whether or not the app's icon is
                      being dragged to a new position on the dock
+
+        show_progress : boolean - indicates whether or not to display a
+                        progress indicator on the app's icon
+        progress_val  : the progress value( 0 to 1.0)
+        show_count   : boolean - indicates whether or not to display a
+                        count value on the app's icon
+        count_val   : the value of the count
     """
 
     def __init__(self):
@@ -396,6 +404,11 @@
 
         self.is_dragee = False
 
+        self.show_progress = False
+        self.progress_val = 0.0
+        self.show_count = False
+        self.count_val = 0
+
     def has_wnck_app(self, wnck_app):
         """ see if this app has a process with the specified wnck_app
 
@@ -629,7 +642,6 @@
             True if the desktop file was found, False otherwise
 
         """
-
         for the_dir, dir_list, file_list in os.walk(srch_dir):
 
             dfname = the_dir + self.wm_class_name + ".desktop"
@@ -735,9 +747,15 @@
                     # .desktop
                     de_exec = the_de.getExec()
                     exec_found = False
-                    if (de_exec is not None) and (de_exec != ""):
-                        de_exec = de_exec.split()
 
+                    if de_exec:
+                        # if the exec line specfies an environment variable to
+                        # set, we need to get rid of this part
+                        if de_exec.startswith("env"):
+                            cmd_parts = de_exec.split(" ", 2)
+                            de_exec = cmd_parts[2]
+
+                        de_exec = de_exec.split()
                         # now that we have the app command line we can simply
                         # check that it ends with the same command as the
                         # .desktop file contains. So...
@@ -763,6 +781,14 @@
 
                                 if exec_found:
                                     break
+                        # try matching just the last part, removing -bin from 
the name
+                        if not exec_found:
+                            de_exec = de_exec[0]
+                            de_exec = re.sub("-bin", "", de_exec)
+
+                            if "/" in de_exec:
+                                if de_exec.split("/")[-1] in self.cmd_line:
+                                    exec_found = True
 
                     # check that the wm_classes match
                     wm_class_found = False
@@ -1176,6 +1202,13 @@
                 this_ind += 1
                 ctx.fill()
 
+        # do we need a count?
+        if self.show_count:
+            self.draw_count(ctx)
+
+        if self.show_progress:
+            self.draw_progress(ctx)
+
         # now draw to the screen
         if build_gtk2:
             screen_ctx = self.drawing_area.window.cairo_create()
@@ -1199,6 +1232,174 @@
 
         ctx = None
 
+    def draw_count(self, ctx):
+        """ Draw the app's counter value
+
+        Args: ctx - the cairo context where the counter is to be drawn
+        """
+
+        # drawing is done at a notional size  64x64 px, and then scaled
+        # appropriately according to self.drawing_area_size
+
+        draw_size = 64.0
+
+        # height of the counter = 2 pix border top and bottom + 16 pix
+        # internal height
+        height = 20
+
+        # work out the appropriate font size to use - has to fit within the
+        # borders and provide some space above and below the count_val
+        reqd_font_height = height - 8
+
+        # find a font size where the count can be shown with the required 
height
+        ctx.select_font_face("", cairo.FONT_SLANT_NORMAL, 
cairo.FONT_WEIGHT_BOLD)
+        ctext = "%d" % self.count_val
+        for fsize in range(24, 2, -1):
+            ctx.set_font_size(fsize)
+            extents = ctx.text_extents(ctext)
+
+            if (extents[3]< reqd_font_height):
+                font_size = fsize
+                break
+
+        # work out an appropriate width for the counter
+        inset = height/2
+        radius = inset-1
+        if int(extents[2] + extents[0]) > int(radius):
+            width = extents[2] + extents[0] + radius
+        else:
+            width = height + inset
+
+        ctx.save()
+
+        # the background color of the count is the app's highlight colour
+        # convert the highlight values to their cairo equivalents
+        bred = self.highlight_color.r / 255
+        bgreen = self.highlight_color.g / 255
+        bblue = self.highlight_color.b / 255
+
+        # set an appropriate text and border color
+        if bred + bgreen + bblue > 1.5:  # mid-level grey
+            tred = tgreen = tblue = 0.0
+        else:
+            tred = tgreen = tblue = 1.0
+
+        # the count is placed in the upper right of the drawing area, and we 
need
+        # to calculate it's position based on the notional DA_SIZE
+        #
+
+        left = draw_size - width + inset
+
+        # do the drawing - attribution for the drawing code:
+        # 
https://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/launcher/LauncherIcon.cpp
+        ctx.scale(self.drawing_area_size/draw_size,
+                  self.drawing_area_size/draw_size)
+
+        ctx.move_to(left, height-1)
+        ctx.arc(left, inset, radius, 0.5 * math.pi, 1.5*math.pi)
+        ctx.arc(draw_size-inset, inset, radius, 1.5*math.pi, 0.5*math.pi)
+        ctx.line_to(left, height-1)
+        ctx.set_source_rgb(bred, bgreen, bblue)
+        ctx.fill_preserve()
+        ctx.set_source_rgb(tred, tgreen, tblue)
+        ctx.set_line_width(2)
+        ctx.stroke()
+
+        # draw the text
+        ctx.move_to(left - inset + width/2 - (extents[0]+extents[2]/2),
+                    (height/2)+extents[3]/2)
+        ctx.set_source_rgb(tred, tgreen, tblue)
+        ctx.show_text(ctext)
+
+        ctx.restore()
+
+    def draw_progress(self, ctx):
+        """ Draw a progress bar to show the app's progress value
+
+        Args: ctx - the cairo context where the counter is to be drawn
+        """
+
+        def rounded_rectangle(cr, x, y, w, h, r=20):
+            """ Convenience function to draw a rounded rectangle, really needs
+                to be in a library module somewhere, as its used bythe window
+                list
+
+                # Attribution:
+                # 
https://stackoverflow.com/questions/2384374/rounded-rectangle-in-pygtk
+                # This is just one of the samples from
+                # http://www.cairographics.org/cookbook/roundedrectangles/
+                #   A****BQ
+                #  H      C
+                #  *      *
+                #  G      D
+                #   F****E
+            """
+
+            cr.move_to(x + r, y)                      # Move to A
+            cr.line_to(x + w - r, y)                    # Straight line to B
+            cr.curve_to(x + w, y, x + w, y, x + w, y + r)
+            # Curve to C, Control points are both at Q
+            cr.line_to(x + w, y + h - r)                  # Move to D
+            cr.curve_to(x + w, y + h, x + w, y + h, x + w - r, y + h)  # Curve 
to E
+            cr.line_to(x + r, y + h)                    # Line to F
+            cr.curve_to(x, y + h, x, y + h, x, y + h - r)  # Curve to G
+            cr.line_to(x, y+r)                      # Line to H
+            cr.curve_to(x, y, x, y, x+r, y)             # Curve to A
+
+        # drawing is done on a to scale of 64x64 pixels and then scaled
+        # down to the fit the app's drawing area
+        draw_size = 64.0
+
+        # the foreground colour of the progress is the app's highlight colour
+        # convert the highlight values to their cairo equivalents
+        fred = self.highlight_color.r / 255
+        fgreen = self.highlight_color.g / 255
+        fblue = self.highlight_color.b / 255
+
+        # set an appropriate border color and also a background colour for
+        # the progress bar, based on the highlight colour
+        if fred + fgreen + fblue > 1.5:  # mid-level grey
+            brd_red = brd_green = brd_blue = 0.0
+            bk_red = bk_green = bk_blue = 1.0
+        else:
+            brd_red = brd_green = brd_blue = 1.0
+            bk_red = bk_green = bk_blue = 0.0
+
+        height = 8              # total height of the progress bar
+        line_width = 2          # border line width
+        int_height = height - line_width * 2  # interior height
+        left = 8
+        width  = draw_size - left * 2   # width of the progress bar
+
+        top = (draw_size/8) * 5
+
+        ctx.save()
+        ctx.scale(self.drawing_area_size/draw_size, 
self.drawing_area_size/draw_size)
+
+        # draw exterior of the progress bar
+        ctx.set_source_rgb(brd_red, brd_green, brd_blue)
+        ctx.set_line_width(2)
+        rounded_rectangle(ctx, left, top, width, height, 7)
+        ctx.stroke()
+
+        # fill the interior with the background colour
+        ctx.set_line_width(1)
+        ctx.set_source_rgb (bk_red, bk_green, bk_blue)
+        rounded_rectangle(ctx, left + line_width, top + line_width,
+                          width - line_width*2, height-line_width*2,
+                          2)
+
+        ctx.fill()
+
+        # fill part of the interior with a different colour, depending on
+        # the progress value
+        ctx.set_source_rgb(fred, fgreen, fblue)
+        rounded_rectangle(ctx, left + line_width, top + line_width,
+                          (width - line_width*2) * self.progress_val,
+                          height-line_width*2, 2)
+        ctx.fill()
+        ctx.restore()
+
     def set_pixbuf(self, pixbuf):
         """Set the app pixbuf and calculate its average colour.
         """
@@ -1252,9 +1453,36 @@
         cmd_line = bytearray(cmd_line, "UTF-8")
         cmd_line = cmd_line.decode("unicode-escape")
 
+
+        # if an environment variable is specified, extract its name an value
+        # Note: the .desktop file specification at
+        # 
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
+        # does not mention this. Both Ubuntu
+        # 
https://help.ubuntu.com/community/EnvironmentVariables#Launching_desktop_application_with_an_environment_variable
+        # and Arch linux
+        # 
https://wiki.archlinux.org/index.php/Desktop_entries#Modify_environment_variables
+        # seem to indicate that only a single variable can be set and that
+        # there are no spaces between the variable name, the '=' character and
+        # variable's value .....
+
+        # so, if cmd_line begins with "env" it specifies an environment 
variable
+        # to set, follwed by the app e.g. env LANG=he_IL.UTF-8 /usr/bin/pluma
+        #
+        if cmd_line.startswith("env"):
+            cmd_parts = cmd_line.split(" ", 2)
+            var_parts = cmd_parts[1].split("=")
+            var_name = var_parts[0]
+            var_value = var_parts[1]
+
+            # now we need to get the app path and args and carry on...
+            cmd_line = cmd_parts[2]
+        else:
+            var_name = None
+            var_value = None
+
         # if any of the directories in cmd_line contain a " ", they need to be
         # escaped
-        head,tail = os.path.split(cmd_line)
+        head, tail = os.path.split(cmd_line)
         if " " in head:
             head = head.replace(" ", "\ ")
             cmd_line = head + "/" + tail
@@ -1263,7 +1491,11 @@
                                                        
Gio.AppInfoCreateFlags.NONE)
         alc = Gdk.AppLaunchContext()
         alc.set_desktop(-1)                   # use default screen & desktop
-        app_info.launch()
+        # if the .desktop specfied an environment variable, set it
+        if (var_name is not None) and (var_value is not None):
+            alc.setenv(var_name, var_value)
+
+        app_info.launch(None, alc)
         # set the app icon pulsing
         throbber = PulseTimer(self)
 
@@ -1312,6 +1544,65 @@
         self.is_dragee = is_dragee
         self.queue_draw()
 
+    def set_progress_visible(self, is_visible):
+        """
+            Update the progress visibility and cause the app's icon to be
+            redrawn
+
+        Args:
+            is_visible : whether the progress is to be displayed
+        """
+
+        if (is_visible != self.show_progress):
+            self.show_progress = bool(is_visible)
+            self.queue_draw()
+
+    def set_progress_value(self, val):
+        """
+            Update the progress value and cause the app's icon to be
+            redrawn
+
+        Args:
+            val        : the counter value
+        """
+
+        # if the new progressvalue is the same as the old, then there's no need
+        # to do anything...
+        if val != self.progress_val:
+            self.progress_val = val
+            self.queue_draw()
+
+    def set_counter_visible(self, is_visible):
+        """
+            Update the counter visibility and cause the app's icon to be
+            redrawn
+
+        Args:
+            is_visible : whether the counter is to be displayed
+        """
+
+        # if the new value is the same as the old, then there's no need
+        # to do anything...
+        if is_visible != self.show_count:
+            self.show_count = bool(is_visible)
+            self.queue_draw()
+
+    def set_counter_value(self, val):
+        """
+            Update the counter value and cause the app's icon to be
+            redrawn
+
+        Args:
+            val        : the counter value
+        """
+
+        # if the new counter value is the same as the old, then there's no need
+        # to do anything...
+        if val != self.count_val:
+            self.count_val = val
+            self.queue_draw()
+
+
 def main():
     """Main function.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mate-dock-applet-0.73/src/dom_color.in 
new/mate-dock-applet-0.74/src/dom_color.in
--- old/mate-dock-applet-0.73/src/dom_color.in  2016-07-20 09:17:33.000000000 
+0200
+++ new/mate-dock-applet-0.74/src/dom_color.in  2016-08-24 09:18:29.000000000 
+0200
@@ -19,7 +19,13 @@
     colour_tuple = [None, None, None]
     for channel in range(3):
         # Get data for one channel at a time
-        pixels = image.getdata(band=channel)
+
+        # in case of errors stop processing and return black as the
+        # dominant colour
+        try:
+            pixels = image.getdata(band=channel)
+        except ValueError:
+            return "000000"
 
         values = []
         for pixel in pixels:


Reply via email to