diff options
| author | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2016-05-30 09:48:32 +0300 |
|---|---|---|
| committer | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2016-05-30 09:48:32 +0300 |
| commit | aa7839f9905353fbec2d4573cc9bc47468cf284d (patch) | |
| tree | bce95a2c10f92246d5b738d5f4cfbf376c159db6 /tools | |
| parent | 6f6f04108d401cb6374859a52964f49c5217a7b2 (diff) | |
| parent | 1b50bc472726ded1db2db5d747be168a6867d2ca (diff) | |
merged to trunk
[ Eleni Maria Stea ] * PanelView: Don't draw it if the geo doesn't intersect the monitor geo (as in ezoom) [ Marco Trevisan (Treviño) ] * Bumping version to 7.5.0, as per 7.4 release [ Andrea Azzarone ] * Do not reset the shortcut for icons that have their own shortcut. (LP: #1562847) * Fallback to "background" class in case no background is specified for title bars and top panel. (LP: #1575527) * GnomeKeyGrabber: do not activate an action if it's a repeated one. (LP: #1572241) * Properly calculate array indexes to avoid crashes. (LP: #1570843) * Properly remove SoftwareCenterLauncherIcon in case of failure. (LP: #1553165) * Update ExpoLauncherIcon in case the quicklist is used to switch vp. (LP: #1525685) [ Marco Trevisan (Treviño) ] * DashStyle: ensure LazyLoadTexture disconnects from signals on destruction (LP: #1580212) * Releasing Unity 7.4.0 * SwitcherController: don't try to get a window from empty selections (LP: #1580211) * SwitcherView: close the mouse-selected application on middle-click (LP: #1574689) * UnityScreen, UnityWindow: cleanup a little the code, and ensure overridden CompositeWindow functions get actually called [ handsome_feng ] * Change the x_offset of expo when launcher position changed. (LP: #1573897, #1562348) [ Andrea Azzarone ] * Do not use pointers to LazyLoadTextures. (LP: #1569100) * Fix unity script crash. (LP: #1566565) * LockscreenController: Don't use SetActivate(False) for gnome- screensaver to prevent unlocking on tty switch. It will not only deactivate the screensaver but also unlock the screen. (LP: #1552537) * unityshell.xml: Fix typo (LP: #1559427) [ Andrea Azzarone ] * Improve the "lock on suspend" logic to always keep in sync the inhibitor with the lockscreen. [ Marco Trevisan (Treviño) ] * DecoratedWindow: Just send estimated extents on _NET_REQUEST_FRAME_EXTENTS (LP: #1368118) * TextureCache: add support for loading themed textures (LP: #903179, #1208790) * Unity: stop unity7 upstart instance if needed and restart it if not clearly requested (LP: #1555633) * ForceQuitDialog: set client leader [ Andrea Azzarone ] * ApplicationLauncherIcon: use the starting property to show an icon when launched (LP: #676457) [ Marco Trevisan (Treviño) ] * UserPromptView: don't hide local scale property (LP: #1551820) [ Sebastien Bacher ] * set the gettext domain directly in CMakeLists rather than using refering to the project name, the translation template is updated during the build by dh_translations which is not clever enough to understand the variable (LP: #1557081) [ handsome_feng ] * Dash: move it down when the launcher is positioned at the bottom. (LP: #1552630) * Launcher: add Bottom mode, so that the launcher can be positioned horisontally (LP: #1552630) [ Andrea Azzarone ] * Add a "Format..." option to volume icons. (LP: #1057008) [ Marco Trevisan (Treviño) ] * DashView: ensure that we update scaling when monitor changes (LP: #1546690) * DecoratedWindow: move the shadow under the window if we've a client- side decorated window with corners (LP: #1516403) * LauncherController: add overlay shortcut to all the WindowedLauncherIcon's we have * ThemeSettings: add small class for reading gtk settings for theming (LP: #1543757, #1288998) [ Andrea Azzarone, Didier Roche ] * Gnome-software launcher integration. [ Marco Trevisan (Treviño) ] * GnomeFileManager: use *WithTimestamp file operations instead of using Activate workaround (LP: #1445595) * unity.migrations: add 04_unity_update_software_center_desktop_file [ Robert Ancell ] * Drop unused build-dependency on libgee-dev. * Switch from Ubuntu Software Center to GNOME Software. (LP: #1547129) [ Didier Roche ] * debian: Recommends session-shortcuts, prodiving easy way to shutdown, reboot and logout from dash [ Marco Trevisan (Treviño) ] * CMake: use GNUInstallDirs with native multi-arch support (LP: #1508635, #1485668) * Launcher: add FileManager, Trash and Volume icons integration (LP: #1524721, #1161323, #1063838, #1063823) * SwitcherModel: avoid to access to invalid selection or to divide by zero (LP: #1537524) [ handsome_feng ] * Extend the lockscreen theme for kylin. * Multiarchify the library packages. (bzr r4067.7.11)
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/CMakeLists.txt | 5 | ||||
| -rwxr-xr-x | tools/migration-scripts/02_unity_setup_text_scale_factor | 5 | ||||
| -rw-r--r-- | tools/migration-scripts/04_unity_update_software_center_desktop_file | 36 | ||||
| -rwxr-xr-x | tools/unity.cmake | 51 |
4 files changed, 74 insertions, 23 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 24dfc2280..e92776dd0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,9 +1,8 @@ # # Some unity tools # -install(FILES makebootchart.py PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/unity/) +install(FILES makebootchart.py PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity) install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ -GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION bin) - +GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/tools/migration-scripts/02_unity_setup_text_scale_factor b/tools/migration-scripts/02_unity_setup_text_scale_factor index 4b6fec3db..b4d42557d 100755 --- a/tools/migration-scripts/02_unity_setup_text_scale_factor +++ b/tools/migration-scripts/02_unity_setup_text_scale_factor @@ -28,11 +28,12 @@ UNITY_UI_SETTINGS = "com.canonical.Unity.Interface"; UNITY_UI_SETTINGS_PATH = "/com/canonical/unity/interface/" UNITY_TEXT_SCALE_FACTOR = "text-scale-factor"; -if GNOME_UI_SETTINGS not in Gio.Settings.list_schemas(): +gnome_ui_schema = Gio.SettingsSchemaSource.get_default().lookup(GNOME_UI_SETTINGS, recursive=False) +if not gnome_ui_schema: print("No gnome desktop interface schemas found, no migration needed") sys.exit(0) -text_scale_factor = Gio.Settings(schema=GNOME_UI_SETTINGS).get_double(GNOME_TEXT_SCALE_FACTOR) +text_scale_factor = Gio.Settings(settings_schema=gnome_ui_schema).get_double(GNOME_TEXT_SCALE_FACTOR) # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf! # Gio.Settings(schema=UNITY_UI_SETTINGS).set_int(UNITY_TEXT_SCALE_FACTOR, text_scale_factor) diff --git a/tools/migration-scripts/04_unity_update_software_center_desktop_file b/tools/migration-scripts/04_unity_update_software_center_desktop_file new file mode 100644 index 000000000..3521b68be --- /dev/null +++ b/tools/migration-scripts/04_unity_update_software_center_desktop_file @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# Copyright (C) 2016 Canonical +# +# Authors: +# Marco Trevisan <marco.trevisan@canonical.com> +# +# 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 the Free Software +# Foundation; version 3. +# +# This program is distributed in the hope that it will be useful, but WITHOUTa +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from gi.repository import Gio + +UNITY_LAUNCHER_SETTINGS = "com.canonical.Unity.Launcher"; +UNITY_LAUNCHER_SETTINGS_PATH = "/com/canonical/unity/launcher/" +UNITY_LAUNCER_FAVORITES = "favorites"; + +favorites = Gio.Settings(schema=UNITY_LAUNCHER_SETTINGS).get_strv(UNITY_LAUNCER_FAVORITES) + +for i in range(len(favorites)): + if 'ubuntu-software-center.desktop' in favorites[i]: + favorites[i] = favorites[i].replace('ubuntu-software-center', 'org.gnome.Software') + +# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf! +from subprocess import Popen, PIPE, STDOUT +p = Popen(("dconf load "+UNITY_LAUNCHER_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT) +p.communicate(input=bytes("[/]\n"+UNITY_LAUNCER_FAVORITES+"={}".format(favorites), 'utf-8')) diff --git a/tools/unity.cmake b/tools/unity.cmake index 787c920ca..e018ab1bd 100755 --- a/tools/unity.cmake +++ b/tools/unity.cmake @@ -28,6 +28,7 @@ import subprocess import sys import time +DEFAULT_COMMAND = "compiz --replace" home_dir = os.path.expanduser("~%s" % os.getenv("SUDO_USER")) supported_prefix = "/usr/local" @@ -67,17 +68,20 @@ def reset_launcher_icons (): '''Reset the default launcher icon and restart it.''' subprocess.Popen(["gsettings", "reset" ,"com.canonical.Unity.Launcher" , "favorites"]) -def process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_file): +def is_upstart_session(): + return 'UPSTART_SESSION' in os.environ.keys() and len(os.environ['UPSTART_SESSION']) + +def process_and_start_unity (compiz_args): '''launch unity under compiz (replace the current shell in any case)''' cli = [] - if debug_mode > 0: + if options.debug_mode > 0: # we can do more check later as if it's in PATH... if not os.path.isfile('/usr/bin/gdb'): print("ERROR: you don't have gdb in your system. Please install it to run in advanced debug mode.") sys.exit(1) - elif debug_mode == 1: + elif options.debug_mode == 1: cli.extend(['gdb', '-ex', 'run', '-ex', '"bt full"', '--batch', '--args']) elif 'DESKTOP_SESSION' in os.environ: print("ERROR: it seems you are under a graphical environment. That's incompatible with executing advanced-debug option. You should be in a tty.") @@ -88,15 +92,19 @@ def process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_ if options.compiz_path: cli.extend([options.compiz_path, '--replace']) else: - cli.extend(['compiz', '--replace']) + cli.extend(DEFAULT_COMMAND.split()) if options.verbose: cli.append("--debug") - if args: + if compiz_args: cli.extend(compiz_args) - if log_file: - cli.extend(['2>&1', '|', 'tee', log_file]) + if options.log: + cli.extend(['2>&1', '|', 'tee', options.log]) + + if is_upstart_session(): + if b'start/running' in subprocess.check_output("status unity7".split()): + subprocess.call("stop unity7".split()) # kill a previous compiz if was there (this is a hack as compiz can # sometimes get stuck and not exit on --replace) @@ -110,24 +118,29 @@ def process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_ if re.match(rb"^compiz\b", cmdline): compiz_env = open(os.path.join(pid_path, "environ"), "rb").read() if display in compiz_env.decode(sys.getdefaultencoding()): - subprocess.call (["kill", "-9", pid]) + subprocess.call(["kill", "-9", pid]) except IOError: continue - # shell = True as it's the simpest way to | tee. - # In this case, we need a string and not a list - # FIXME: still some bug with 2>&1 not showing everything before wait() - return subprocess.Popen(" ".join(cli), env=dict(os.environ), shell=True) + run_command = " ".join(cli) + + if is_upstart_session() and run_command == DEFAULT_COMMAND and not options.ignore_upstart: + return subprocess.Popen("start unity7".split()) + else: + # shell = True as it's the simpest way to | tee. + # In this case, we need a string and not a list + # FIXME: still some bug with 2>&1 not showing everything before wait() + return subprocess.Popen(" ".join(cli), env=dict(os.environ), shell=True) -def run_unity (verbose, debug, advanced_debug, compiz_path, compiz_args, log_file): +def run_unity (compiz_args): '''run the unity shell and handle Ctrl + C''' try: - debug_mode = 2 if advanced_debug else 1 if debug else 0 - subprocess.call(["stop", "unity-panel-service"]) - unity_instance = process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_file) - subprocess.call(["start", "unity-panel-service"]) + options.debug_mode = 2 if options.advanced_debug else 1 if options.debug else 0 + if is_upstart_session(): subprocess.call(["stop", "unity-panel-service"]) + unity_instance = process_and_start_unity (compiz_args) + if is_upstart_session(): subprocess.call(["start", "unity-panel-service"]) unity_instance.wait() except KeyboardInterrupt as e: try: @@ -180,6 +193,8 @@ if __name__ == '__main__': help="Store log under filename.") parser.add_option("--replace", action="store_true", help="Run unity /!\ This is for compatibility with other desktop interfaces and acts the same as running unity without --replace") + parser.add_option("--ignore-upstart", action="store_true", + help="Run unity without upstart support") parser.add_option("--reset", action="store_true", help="(deprecated: provided for backwards compatibility)") parser.add_option("--reset-icons", action="store_true", @@ -202,4 +217,4 @@ if __name__ == '__main__': if options.replace: print ("WARNING: This is for compatibility with other desktop interfaces please use unity without --replace") - run_unity (options.verbose, options.debug, options.advanced_debug, options.compiz_path, args, options.log) + run_unity(args) |
