Hello community, here is the log from the commit of package mate-applet-dock for openSUSE:Factory checked in at 2016-04-15 19:11:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-02-16 09:18:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.mate-applet-dock.new/mate-applet-dock.changes 2016-04-15 19:11:20.000000000 +0200 @@ -1,0 +2,21 @@ +Sat Apr 9 11:24:53 UTC 2016 - [email protected] + +- Update to version 0.70 (changes since 0.67): + * Fix for lp#1550392. + * Add code to allow new instances of applications to be started + by middle clicking their dock icons (lp#1554128). + * Fix a bug that would prevent applications from launching if + they were in a directory structure which contained a space + character e.g. ~/foo bar/. + * Fix a bug which associated newly opened windows with incorrect + applications and which occurred when the wm_class_name of the + window was not set (lp#1555324). + * Settings from previous instances of the applet are now imported + silently (previously the user was presented with a dialog + asking the user if they wanted to import the settings). The + change is to prevent problems when switching to the Mutiny + desktop layout via MATE Tweak. + * When saving custom launchers the ~/.local/share/applications + directory will be created if it doesn't already exist. + +------------------------------------------------------------------- Old: ---- dock-applet-0.67.tar.gz New: ---- dock-applet-0.70.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mate-applet-dock.spec ++++++ --- /var/tmp/diff_new_pack.rhFYgo/_old 2016-04-15 19:11:22.000000000 +0200 +++ /var/tmp/diff_new_pack.rhFYgo/_new 2016-04-15 19:11:22.000000000 +0200 @@ -18,7 +18,7 @@ %define _name dock-applet Name: mate-applet-dock -Version: 0.67 +Version: 0.70 Release: 0 Summary: Dock applet for the MATE panel License: GPL-2.0+ ++++++ dock-applet-0.67.tar.gz -> dock-applet-0.70.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/.gitignore new/dock-applet-0.70/.gitignore --- old/dock-applet-0.67/.gitignore 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/.gitignore 2016-03-16 14:41:16.000000000 +0100 @@ -7,3 +7,12 @@ __pycache__ *.valid autom4te.cache +configure +configure.ac +INSTALL +install.sh +Makefile +Makefile.in +missing +py-compile + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/ChangeLog new/dock-applet-0.70/ChangeLog --- old/dock-applet-0.67/ChangeLog 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/ChangeLog 2016-03-16 14:41:16.000000000 +0100 @@ -1,3 +1,23 @@ +V0.70 Settings from previous instances of the applet are now imported + silently (previously the user was presented with a dialog asking the + user if they wanted to import the settings). The change is to prevent + problems when switching to the Mutiny desktop layout via Mate Tweak in + Ubuntu Mate 16.04 + When saving custom launchers the ~/.local/share/applications directory + will be created if it doesn't already exist + +v0.69 Added code to allow new instances of apps to be started by middle + clicking their dock icon (see https://bugs.launchpad.net/ubuntu-mate/+bug/1554128) + Fixed bug that would prevent apps from launching if they were in a + directory structure which contained a space character e.g. + ~/Downloads/PopCorn Time/ + Fixed bug which associated newly opened windows with incorrect apps + and which occurred when the wm_class_name of the window was not set. + Fix for https://bugs.launchpad.net/ubuntu-mate/+bug/1555324 + +V0.68 Fix for Launchpad bug 1550392 + (https://bugs.launchpad.net/ubuntu/+source/mate-dock-applet/+bug/1550392) + V0.67 Panel colour changing now occurs smoothly over over 0.5s rather than abruptly. Big cleanup of git repository! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/README.md new/dock-applet-0.70/README.md --- old/dock-applet-0.67/README.md 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/README.md 2016-03-16 14:41:16.000000000 +0100 @@ -7,12 +7,11 @@ * Rearrange application icons on the dock * Launch apps by clicking on their icons in the dock * Minimize/unminimize running app windows by clicking the app's dock icon -* Detect changes in the current icon theme and update the dock - accordingly +* Detect changes in the current icon theme and update the dock accordingly * Use an indicator by each app to show when it is running * Optionally, use multiple indicators for each window an app has open * Use either a light or dark indicator that it can always be seen no matter what colour the panel is, or turn indicators off altogether -* Change the colour of MATE panels to the dominant colour (i.e. the most common colour) of the desktop wallpaper. The colour can be applied to all panels or just the panel contaning the dock. +* Change the colour of MATE panels to the dominant colour (i.e. the most common colour) of the desktop wallpaper. The colour can be applied to all panels or just the panel containing the dock. ### Installation @@ -27,6 +26,7 @@ * libglib2-dev * Python Imaging Library * SciPy +* Python 3 Cairo bindings then cd to the directory containing all of the development files and run: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/configure.ac new/dock-applet-0.70/configure.ac --- old/dock-applet-0.67/configure.ac 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/configure.ac 2016-03-16 14:41:16.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([Dock Applet], [0.67]) +AC_INIT([Dock Applet], [0.70]) AM_INIT_AUTOMAKE AM_PATH_PYTHON([3.0]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/Makefile.am new/dock-applet-0.70/src/Makefile.am --- old/dock-applet-0.67/src/Makefile.am 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/Makefile.am 2016-03-16 14:41:16.000000000 +0100 @@ -127,12 +127,10 @@ dock_color_changer.py \ dom_color.py -CLEANFILES = $(applet_SCRIPTS) -# $(gsettings_SCHEMAS) \ -# org.mate.panel.applet.DockAppletFactory.service +CLEANFILES = $(applet_SCRIPTS) \ + org.mate.panel.applet.DockAppletFactory.service \ + org.mate.panel.DockApplet.mate-panel-applet -# $(gsettings_SCHEMAS).in - EXTRA_DIST = dock_applet.in \ dock_about.in \ dock_prefs.in \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/dock.in new/dock-applet-0.70/src/dock.in --- old/dock-applet-0.67/src/dock.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/dock.in 2016-03-16 14:41:16.000000000 +0100 @@ -248,60 +248,52 @@ (os.path.isfile(self.xml_conf)): # this dock is being run for the first time, so if we have any saved settings - # from other docks, offer to import them .. - md = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, - Gtk.ButtonsType.YES_NO, - None) - md.set_markup ('<span size="x-large"><b>Import settings?</b></span>') - md.format_secondary_text("Settings from a previous dock have been found. Do you want to " \ - "import the other dock's pinned apps and settings?") - response = md.run() - if response == Gtk.ResponseType.YES: - - xml_settings = dock_xml.read_xml(self.xml_conf) - - if xml_settings[0] == True: - # the settings were read correctly, so set everything up - - pinned_apps = [] - for pinned_app in xml_settings[1]: - pinned_apps.append(pinned_app) - - self.indicator = xml_settings[2] - self.show_all_unpinned_apps = xml_settings[3] - self.multi_ind = xml_settings[4] - self.click_restore_last_active = xml_settings[5] - self.show_all_pinned_apps = xml_settings[6] - self.change_panel_color = xml_settings[7] - self.change_dock_color_only = xml_settings[8] - - # now, immediately write the settings to dconf and back to the config file - # so the dock can access them - - self.settings.set_value("pinned-apps", GLib.Variant('as', pinned_apps)) - self.settings.set_int("indicator-type", self.indicator) - self.settings.set_boolean("multi-ind", self.multi_ind) - self.settings.set_boolean("apps-from-all-workspaces", self.show_all_unpinned_apps) - self.settings.set_boolean("first-run", False) - self.settings.set_boolean("click-restore-last-active", self.click_restore_last_active) - self.settings.set_boolean("pinned-apps-from-all-workspaces", self.show_all_pinned_apps) - self.settings.set_boolean("change-panel-color", self.change_panel_color) - self.settings.set_boolean("change-panel-color-dock-only", self.change_dock_color_only) - - dock_xml.write_xml(self.xml_conf, pinned_apps, self.indicator, \ - self.show_all_unpinned_apps, self.multi_ind, self.click_restore_last_active, \ - self.show_all_pinned_apps, self.change_panel_color, self.change_dock_color_only) - - md.destroy() - return - else: - - # the xml was not read - # this could be due to an error or because new versions of the applets have added - # configuration options not yet in the user's xml file. To recover, simply close - # the dialog and assume a default set of options - md.destroy() - + # from other docks, import them. Note: prior to V0.70 the applet presented a + # dialog asking the user whether or not to import the previous settings. + # The is dialog has been removed and the previous settings are now silently + # imported to prevent problems when swtiching to the Mutiny layout in Ubuntu + # Mate 16.04 + + xml_settings = dock_xml.read_xml(self.xml_conf) + + if xml_settings[0] == True: + # the settings were read correctly, so set everything up + + pinned_apps = [] + for pinned_app in xml_settings[1]: + pinned_apps.append(pinned_app) + + self.indicator = xml_settings[2] + self.show_all_unpinned_apps = xml_settings[3] + self.multi_ind = xml_settings[4] + self.click_restore_last_active = xml_settings[5] + self.show_all_pinned_apps = xml_settings[6] + self.change_panel_color = xml_settings[7] + self.change_dock_color_only = xml_settings[8] + + # now, immediately write the settings to dconf and back to the config file + # so the dock can access them + + self.settings.set_value("pinned-apps", GLib.Variant('as', pinned_apps)) + self.settings.set_int("indicator-type", self.indicator) + self.settings.set_boolean("multi-ind", self.multi_ind) + self.settings.set_boolean("apps-from-all-workspaces", self.show_all_unpinned_apps) + self.settings.set_boolean("first-run", False) + self.settings.set_boolean("click-restore-last-active", self.click_restore_last_active) + self.settings.set_boolean("pinned-apps-from-all-workspaces", self.show_all_pinned_apps) + self.settings.set_boolean("change-panel-color", self.change_panel_color) + self.settings.set_boolean("change-panel-color-dock-only", self.change_dock_color_only) + + dock_xml.write_xml(self.xml_conf, pinned_apps, self.indicator, \ + self.show_all_unpinned_apps, self.multi_ind, self.click_restore_last_active, \ + self.show_all_pinned_apps, self.change_panel_color, self.change_dock_color_only) + + return + + # we get here if there was no previous configuration, or the configuration couldn't be read. + # Where the configuration cou;n't be read this could be due to an error or because new versions + # of the applet have added configuration options not yet in the user's xml file. To recover, + # simply assume a default set of options self.indicator = self.settings.get_int("indicator-type") self.multi_ind = self.settings.get_boolean("multi-ind") self.show_all_unpinned_apps = self.settings.get_boolean("apps-from-all-workspaces") @@ -797,7 +789,11 @@ # state that .desktop filenames should not contain spaces, so.... dfname = self.ccl_win.name.replace(" ", "-") - dfname = os.path.expanduser("~/.local/share/applications/mda-%s.desktop" %dfname) + local_apps = os.path.expanduser("~/.local/share/appplications") + if not os.path.exists(local_apps): + # ~/.local/share/applications doesn't exist, so create it + os.mkdir(local_apps) + dfname = os.path.expanduser("%s/mda-%s.desktop" %(local_apps,dfname)) dfile = open(dfname, "w") dfile.write("[Desktop Entry]\n") @@ -1052,17 +1048,20 @@ new_win = self.wnck_screen.get_active_window() if new_win is not None: - new_cg = new_win.get_class_group() - new_wm_class_name = new_cg.get_res_class() - new_app = new_win.get_application() - for app in self.app_list: - if app.wm_class_name == new_wm_class_name: - for aai in app.app_info: - if new_app == aai.app: - app.is_active = True - app.last_active_win = new_win - app.queue_draw() - break + # the desktop itself can be the new active window. we need to ignore it if so.... + # (fix for https://bugs.launchpad.net/ubuntu/+source/mate-dock-applet/+bug/1550392 + if new_win.get_name().lower()!="x-caja-desktop": + new_cg = new_win.get_class_group() + new_wm_class_name = new_cg.get_res_class() + new_app = new_win.get_application() + for app in self.app_list: + if app.wm_class_name == new_wm_class_name: + for aai in app.app_info: + if new_app == aai.app: + app.is_active = True + app.last_active_win = new_win + app.queue_draw() + break def window_opened(self, wnck_screen, wnck_window): """Event handler for the window_opened event @@ -1105,8 +1104,10 @@ # if we don't have the .desktop file then things get a little more # complicated elif app.has_wnck_app(wnck_app) or \ - app.wnck_class == dock_app.wnck_class or \ - app.wm_class_name.upper() == dock_app.wm_class_name.upper(): + ((app.wnck_class == dock_app.wnck_class or \ + app.wm_class_name.upper() == dock_app.wm_class_name.upper() and \ + # test below is fix for https://bugs.launchpad.net/ubuntu-mate/+bug/1555324 + app.wm_class_name.strip() != "")): # in_dock = True if in_dock == True: @@ -1710,9 +1711,16 @@ # the last active window may be set to None (e.g. if the app's active window has been closed # and no other window has been made active afterwards). Therefore, if there is no active last window - # activate the app's first window + # activate the app's first normal window + # (fix for https://bugs.launchpad.net/ubuntu/+source/mate-dock-applet/+bug/1550392) if last_active_win is None: - last_active_win = win_list[0] + for window in win_list: + win_type = window.get_window_type() + if ((win_type == Wnck.WindowType.NORMAL) or \ + (win_type == Wnck.WindowType.DIALOG)) and \ + (not window.is_skip_tasklist()): + last_active_win = window + break # if we're restoring all windows, do this now before we finally activate the last active window if self.click_restore_last_active == False: @@ -1732,7 +1740,11 @@ wnck_aws = self.wnck_screen.get_active_workspace() wnck_ws = last_active_win.get_workspace() - if wnck_aws is not None and (wnck_aws != wnck_ws): + # the window's active workspace can be null if it is visible on all workspaces + # or if it is not on any workspace (I'm looking at you caja-desktop!!!!!) + # (fix for https://bugs.launchpad.net/ubuntu/+source/mate-dock-applet/+bug/1550392 and + # https://bugs.launchpad.net/ubuntu-mate/+bug/1555336 (regarding software updater)) + if wnck_aws is not None and wnck_ws is not None and (wnck_aws != wnck_ws): wnck_ws.activate(0) sleep(0.01) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/dock_applet.in new/dock-applet-0.70/src/dock_applet.in --- old/dock-applet-0.67/src/dock_applet.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/dock_applet.in 2016-03-16 14:41:16.000000000 +0100 @@ -126,6 +126,12 @@ else: the_dock.minimize_or_restore_windows(app, event) + # See https://bugs.launchpad.net/ubuntu-mate/+bug/1554128 + if event.button == 2: + app = the_dock.get_app_at_mouse(event.x, event.y) + if app is not None: + the_dock.hide_win_list() + app.start_app() def applet_enter_notify(widget, event, the_dock): """Enter notify event for the applet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/dock_prefs.in new/dock-applet-0.70/src/dock_prefs.in --- old/dock-applet-0.67/src/dock_prefs.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/dock_prefs.in 2016-03-16 14:41:16.000000000 +0100 @@ -478,7 +478,7 @@ self.__cb_panel_color_change.set_active(change_color) def get_change_dock_color_only(self): - """ Get whether only the panel contaning the dock is to be changed when settung + """ Get whether only the panel containing the dock is to be changed when settung the panel colour according to the current wallpaper Returns: boolean @@ -487,7 +487,7 @@ return self.__cb_dock_panel_only.get_active() def set_change_dock_color_only(self, dock_only): - """ Sets whether only the panel contaning the dock is to be changed when settings + """ Sets whether only the panel containing the dock is to be changed when settings the panel colour according to the current wallpaper Args: dock_only - boolean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/dock_win_list.in new/dock-applet-0.70/src/dock_win_list.in --- old/dock-applet-0.67/src/dock_win_list.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/dock_win_list.in 2016-03-16 14:41:16.000000000 +0100 @@ -322,7 +322,12 @@ wnck_aws = self.wnck_screen.get_active_workspace() wnck_ws = win.get_workspace() - if wnck_aws is not None and (wnck_aws != wnck_ws): + + # the windows's current workspace can be None if it is pinned to all workspaces + # or it is not on any at all... + # (fix for https://bugs.launchpad.net/ubuntu/+source/mate-dock-applet/+bug/1550392 and + # https://bugs.launchpad.net/ubuntu-mate/+bug/1555336 (regarding software updater)) + if (wnck_aws is not None) and (wnck_ws is not None) and (wnck_aws != wnck_ws): wnck_ws.activate(0) sleep(0.01) win.activate(0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/docked_app.in new/dock-applet-0.70/src/docked_app.in --- old/dock-applet-0.67/src/docked_app.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/docked_app.in 2016-03-16 14:41:16.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env/ python3 +#!/usr/bin/env python3 """Provide functionality relating to an app in a dock. Allow info relating to a running app (e.g. icon, command line, @@ -163,9 +163,15 @@ blue += data[pixels][2] num_counted += 1 - ravg = int(red/num_counted) - gavg = int(green/num_counted) - bavg = int(blue/num_counted) + if num_counted > 0: + ravg = int(red/num_counted) + gavg = int(green/num_counted) + bavg = int(blue/num_counted) + else: + # in case of a bad icon assume a grey average colour + # this should fix a division by zero error that occurred at this point in the + # code, but which I've only seen once and never been able to duplicate + ravg = gavg = bavg = 128 return ravg, gavg, bavg @@ -1151,6 +1157,12 @@ cmd_line =bytearray(cmd_line, "UTF-8") cmd_line = cmd_line.decode("unicode-escape") + # if any of the directories in cmd_line contain a " ", they need to be escaped + head,tail = os.path.split(cmd_line) + if " " in head: + head = head.replace(" ", "\ ") + cmd_line = head + "/" + tail + app_info = Gio.AppInfo.create_from_commandline(cmd_line, None, Gio.AppInfoCreateFlags.NONE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dock-applet-0.67/src/dom_color.in new/dock-applet-0.70/src/dom_color.in --- old/dock-applet-0.67/src/dom_color.in 2016-02-09 12:08:27.000000000 +0100 +++ new/dock-applet-0.70/src/dom_color.in 2016-03-16 14:41:16.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env/python3 +#!/usr/bin/env python3 """ Calculate the dominant color of an image Code obtained from: https://stackoverflow.com/questions/34084142/python-3-most-common-color-in-image-kmeans-data-type-match
