[chrome-gnome-shell] connector: handle command line argument outside of GApplication



commit 7b27343e79ff1c7243cb34e70e9a04e764e26944
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sat Mar 4 23:53:30 2017 +0400

    connector: handle command line argument outside of GApplication
    
    For some reason with older software versions (confirmed on Ubuntu Trusty)
    Gio.Application.do_local_command_line causes segfault.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=779492

 connector/chrome-gnome-shell.py |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/connector/chrome-gnome-shell.py b/connector/chrome-gnome-shell.py
index f0bbdd1..0244881 100755
--- a/connector/chrome-gnome-shell.py
+++ b/connector/chrome-gnome-shell.py
@@ -3,7 +3,7 @@
 
 """
     GNOME Shell integration for Chrome
-    Copyright (C) 2016  Yuri Konotopov <ykonotopov gnome org>
+    Copyright (C) 2016-2017  Yuri Konotopov <ykonotopov gnome org>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -135,12 +135,6 @@ class ChromeGNOMEShell(Gio.Application):
         action.connect('activate', callback)
         self.add_action(action)
 
-    def do_local_command_line(self, arguments):
-        if '--gapplication-service' in arguments:
-            arguments.remove('--gapplication-service')
-
-        return Gio.Application.do_local_command_line(self, arguments)
-
     # Service events
     # noinspection PyUnusedLocal
     def on_create_notification(self, source, request):
@@ -547,8 +541,13 @@ class ChromeGNOMEShell(Gio.Application):
 
 if __name__ == '__main__':
     debug('Main. Use CTRL+D to quit.')
-    app = ChromeGNOMEShell('--gapplication-service' in sys.argv)
 
+    run_as_service = False
+    if '--gapplication-service' in sys.argv:
+        run_as_service = True
+        sys.argv.remove('--gapplication-service')
+
+    app = ChromeGNOMEShell(run_as_service)
     app.run(sys.argv)
 
     debug('Quit')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]