diff -Nru unity-webapps-youtube-2.4.16+13.10.20130917.1/YouTubeyoutubecom.desktop unity-webapps-youtube-2.4.16+13.10.20130924.2/YouTubeyoutubecom.desktop --- unity-webapps-youtube-2.4.16+13.10.20130917.1/YouTubeyoutubecom.desktop 1970-01-01 00:00:00.000000000 +0000 +++ unity-webapps-youtube-2.4.16+13.10.20130924.2/YouTubeyoutubecom.desktop 2013-09-24 22:03:31.000000000 +0000 @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=YouTube +Type=Application +Icon=unity-webapps-youtube +MimeType= +Actions=S0;S1;S2;S3;S4;S5;S6;S7;S8;S9;S10; +Exec=unity-webapps-runner -n 'WW91VHViZQ==' -d 'youtube.com' %u +StartupWMClass=YouTubeyoutubecom + \ No newline at end of file diff -Nru unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/changelog unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/changelog --- unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/changelog 2013-09-25 00:21:32.000000000 +0000 +++ unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/changelog 2013-09-25 00:21:33.000000000 +0000 @@ -1,3 +1,13 @@ +unity-webapps-youtube (2.4.16+13.10.20130924.2-0ubuntu1) saucy; urgency=low + + [ Alexandre Abreu ] + * Add session migration script & desktop file for StartupWMClass + + [ Ubuntu daily release ] + * Automatic snapshot from revision 60 + + -- Ubuntu daily release Tue, 24 Sep 2013 22:03:45 +0000 + unity-webapps-youtube (2.4.16+13.10.20130917.1-0ubuntu1) saucy; urgency=low [ Alexandre Abreu ] diff -Nru unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/install unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/install --- unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/install 2013-09-25 00:21:32.000000000 +0000 +++ unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/install 2013-09-25 00:21:33.000000000 +0000 @@ -6,3 +6,4 @@ 64/unity-webapps-youtube.png usr/share/icons/unity-webapps-applications/64/apps manifest.json usr/share/unity-webapps/userscripts/unity-webapps-youtube +YouTubeyoutubecom.desktop usr/share/applications diff -Nru unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/unity-webapps-youtube.migrations unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/unity-webapps-youtube.migrations --- unity-webapps-youtube-2.4.16+13.10.20130917.1/debian/unity-webapps-youtube.migrations 1970-01-01 00:00:00.000000000 +0000 +++ unity-webapps-youtube-2.4.16+13.10.20130924.2/debian/unity-webapps-youtube.migrations 2013-09-25 00:21:33.000000000 +0000 @@ -0,0 +1 @@ +scripts/update-desktop-file-unity-webapps-youtube.py diff -Nru unity-webapps-youtube-2.4.16+13.10.20130917.1/scripts/update-desktop-file-unity-webapps-youtube.py unity-webapps-youtube-2.4.16+13.10.20130924.2/scripts/update-desktop-file-unity-webapps-youtube.py --- unity-webapps-youtube-2.4.16+13.10.20130917.1/scripts/update-desktop-file-unity-webapps-youtube.py 1970-01-01 00:00:00.000000000 +0000 +++ unity-webapps-youtube-2.4.16+13.10.20130924.2/scripts/update-desktop-file-unity-webapps-youtube.py 2013-09-24 22:03:31.000000000 +0000 @@ -0,0 +1,34 @@ +#!/usr/bin/python +from gi.repository import Gio +import os +import glib +import glob +import re + +APP_ID = 'YouTubeyoutubecom' + +def get_local_applications_path(): + return os.path.join(glib.get_user_data_dir(), 'applications') + +def update_desktop_file_startupwmclass(): + local_applications_path = get_local_applications_path() + if not os.path.exists(local_applications_path) or not os.path.isdir(local_applications_path): + return + + desktop_filename = os.path.join(local_applications_path, '{0}.desktop'.format(APP_ID)) + if not os.path.exists(desktop_filename) or not os.path.isfile(desktop_filename): + return + + try: + desktop_file_content = open(desktop_filename).read() + start_idx = desktop_file_content.find('[Desktop Entry]') + if start_idx != -1 and desktop_file_content.find('StartupWMClass') == -1: + start_idx += len('[Desktop Entry]') + updated_desktop_file_content = desktop_file_content[:start_idx] + '\nStartupWMClass={0}'.format(APP_ID) + desktop_file_content[start_idx:] + open(desktop_filename, "w+").write(updated_desktop_file_content) + except Exception, e: + print 'Error while upgrading the desktop file: ', str(e) + +if __name__ == "__main__": + update_desktop_file_startupwmclass() + \ No newline at end of file