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 591645 - Opening an application on a new workspace
Opening an application on a new workspace
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-08-13 02:37 UTC by Shane Fagan
Modified: 2010-05-13 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for this bug (1.13 KB, patch)
2009-11-06 16:48 UTC, Maxim Ermilov
needs-work Details | Review
proposed patch (1.14 KB, patch)
2010-04-14 20:54 UTC, Christina Boumpouka
reviewed Details | Review
updated patch (6.01 KB, patch)
2010-05-05 10:11 UTC, Christina Boumpouka
needs-work Details | Review
updated patch (6.10 KB, patch)
2010-05-05 22:42 UTC, Christina Boumpouka
committed Details | Review
Make the workspace added on the middle mouse button click active (1.52 KB, patch)
2010-05-12 19:10 UTC, Marina Zhurakhinskaya
none Details | Review
Make the workspace added on the middle mouse button click active (1.90 KB, patch)
2010-05-12 19:22 UTC, Marina Zhurakhinskaya
committed Details | Review
Don't add a new workspace when the maximum workspaces limit is reached (6.09 KB, patch)
2010-05-12 22:23 UTC, Marina Zhurakhinskaya
committed Details | Review

Description Shane Fagan 2009-08-13 02:37:17 UTC
Opening an application in a new workspace similar to how firefox opens a link in a new tab. 
Using middle click for mice with 3 mouse buttons
left and right click together for mice with 2 mouse buttons 
ctrl+click for single button mice.
Comment 1 Shane Fagan 2009-08-13 02:42:01 UTC
This was first mentioned here http://bugzilla.gnome.org/show_bug.cgi?id=579760 and provides similar functionality but having a consistent UI with a very popular program like firefox couldnt hurt.  
Comment 2 Turbo 2009-08-16 16:08:11 UTC
I second that. Especially closing windows by middle-clicking on them is a important feature. The whole interface feels very tabby so it should behave accordingly.
Comment 3 Shane Fagan 2009-08-17 19:07:14 UTC
Ill work on it at the start of September if no one else does it before then bit busy at the moment.
Comment 4 Rovanion Luckey 2009-10-15 14:22:25 UTC
This is a good idea that brings ease to the process of window-manangement
Comment 5 Maxim Ermilov 2009-11-06 16:48:24 UTC
Created attachment 147114 [details] [review]
Patch for this bug

