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 609871 - Add the workspaces view key to the gconf schema
Add the workspaces view key to the gconf schema
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-13 21:39 UTC by Dan Winship
Modified: 2010-03-12 18:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add the workspaces view key to the gconf schema (1.54 KB, patch)
2010-02-13 21:40 UTC, Dan Winship
reviewed Details | Review
Add the workspaces view key to the gconf schema (4.39 KB, patch)
2010-02-22 17:57 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2010-02-13 21:39:58 UTC
maybe we should rename the key to something less generic at the same time?
Comment 1 Dan Winship 2010-02-13 21:40:00 UTC
Created attachment 153735 [details] [review]
Add the workspaces view key to the gconf schema
Comment 2 drago01 2010-02-15 11:45:18 UTC
(In reply to comment #0)
> maybe we should rename the key to something less generic at the same time?

Yes we should rename it to something like "overview_workspace_layout" ... "view" is indeed to generic.
Comment 3 Owen Taylor 2010-02-19 19:38:25 UTC
Review of attachment 153735 [details] [review]:

I'd definitely like to see the key renamed as part of this. If short name and the name of the GConf key aren't pretty much the same thing, then something is wrong.

(Would it be better to use strings rather than 0/1? I don't really know what we typically do in GNOME. Think Metacity uses strings for enums. Not a blocker for landing this though if we want to change to strings, renaming the key is a good time to do it and avoid adding compat code.)
Comment 4 Dan Winship 2010-02-22 17:57:43 UTC
Created attachment 154421 [details] [review]
Add the workspaces view key to the gconf schema

renamed the key to overview/workspaces_view and the values to "single"
and "grid". I also changed WorkspacesViewType.MOSAIC to .GRID to match,
because it's not a mosaic... (I didn't change MosaicView though.)

> (Would it be better to use strings rather than 0/1? I don't really know
> what we typically do in GNOME.

gconf prefers strings, and even has helper functions to convert between
enum values and strings. I'm not totally sure I'm happy with the way I
did this here, but it seemed silly to do it by iterating through all the
values comparing numbers and strings like the C helpers do...
Comment 5 Owen Taylor 2010-02-22 18:42:10 UTC
Review of attachment 154421 [details] [review]:

Looks good, needs a better commit message that mentions the other changes in the patch.

::: js/ui/workspacesView.js
@@ +959,3 @@
+
+        let view = this._gconf.get_string(WORKSPACES_VIEW_KEY).toUpperCase();
+        if (view in WorkspacesViewType)

Eww :-)
Comment 6 Florian Müllner 2010-02-22 18:47:38 UTC
(In reply to comment #4)
> [...] (I didn't change MosaicView though.)

Why not?
Comment 7 Dan Winship 2010-02-22 22:01:33 UTC
didn't feel like making a big invasive change
Comment 8 Dan Winship 2010-02-22 22:02:37 UTC
Attachment 154421 [details] pushed as e5ba414 - Add the workspaces view key to the gconf schema
Comment 9 Joseph Scheuhammer 2010-03-12 18:34:50 UTC
I'm getting a failure to launch GnomeShell because the GConf client is returning null for the WORKSPACES_VIEW_KEY.

Here is the stack trace:

---
    JS ERROR: !!!   Exception was: TypeError: this._gconf.get_string(WORKSPACES_VIEW_KEY) is null
    JS ERROR: !!!     lineNumber = '970'
    JS ERROR: !!!     fileName = '/home/clown/gnome-shell/source/gnome-shell/js/ui/workspacesView.js'
    JS ERROR: !!!     stack = '()@/home/clown/gnome-shell/source/gnome-shell/js/ui/workspacesView.js:970
WorkspacesViewSwitch()@/home/clown/gnome-shell/source/gnome-shell/js/ui/workspacesView.js:960
()@/home/clown/gnome-shell/source/gnome-shell/js/ui/overview.js:200
Overview()@/home/clown/gnome-shell/source/gnome-shell/js/ui/overview.js:189
start()@/home/clown/gnome-shell/source/gnome-shell/js/ui/main.js:115
@<main>:1
'
    JS ERROR: !!!     message = 'this._gconf.get_string(WORKSPACES_VIEW_KEY) is null'
Window manager warning: Log level 32: Execution of main.js threw exception: TypeError: this._gconf.get_string(WORKSPACES_VIEW_KEY) is null

---

Checking with Configuration Editor reveals no such key at "/desktop/gnome/shell/overview/workspaces_view".

A simple fix might be to set the local variable 'view' to the empty string if GConf returns null, although I'm not an expert on what this code is doing.
Comment 10 Dan Winship 2010-03-12 18:41:11 UTC
the crash is bug 611214; it shouldn't happen if you're using jhbuild
Comment 11 Colin Walters 2010-03-12 18:41:19 UTC
(In reply to comment #9)
> I'm getting a failure to launch GnomeShell because the GConf client is
> returning null for the WORKSPACES_VIEW_KEY.

Try updating your jhbuild checkout (cd ~/Source/jhbuild && git pull -r )
Comment 12 Joseph Scheuhammer 2010-03-12 18:58:56 UTC
(In reply to comment #10)

Thanks guys.  I am using jbuild.

> Try updating your jhbuild checkout (cd ~/Source/jhbuild && git pull -r )

That did it.