After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647394 - Allow dock extension to be in other positions than right
Allow dock extension to be in other positions than right
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: extensions
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-10 22:00 UTC by Marc Alcalà
Modified: 2011-05-23 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Modification done (16.75 KB, text/plain)
2011-04-10 22:01 UTC, Marc Alcalà
  Details
Patch without GSettings. (5.03 KB, patch)
2011-04-11 14:05 UTC, Marc Alcalà
none Details | Review
Get parameters from GSettings (untested) (3.06 KB, patch)
2011-04-15 23:59 UTC, Marc Alcalà
none Details | Review
Get parameters from GSettings "org.gnome.shell.extensions.dock" (2.59 KB, application/x-tar)
2011-04-16 18:39 UTC, Marc Alcalà
  Details
Get parameters from GSettings "org.gnome.shell.extensions.dock". Using enums (3.59 KB, application/x-compressed-tar)
2011-04-16 22:31 UTC, Marc Alcalà
  Details
all in 1 (5.99 KB, patch)
2011-04-22 10:56 UTC, Marc Alcalà
committed Details | Review

Description Marc Alcalà 2011-04-10 22:00:19 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.
Comment 1 Marc Alcalà 2011-04-10 22:01:58 UTC
Created attachment 185668 [details]
Modification done
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-04-10 22:39:51 UTC
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/
Comment 3 Giovanni Campagna 2011-04-11 13:13:37 UTC
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)
Comment 4 Marc Alcalà 2011-04-11 14:05:28 UTC
Created attachment 185701 [details] [review]
Patch without GSettings.
Comment 5 Marc Alcalà 2011-04-11 14:06:22 UTC
Nice idea Giovanni, I will try.
Comment 6 Giovanni Campagna 2011-04-11 16:11:40 UTC
By the way, I don't think we should allow 'bottom', as that conflicts with message tray and notifications in banner mode.
Comment 7 Marc Alcalà 2011-04-11 19:02:44 UTC
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
Comment 8 Marc Alcalà 2011-04-11 19:09:48 UTC
Auto reply :)
http://developer.gnome.org/gio/stable/glib-compile-schemas.html
Comment 9 Milan Bouchet-Valat 2011-04-11 19:17:45 UTC
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
Comment 10 Florian Müllner 2011-04-11 19:24:35 UTC
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.
Comment 11 Giovanni Campagna 2011-04-12 16:40:53 UTC
(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)
Comment 12 Marc Alcalà 2011-04-15 23:59:15 UTC
Created attachment 186056 [details] [review]
Get parameters from GSettings (untested)

First apply "185701: Patch without GSettings.", then this patch.
Comment 13 Marc Alcalà 2011-04-16 00:16:46 UTC
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?
Comment 14 Milan Bouchet-Valat 2011-04-16 09:29:08 UTC
Have you run glib-compile-schemas /usr/share/glib-2.0/schemas as root?
Comment 15 Marc Alcalà 2011-04-16 12:50:22 UTC
This breaks my GSettings.
All the schemas disappear. I have had to reinstall Gnome.
Comment 16 Milan Bouchet-Valat 2011-04-16 13:36:52 UTC
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...)
Comment 17 Marc Alcalà 2011-04-16 18:06:06 UTC
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.
Comment 18 Marc Alcalà 2011-04-16 18:24:12 UTC
Ok it's working. I modified nautilus.gschema.override and now compiles ok.
Comment 19 Marc Alcalà 2011-04-16 18:39:52 UTC
Created attachment 186088 [details]
Get parameters from GSettings "org.gnome.shell.extensions.dock"
Comment 20 Milan Bouchet-Valat 2011-04-16 19:57:12 UTC
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
Comment 21 Marc Alcalà 2011-04-16 22:31:47 UTC
Created attachment 186113 [details]
Get parameters from GSettings "org.gnome.shell.extensions.dock". Using enums
Comment 22 Adam Dingle 2011-04-17 19:26:02 UTC
(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 23 Giovanni Campagna 2011-04-21 14:18:54 UTC
Comment on attachment 186113 [details]
Get parameters from GSettings "org.gnome.shell.extensions.dock". Using enums

Please squash everything into a single patch.
Comment 24 Marc Alcalà 2011-04-22 10:56:24 UTC
Created attachment 186472 [details] [review]
all in 1
Comment 25 Giovanni Campagna 2011-04-22 12:06:20 UTC
Review of attachment 186472 [details] [review]:

Looks good!