<Ctrl>+<first mouse button> already in use.
This patch, Bind second mouse button to open an application on a new workspace.
Comment 6 Shane Fagan 2009-11-08 15:25:43 UTC
@maxim the patch looks ok at first glance thanks for working on it (I forgot to finish mine because of college stuff) have you tested it?
Comment 7 Dan Winship 2009-11-13 16:24:50 UTC
bug 597320 suggests using middle-click for "open a new window" instead
Comment 8 lexual 2009-12-10 04:07:37 UTC
middle-click opening a new window makes more sense to me.
If you want to open on new workspace you can drag icon to "add workspace" button in bottom right corner.
Comment 9 Dan Winship 2010-02-25 20:00:21 UTC
it's been agreed on bug 597320 that "open a new window" makes more sense
Comment 10 Owen Taylor 2010-03-09 21:08:29 UTC
(In reply to comment #9)
> it's been agreed on bug 597320 that "open a new window" makes more sense

Not sure of the history, but it turns out that control-click already means "open a new window", so there's no point in using middle click for that. Reopening this bug.
Comment 11 Owen Taylor 2010-03-09 21:09:53 UTC
Review of attachment 147114 [details] [review]:

Patch doesn't seem to correspond to the current code, and also needs to handle BaseAppSearchProvider for a consistent experience.
Comment 12 Rovanion Luckey 2010-03-09 23:14:45 UTC
In that case it makes more sense to use the middlemouse to open a new window than a new window on a new workspace since opening a new window is a far more common action than opening a window on a new workspace. So:
Middlemouse: New window
Ctrl-mouse1 or maybe <other modifier>+mouse1: New window on new workspace
Comment 13 Hylke Bons 2010-03-20 23:23:21 UTC
"a new window is a far more
common action than opening a window on a new workspace"

I would argue that.

By using middle for opening on a new workspace we are consistent with modern web browsers and other applications that use tabs and benefit from the behaviour that users have already learnt by using those apps.
Comment 14 Christina Boumpouka 2010-04-14 20:54:40 UTC
Created attachment 158758 [details] [review]
proposed patch

> Patch doesn't seem to correspond to the current code, and also needs to handle
> BaseAppSearchProvider for a consistent experience.

I tried to update the previous patch for this bug. I didn't understand though what needs to be done about BaseAppSearchProvider.
Comment 15 Marina Zhurakhinskaya 2010-04-15 19:37:56 UTC
Review of attachment 158758 [details] [review]:

Thank you for the patch! It looks good overall and works as expected. There is just one comment about the commit message and one comment about the code below.

I think what Owen meant by handling BaseAppSearchProvider is that we should make sure that the applications shown in the search results can be opened on the new workspace the same way. In fact, it works with the current patch because AppSearchResultDisplay::renderResults() uses AppWellIcon to render results.

We can later add this functionality to other items in the overview (the code is in GerericDisplayItem in genericDisplay.js), but it might not be worth doing now with the impending re-write of the UI to support the new docs display vision: http://live.gnome.org/GnomeShell/Design/Whiteboards/FindingAndReminding 

The subject and the body that you have for your commit are pretty good, but I would suggest something more active-sounding and detailed, like:

--------------------------------------------

Add a new way to open an application on a new workspace

Allow using the middle mouse button to open a new instance of an application on a new workspace. The middle mouse button function can be achieved by clicking the left and right mouse buttons together with a two buttons mouse and holding Ctrl while clicking with a single button mouse.

--------------------------------------------

Here is an e-mail that describes the commit message style we use:
http://lists.cairographics.org/archives/cairo/2008-September/015092.html

You can also see the latest commits with 'git log' or at http://git.gnome.org/browse/gnome-shell to check out how well they adhere to that commit style among other things :).

::: js/ui/appDisplay.js
@@ +459,3 @@
             this._onActivate(event);
+        } else if (button == 2) {
+            global.screen.append_new_workspace(false, global.get_current_time()).activate(global.get_current_time());

I think it might be cleaner to rename this._workspaces in Overview.js to this.workspaces to indicate that it is a public variable and then use the following here:

Main.overview.workspaces.addWorkspace();
Comment 16 Christina Boumpouka 2010-04-20 18:24:51 UTC
(In reply to comment #15)

> ::: js/ui/appDisplay.js
> @@ +459,3 @@
>              this._onActivate(event);
> +        } else if (button == 2) {
> +            global.screen.append_new_workspace(false,
> global.get_current_time()).activate(global.get_current_time());
> 
> I think it might be cleaner to rename this._workspaces in Overview.js to
> this.workspaces to indicate that it is a public variable and then use the
> following here:
> 
> Main.overview.workspaces.addWorkspace();

It does make more sense to me to have a "workspace manager" handle
adding the new workspace, however addWorkspace() in
workspacesView.js is empty (maybe I'm using an outdated source
tree?). 
Did you mean moving the line:

global.screen.append_new_workspace(false,
global.get_current_time()).activate(global.get_current_time());

in addWorkspace()?
Comment 17 Marina Zhurakhinskaya 2010-04-20 19:00:46 UTC
If you search for addWorkspaces() in workspacesView.js, you will see that there are multiple implementations of that function. One in GenericWorkspacesView, one in MosaicView, and one in SingleView. You probably looked at the first one, which is not implemented because GenericWorkspacesView is a base class for the other two.

So Main.overview.workspaces will be set correctly to the current view because it gets it from the WorkspacesManager. You can look at WorkspacesManager::_updateView() for some relevant code. So I'm pretty sure what I suggested originally will work, which is replace the line in (button == 2) case with Main.overview.workspaces.addWorkspace(); and renaming this._workspaces in Overview.js to this.workspaces

The classes in workspacesView.js are actually a good example of how inheritance is done in JavaScript. You can find another example in genericDisplay.js/docDisplay.js/appDisplay.js
Comment 18 Christina Boumpouka 2010-05-05 10:11:46 UTC
Created attachment 160330 [details] [review]
updated patch

I updated the patch according to Marina's comments.
Comment 19 Florian Müllner 2010-05-05 11:49:21 UTC
Review of attachment 160330 [details] [review]:

This patch is an interdiff to the previous version - you need to squash both patches (= combine them into a single patch) using something like "git rebase --interactive origin/master".
Apart from that it looks good and works as advertised.
Comment 20 Christina Boumpouka 2010-05-05 22:42:39 UTC
Created attachment 160386 [details] [review]
updated patch

Thanks, I was wondering about that :)
I hope it looks better now.
Comment 21 Florian Müllner 2010-05-05 23:19:24 UTC
Review of attachment 160386 [details] [review]:

(In reply to comment #20)
> I hope it looks better now.

Yup, it does...

The formatting of the commit message could be improved - the lines are slightly too long and the bugzilla line is usually preceded by an empty line - apart from that it should be ready to go.
Comment 22 Florian Müllner 2010-05-12 18:16:57 UTC
OK, I went ahead and pushed the patch - thanks again for working on this!
Comment 23 Marina Zhurakhinskaya 2010-05-12 19:10:22 UTC
Created attachment 160924 [details] [review]
Make the workspace added on the middle mouse button click active

This ensures that we launch the new instance of an appliation on the newly
added workspace.
Comment 24 Marina Zhurakhinskaya 2010-05-12 19:22:30 UTC
Created attachment 160925 [details] [review]
Make the workspace added on the middle mouse button click active

This ensures that we launch the new instance of an application on the newly
added workspace in the grid view, in which we don't make the newly added
workspace active by default.
Comment 25 Marina Zhurakhinskaya 2010-05-12 22:23:56 UTC
Created attachment 160937 [details] [review]
Don't add a new workspace when the maximum workspaces limit is reached

It was previously possible to add a workspace above the maximum workspaces
limit by dragging an item to the "add workspace" button or using the middle
mouse button click.

Provide the user with feedback in the info bar when it is not possible to create
a new workspace or remove the current workspace.
Comment 26 Florian Müllner 2010-05-13 05:59:43 UTC
Review of attachment 160925 [details] [review]:

LGTM
Comment 27 Florian Müllner 2010-05-13 06:35:24 UTC
Review of attachment 160937 [details] [review]:

Looks good and works well.

::: js/ui/workspacesView.js
@@ +260,3 @@
+            return;
+            Main.overview.infoBar.setMessage(_("Can't remove the first workspace."));
+        if (!this.canRemoveWorkspace()) {

Trailing whitespace.