Compare commits

...

4 Commits

Author SHA1 Message Date
Debarshi Ray
28585a817a workspace: Use the schema for the current mode to get 'button-layout'
https://bugzilla.gnome.org/show_bug.cgi?id=689234
2012-11-28 19:25:46 +01:00
Debarshi Ray
8b5d07c1a5 main: Use the schema for the current mode to override 'button-layout'
https://bugzilla.gnome.org/show_bug.cgi?id=689234
2012-11-28 19:25:46 +01:00
Debarshi Ray
6cbdb6beae sessionMode: Define a new foo mode
A new parameter called buttonLayout was introduced to parametrize the
schema used for the 'button-layout' setting.

https://bugzilla.gnome.org/show_bug.cgi?id=689234
2012-11-28 19:25:46 +01:00
Debarshi Ray
b8f9a108f9 data: Add a new schema for foo mode
The foo mode will have a different default value for button-layout as
compared to the standard GNOME 3 mode. To avoid one mode from
overwriting the setting from another, lets use a different schema
for this mode.

https://bugzilla.gnome.org/show_bug.cgi?id=689234
2012-11-28 19:25:46 +01:00
6 changed files with 49 additions and 10 deletions

View File

@ -54,7 +54,9 @@ keys_in_files = \
$(NULL)
keys_DATA = $(keys_in_files:.xml.in=.xml)
gsettings_SCHEMAS = org.gnome.shell.gschema.xml
gsettings_SCHEMAS = \
org.gnome.shell.gschema.xml \
org.gnome.shell-foo.gschema.xml
@INTLTOOL_XML_NOMERGE_RULE@
@ -81,7 +83,8 @@ EXTRA_DIST = \
$(menu_DATA) \
$(convert_DATA) \
$(keys_in_files) \
org.gnome.shell.gschema.xml.in.in
org.gnome.shell.gschema.xml.in.in \
org.gnome.shell-foo.gschema.xml.in.in
CLEANFILES = \
gnome-shell.desktop.in \
@ -91,4 +94,6 @@ CLEANFILES = \
$(gsettings_SCHEMAS) \
gschemas.compiled \
org.gnome.shell.gschema.valid \
org.gnome.shell.gschema.xml.in
org.gnome.shell.gschema.xml.in \
org.gnome.shell-foo.gschema.valid \
org.gnome.shell-foo.gschema.xml.in

View File

@ -0,0 +1,13 @@
<schemalist>
<schema id="org.gnome.shell-foo.overrides" path="/org/gnome/shell-foo/overrides/"
gettext-domain="@GETTEXT_PACKAGE@">
<key name="button-layout" type="s">
<default>":minimize,close"</default>
<_summary>Arrangement of buttons on the titlebar</_summary>
<_description>
This key overrides the key in org.gnome.desktop.wm.preferences when
running GNOME Shell in Foo mode.
</_description>
</key>
</schema>
</schemalist>

View File

@ -109,6 +109,8 @@ function start() {
Gio.DesktopAppInfo.set_desktop_env('GNOME');
sessionMode = new SessionMode.SessionMode();
Meta.prefs_override_preference_schema(sessionMode.buttonLayout[0], sessionMode.buttonLayout[1]);
shellDBusService = new ShellDBus.GnomeShell();
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();

View File

@ -21,6 +21,7 @@ const _modes = {
isLocked: false,
isGreeter: false,
isPrimary: false,
buttonLayout: ['button-layout', 'org.gnome.shell.overrides'],
unlockDialog: null,
components: [],
panel: {
@ -101,6 +102,29 @@ const _modes = {
right: ['a11y', 'keyboard', 'volume', 'bluetooth',
'network', 'battery', 'userMenu']
}
},
'foo': {
hasOverview: true,
showCalendarEvents: true,
allowSettings: true,
allowExtensions: true,
hasRunDialog: true,
hasWorkspaces: true,
hasWindows: true,
hasNotifications: true,
isLocked: false,
isPrimary: true,
buttonLayout: ['button-layout', 'org.gnome.shell-foo.overrides'],
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
components: ['networkAgent', 'polkitAgent', 'telepathyClient',
'keyring', 'recorder', 'autorunManager', 'automountManager'],
panel: {
left: ['activities', 'appMenu'],
center: ['dateMenu'],
right: ['a11y', 'keyboard', 'volume', 'bluetooth',
'network', 'battery', 'userMenu']
}
}
};

View File

@ -30,9 +30,6 @@ const CLOSE_BUTTON_FADE_TIME = 0.1;
const DRAGGING_WINDOW_OPACITY = 100;
const BUTTON_LAYOUT_SCHEMA = 'org.gnome.shell.overrides';
const BUTTON_LAYOUT_KEY = 'button-layout';
// When calculating a layout, we calculate the scale of windows and the percent
// of the available area the new layout uses. If the values for the new layout,
// when weighted with the values as below, are worse than the previous layout's,
@ -554,8 +551,8 @@ const WindowOverlay = new Lang.Class({
let button = this.closeButton;
let title = this.title;
let settings = new Gio.Settings({ schema: BUTTON_LAYOUT_SCHEMA });
let layout = settings.get_string(BUTTON_LAYOUT_KEY);
let settings = new Gio.Settings({ schema: Main.sessionMode.buttonLayout[1] });
let layout = settings.get_string(Main.sessionMode.buttonLayout[0]);
let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL;
let split = layout.split(":");

View File

@ -174,8 +174,6 @@ shell_prefs_init (void)
OVERRIDES_SCHEMA);
meta_prefs_override_preference_schema ("workspaces-only-on-primary",
OVERRIDES_SCHEMA);
meta_prefs_override_preference_schema ("button-layout",
OVERRIDES_SCHEMA);
meta_prefs_override_preference_schema ("edge-tiling",
OVERRIDES_SCHEMA);
meta_prefs_override_preference_schema ("focus-change-on-pointer-rest",