GNOME Bugzilla – Bug 647394
Allow dock extension to be in other positions than right
Last modified: 2011-05-23 20:44:39 UTC
I modified the dock extension adding a global define (POSITION) that changes the position of the dock. Allowed values are RIGHT, LEFT and BOTTOM.
Created attachment 185668 [details] Modification done
Can you attach a patch instead of the modified file, preferably created with git-format-patch? git-bz may help you: http://fishsoup.net/software/git-bz/
Also, it would be nice if you could use GSettings instead of hardcoding constants. You can see examples of schemas in the other directories. (Using a GSettings enum would be nice, but I don't know how supported it is from JS. A string is fine)
Created attachment 185701 [details] [review] Patch without GSettings.
Nice idea Giovanni, I will try.
By the way, I don't think we should allow 'bottom', as that conflicts with message tray and notifications in banner mode.
I also added the possibility to change size of icons with a GSettings key. But I can't test if works, because I can't found any information about install a new schema in GSettings. By the way if I install the extension user-theme (that uses GSettings) don't works. I think because don't installs the schema in GSettings. To install user-theme I did: ./autogen.sh --prefix=$HOME/.local --enable-extensions="user-theme" make install
Auto reply :) http://developer.gnome.org/gio/stable/glib-compile-schemas.html
Using GSettings enums from JS works, but of course we don't get the automated headers generation. So you need to create a JS enum reflecting the schema, and then use it with settings.get/set_enum(). See for example the magnifier's MouseTrackingMode enum[1]. Using enums is nice because it allows dconf-editor and gnome-teak-tool to show the list of choices with names without any special code. ;-) 1: http://git.gnome.org/browse/gnome-shell/tree/js/ui/magnifier.js
I'm not sure we should encourage extensions to provide a GSettings schema. The original intend of extensions was firefox-style installation from a web site into the user's home - and as far as I can tell, this is still the plan. Even if it is possible to do some trickery with env variables, it doesn't sound like something which should be endorsed.
(In reply to comment #10) > I'm not sure we should encourage extensions to provide a GSettings schema. The > original intend of extensions was firefox-style installation from a web site > into the user's home - and as far as I can tell, this is still the plan. Even > if it is possible to do some trickery with env variables, it doesn't sound like > something which should be endorsed. Unless GIO starts looking in ~/.local/share/glib-2.0/schemas, at which point everything just works. (Bug 645254)
Created attachment 186056 [details] [review] Get parameters from GSettings (untested) First apply "185701: Patch without GSettings.", then this patch.
I copied the schema to /usr/share/glib-2.0/schemas/ but doesn't appears in GSettings. # cp org.gnome.shell.extensions.dock.gschema.xml /usr/share/glib-2.0/schemas/ then, after logout and login session. If I do: $ gsettings list-children org.gnome.shell calendar org.gnome.shell.calendar clock org.gnome.shell.clock recorder org.gnome.shell.recorder What I'm doing wrong? I'm expecting something like this: $ gsettings list-children org.gnome.shell calendar org.gnome.shell.calendar clock org.gnome.shell.clock recorder org.gnome.shell.recorder extensions org.gnome.shell.extensions right?
Have you run glib-compile-schemas /usr/share/glib-2.0/schemas as root?
This breaks my GSettings. All the schemas disappear. I have had to reinstall Gnome.
Keep cool... Have you already reinstalled everything? It shouldn't be needed. ;-) Does glib-compile-schemas output anything? Have you tried removing the schema file you manually copied and compiling schemas again? Maybe it's invalid and it makes glib-compile-schemas unhappy. (That's why it's interesting to use jhbuild and only hack things in a non-system directory...)
Hehe don't worry is fast. This is the output: No such key `exit-with-last-window' in schema `org.gnome.nautilus.preferences' as specified in override file `./nautilus.gschema.override'; ignoring override for this key.
Ok it's working. I modified nautilus.gschema.override and now compiles ok.
Created attachment 186088 [details] Get parameters from GSettings "org.gnome.shell.extensions.dock"
It could be good to report your glib-compile-schemas bug in glib: the output says "OK, just skipping the override", while the result seems to be that a broken compiled file is created. This means a broken file like that can break people's whole desktop... About the patches, from a quick look at them, I think you shouldn't use uppercase for variable names POSITION and DOCKICON_SIZE, nor for the enum values in the schemas. Upper case is only used in JS code to identify constants, and in the schemas there's no point in using "RIGHT" instead of "right". Also, as I wrote in comment #9, it would be better to use a GSettings enum instead of a string key, because that way gnome-tweak-tool and dconf-editor can list possible choices in a combo box. Documentation for using enums in schemas is at http://developer.gnome.org/gio/unstable/GSettings.html and code using them in the Shell it at http://git.gnome.org/browse/gnome-shell/tree/js/ui/magnifier.js
Created attachment 186113 [details] Get parameters from GSettings "org.gnome.shell.extensions.dock". Using enums
(In reply to comment #6) > By the way, I don't think we should allow 'bottom', as that conflicts with > message tray and notifications in banner mode. Actually I think that 'bottom' should be allowed. I've been running an external dock program at the bottom of the display with GNOME Shell for a few weeks now. It's true that the notifications appear down there too which is a minor nuisance. But nevertheless this is my preferred dock position: having the panel at the top and the dock at the bottom is nicely symmetrical, and a central position is convenient to access with the mouse.
Comment on attachment 186113 [details] Get parameters from GSettings "org.gnome.shell.extensions.dock". Using enums Please squash everything into a single patch.
Created attachment 186472 [details] [review] all in 1
Review of attachment 186472 [details] [review]: Looks good!