Hello community,

here is the log from the commit of package mate-menu for openSUSE:Factory 
checked in at 2017-06-15 11:24:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mate-menu (Old)
 and      /work/SRC/openSUSE:Factory/.mate-menu.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mate-menu"

Thu Jun 15 11:24:36 2017 rev:14 rq:503491 version:17.10.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/mate-menu/mate-menu.changes      2017-06-12 
15:35:13.852673228 +0200
+++ /work/SRC/openSUSE:Factory/.mate-menu.new/mate-menu.changes 2017-06-15 
11:24:39.456690611 +0200
@@ -3,0 +4,10 @@
+- Update to version 17.10.5 (changes since 17.10.3):
+  * Fix arguments in launchers.
+  * Sort applications by relevance when searching.
+  * Add exception handling around pointer monitor and keybinder.
+  * Revert to using "dock" type.
+- Remove mate-menu-17.10.3-fix-launching.patch.
+
+-------------------------------------------------------------------
+Sun Jun 11 17:10:09 UTC 2017 - [email protected]
+

Old:
----
  mate-menu-17.10.3-fix-launching.patch
  mate-menu_17.10.3.orig.tar.gz

New:
----
  mate-menu_17.10.5.orig.tar.gz

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

Other differences:
------------------
++++++ mate-menu.spec ++++++
--- /var/tmp/diff_new_pack.aAf7Fm/_old  2017-06-15 11:24:40.296572051 +0200
+++ /var/tmp/diff_new_pack.aAf7Fm/_new  2017-06-15 11:24:40.300571487 +0200
@@ -17,9 +17,9 @@
 
 
 %define _name   mate_menu
-%define _rev    63ffcb04fac3
+%define _rev    685cf9684b62
 Name:           mate-menu
-Version:        17.10.3
+Version:        17.10.5
 Release:        0
 Summary:        Advanced MATE menu
 License:        GPL-2.0+
@@ -28,8 +28,6 @@
 Source:         
https://launchpad.net/ubuntu/+archive/primary/+files/%{name}_%{version}.orig.tar.gz
 # PATCH-FEATURE-OPENSUSE mate-menu-yast2-software.patch [email protected] -- 
Use YaST2 and GNOME PackageKit package managers.
 Patch0:         %{name}-yast2-software.patch
-# PATCH-FIX-UPSTREAM mate-menu-17.10.3-fix-launching.patch [email protected] 
-- Fix entries launching with arguments.
-Patch1:         %{name}-17.10.3-fix-launching.patch
 BuildRequires:  gobject-introspection-devel
 BuildRequires:  intltool
 BuildRequires:  python >= 2.7
@@ -68,7 +66,6 @@
 %prep
 %setup -q -n ubuntu-mate-%{name}-%{_rev}
 %patch0 -p1
-%patch1 -p1
 sed -i 's/su-to-root/xdg-su/g' %{_name}/execute.py
 
 %build

++++++ mate-menu_17.10.3.orig.tar.gz -> mate-menu_17.10.5.orig.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ubuntu-mate-mate-menu-63ffcb04fac3/data/mate-menu.glade 
new/ubuntu-mate-mate-menu-685cf9684b62/data/mate-menu.glade
--- old/ubuntu-mate-mate-menu-63ffcb04fac3/data/mate-menu.glade 2017-06-10 
18:13:39.000000000 +0200
+++ new/ubuntu-mate-mate-menu-685cf9684b62/data/mate-menu.glade 2017-06-13 
01:35:03.000000000 +0200
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkWindow" id="mainWindow">
     <property name="can_focus">False</property>
     <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 
| GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK</property>
-    <property name="resizable">False</property>
     <property name="type_hint">dock</property>
+    <property name="resizable">False</property>
     <property name="skip_taskbar_hint">True</property>
     <property name="skip_pager_hint">True</property>
     <property name="decorated">False</property>
@@ -18,7 +19,6 @@
           <object class="GtkBox" id="paneholder">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="orientation">horizontal</property>
             <child>
               <placeholder/>
             </child>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ubuntu-mate-mate-menu-63ffcb04fac3/lib/mate-menu.py 
new/ubuntu-mate-mate-menu-685cf9684b62/lib/mate-menu.py
--- old/ubuntu-mate-mate-menu-63ffcb04fac3/lib/mate-menu.py     2017-06-10 
18:13:39.000000000 +0200
+++ new/ubuntu-mate-mate-menu-685cf9684b62/lib/mate-menu.py     2017-06-13 
01:35:03.000000000 +0200
@@ -19,7 +19,7 @@
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-__VERSION__='17.10.3'
+__VERSION__='17.10.5'
 
 import gc
 import gi
