Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If there are no windows opened, it doesn't make any sense to have the Windows view as default when we go through Activities.

share|improve this question

2 Answers 2

Edit the file /usr/share/gnome-shell/js/ui/viewSelector.js with your favorite text editor. e.g.

gksudo gedit /usr/share/gnome-shell/js/ui/viewSelector.js

Search these lines (Line number = 469) :

_switchDefaultTab: function() {
    if (this._tabs.length > 0)
        this._switchTab(this._tabs[0]);
},

Change them to :

_switchDefaultTab: function() {
    if (this._tabs.length > 0) {
        let appSys = Shell.AppSystem.get_default();
        let allApps = appSys.get_running ();
        if ( allApps.length != 0) {
            this._switchTab(this._tabs[0]);
        } else {
            this._switchTab(this._tabs[1]);
        }
    }
},

And, Save and Restart Gnome-Shell.

share|improve this answer
    
I still have the Windows view as default. –  Alex Góes Fuhrmann Nov 21 '11 at 21:48
    
I tested it in gnome-shell ver. 3.2.1. When there were no windows open, I went applications view through Activities. I don't know why it doesn't work in your gnome-shell,sorry. –  wildjiji Nov 22 '11 at 1:23
    
That's alright thank you for the answer, it maybe help others. –  Alex Góes Fuhrmann Nov 22 '11 at 23:32

Change the method _switchDefaultTab() for this:

 _switchDefaultTab: function() {
   if (this._tabs.length > 0) {
    this._activeTab.hide();        
    this._switchTab(this._tabs[1]); 
   }
},

and add the next code line: "this._activeTab=viewTab"; in the method addViewTab():

addViewTab: function(id, title, pageActor, a11yIcon) {
let viewTab = new ViewTab(id, title, pageActor, a11yIcon);
this._tabs.push(viewTab);
this._tabBox.add(viewTab.title);
this._addTab(viewTab);
this._activeTab= viewTab;

},

all in the file "viewSelector.js".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.