@@ -63,10 +63,9 @@
 class MainWindow( object ):
     """This is the main class for the application"""
 
-    def __init__( self, toggleButton, settings, keybinder ):
+    def __init__(self, toggleButton, settings):
 
         self.settings = settings
-        self.keybinder = keybinder
         self.data_path = os.path.join( '/', 'usr', 'share', 'mate-menu' )
         self.icon = "/usr/share/mate-menu/icons/mate-logo.svg"
 
@@ -487,7 +486,6 @@
         self.data_path = os.path.join('/','usr','share','mate-menu')
         self.applet = applet
         self.settings = Gio.Settings.new("org.mate.mate-menu")
-        self.keybinder = keybinding.GlobalKeyBinding()
         self.loadSettings()
 
         self.createPanelButton()
@@ -501,17 +499,15 @@
         self.settings.connect( "changed::applet-icon", self.reloadSettings )
         self.settings.connect( "changed::hide-applet-icon", 
self.reloadSettings )
         self.settings.connect( "changed::applet-icon-size", 
self.reloadSettings )
-        self.settings.connect( "changed::hot-key", self.hotkeyChanged )
 
         self.applet.set_flags( MatePanelApplet.AppletFlags.EXPAND_MINOR )
         self.applet.connect( "button-press-event", self.showMenu )
         self.applet.connect( "change-orient", self.changeOrientation )
         self.applet.connect("enter-notify-event", self.enter_notify)
         self.applet.connect("leave-notify-event", self.leave_notify)
-        self.mainwin = MainWindow( self.button_box, self.settings, 
self.keybinder )
+        self.mainwin = MainWindow(self.button_box, self.settings)
         self.mainwin.window.connect( "map-event", self.onWindowMap )
         self.mainwin.window.connect( "unmap-event", self.onWindowUnmap )
-        self.mainwin.window.connect( "realize", self.onRealize )
         self.mainwin.window.connect( "size-allocate", lambda *args: 
self.positionMenu() )
 
         self.mainwin.window.set_name("mate-menu") # Name used in Gtk RC files
@@ -521,20 +517,39 @@
         if self.mainwin.icon:
             Gtk.Window.set_default_icon_name( self.mainwin.icon )
 
-        self.bind_hot_key()
-        self.applet.set_can_focus(False)
+        try:
+            self.keybinder = keybinding.GlobalKeyBinding()
+            if self.hotkeyText != "":
+                self.keybinder.grab( self.hotkeyText )
+            self.keybinder.connect("activate", self.onBindingPress)
+            self.keybinder.start()
+            self.settings.connect( "changed::hot-key", self.hotkeyChanged )
+            print "Binding to Hot Key: " + self.hotkeyText
+        except Exception, cause:
+            self.keybinder = None
+            print "** WARNING ** - Keybinder Error"
+            print "Error Report :\n", str(cause)
 
-        self.pointerMonitor = pointerMonitor.PointerMonitor()
-        self.pointerMonitor.connect("activate", self.onPointerOutside)
+        self.applet.set_can_focus(False)
+        
+        try:
+            self.pointerMonitor = pointerMonitor.PointerMonitor()
+            self.pointerMonitor.connect("activate", self.onPointerOutside)
+            self.mainwin.window.connect( "realize", self.onRealize )
+        except Exception, cause:
+            print "** WARNING ** - Pointer Monitor Error"
+            print "Error Report :\n", str(cause)
 
     def onWindowMap( self, *args ):
         self.applet.get_style_context().set_state( Gtk.StateFlags.SELECTED )
-        self.keybinder.set_focus_window( self.mainwin.window.get_window() )
+        if self.keybinder is not None:
+            self.keybinder.set_focus_window(self.mainwin.window.get_window())
         return False
 
     def onWindowUnmap( self, *args ):
         self.applet.get_style_context().set_state( Gtk.StateFlags.NORMAL )
-        self.keybinder.set_focus_window()
+        if self.keybinder is not None:
+            self.keybinder.set_focus_window()
         return False
 
     def onRealize( self, *args):
@@ -679,20 +694,6 @@
         self.do_image(self.buttonIcon, False)
         self.sizeButton()
 
-    def bind_hot_key (self):
-        try:
-            if self.hotkeyText != "":
-                self.keybinder.grab( self.hotkeyText )
-            self.keybinder.connect("activate", self.onBindingPress)
-            self.keybinder.start()
-            # Binding menu to hotkey
-            print "Binding to Hot Key: " + self.hotkeyText
-
-        except Exception, cause:
-            print "** WARNING ** - Menu Hotkey Binding Error"
-            print "Error Report :\n", str(cause)
-            pass
-
     def hotkeyChanged (self, schema, key):
         self.hotkeyText =  self.settings.get_string( "hot-key" )
         self.keybinder.rebind(self.hotkeyText)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/easybuttons.py 
new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/easybuttons.py
--- old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/easybuttons.py     
2017-06-10 18:13:39.000000000 +0200
+++ new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/easybuttons.py     
2017-06-13 01:35:03.000000000 +0200
@@ -282,6 +282,7 @@
 
         self.desktopFile = desktopFile
         self.startupMonitorId = 0
+        self.relevance = 0
 
         self.loadDesktopEntry( desktopItem )
 
@@ -360,16 +361,34 @@
 
     def filterText( self, text ):
         keywords = text.lower().split()
+        self.relevance = 0
         appName = self.appName.lower()
         appGenericName = self.appGenericName.lower()
         appComment = self.appComment.lower()
         appExec = self.appExec.lower()
         for keyword in keywords:
             keyw = self.strip_accents(keyword)
+
+            # Hide if the term does not match
             if keyw != "" and appName.find( keyw ) == -1 and 
appGenericName.find( keyw ) == -1 and appComment.find( keyw ) == -1 and 
appExec.find( keyw ) == -1:
                 self.hide()
                 return False
 
+            # Give better ranking to the actual app name
+            if appName == keyw:
+                self.relevance += 32
+            elif appName.find( keyw ) == 0:
+                self.relevance += 16
+            elif appName.find( keyw ) != -1:
+                self.relevance += 8
+
+            if appExec.find( keyw ) != -1:
+                self.relevance += 4
+            if appComment.find( keyw ) != -1:
+                self.relevance += 2
+            if appGenericName.find( keyw ) != -1:
+                self.relevance += 1
+
         self.show()
         return True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/execute.py 
new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/execute.py
--- old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/execute.py 2017-06-10 
18:13:39.000000000 +0200
+++ new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/execute.py 2017-06-13 
01:35:03.000000000 +0200
@@ -19,6 +19,7 @@
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 import os
+import shlex
 import subprocess
 
 def RemoveArgs(Execline):
@@ -46,7 +47,7 @@
                        print "running manually..."
                        try:
                                os.chdir(cwd)
-                               subprocess.Popen([cmd])
+                               subprocess.Popen(shlex.split(cmd))
                                return True
                        except Exception, detail:
                                print detail
@@ -57,7 +58,7 @@
        try:
                os.chdir( cwd )
                string = ' '.join(cmd)
-               subprocess.Popen([string])
+               subprocess.Popen(shlex.split(string))
                return True
        except Exception, detail:
                print detail
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/plugins/applications.py 
new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/plugins/applications.py
--- old/ubuntu-mate-mate-menu-63ffcb04fac3/mate_menu/plugins/applications.py    
2017-06-10 18:13:39.000000000 +0200
+++ new/ubuntu-mate-mate-menu-685cf9684b62/mate_menu/plugins/applications.py    
2017-06-13 01:35:03.000000000 +0200
@@ -27,6 +27,7 @@
 import shutil
 import string
 import gettext
+import shlex
 import subprocess
 import filecmp
 from mate_menu.easybuttons import *
@@ -678,11 +679,8 @@
                             i.hide()
                         else:
                             shownList.append(i)
-                            
-                            #if this is the first matching item focus it
-                            if not showns:
-                                i.grab_focus()
-
+                            # Remove application from list so that we can 
re-add it in order
+                            self.applicationsBox.remove(i)
                             showns = True
                 if (not showns and 
os.path.exists("/usr/share/mate-menu/icons/mate-logo.svg")):
                     if len(text) >= 3:
@@ -694,6 +692,16 @@
                 else:
                     self.current_suggestion = None
                     self.current_results = []
+                    # Sort applications by relevance, and alphabetical within 
that
+                    shownList = sorted(shownList, key=lambda app: app.appName)
+                    shownList = sorted(shownList, key=lambda app: 
app.relevance, reverse=True)
+                    focused = False
+                    for i in shownList:
+                        self.applicationsBox.add(i)
+                        if not focused:
+                            # Grab focus of the first app shown
+                            i.grab_focus()
+                            focused = True
 
                 for i in self.categoriesBox.get_children():
                     i.set_relief( Gtk.ReliefStyle.NONE )
@@ -1071,10 +1079,10 @@
                     app_button.execute()
                     self.mateMenuWin.hide()
                     return
-            
+
             self.mateMenuWin.hide()
             fullstring = self.searchtool.replace( "%s", text )
-            subprocess.Popen([fullstring])
+            subprocess.Popen(shlex.split(fullstring))
 
     def SearchWithButton( self, widget, event ):
         self.Search( widget )


Reply via email to