Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[request] Do not reorder window thumbnails after clicking on them #639

Closed
k3a opened this issue Nov 9, 2017 · 27 comments
Closed

[request] Do not reorder window thumbnails after clicking on them #639

k3a opened this issue Nov 9, 2017 · 27 comments

Comments

@k3a
Copy link

k3a commented Nov 9, 2017

I have Dash to dock configured to display previews of opened windows after clicking on the icon of an app with multiple windows open. That works nicely, after clicking on the second window it switches to that window. Problem is, the next time I click on the app icon, the currently focused window is first in the list.

Can it be made so that it would sort windows in the order of their creation and keep the order?
It can be (hidden) configuration option, I guess it would be quick to implement?

The same applies to proposed "Show window previews on mouse hover" functionality (#574).

Thanks

@micheleg
Copy link
Owner

The idea is that the fist window is always the active app, or the last used window. This is consistent with the behaviour of the alt+tab/alt+` window switcher. I agree it can be confusing at moments. I would need to play with this behaviour and see how it would work. Do you know what MS Windows does in its implementation?

@k3a
Copy link
Author

k3a commented Nov 12, 2017

For some reason I find that reordering annoying, not sure why. Maybe Mac OS doesn't reorder it. I will check it in Windows and Mac and report back. Thanks

@micheleg
Copy link
Owner

Does MacOS have a similar feature? I didn't know that.

@Lchu613
Copy link

Lchu613 commented Nov 17, 2017

This is indeed the default behavior in windows as well as in dash-to-panel. While I understand the logic behind the current design, I think it would be nice to implement as a feature at least since it's less disorienting to users like me who are used to static ordering.
(It would be cool also to allow drag-and-drop reordering of window previews, although that's not a feature that's present in Windows either).

@k3a
Copy link
Author

k3a commented Nov 23, 2017

Sorry for taking it so long, I have tripple boot, but it's pain to reboot when I have lots of windows open.

Mac
mac

The menu after right-clicking. Currently selected window has a tick symbol, minimized one has a diamond symbol.

  • Hover : just displays an app title, quickly changing as you move over the icons
  • Left click: brings all app windows to foreground (minus minimized windows)
  • Right click: brings the app menu with list of all windows on the top. This list is statically ordered. Clicking on an item brings the window to foreground.

Windows

  • Hover : after a bit of delay the displays window previews with items statically ordered by window creation time.
  • Left click: just quickly display/hides window preview
  • Right click: shows app menu

So yes, the ordering is static in both OSes. I returned back to GNU/Linux after some time working on Mac so that's why I find this reorder annoying. :)

@d2a-raudenaerde
Copy link

d2a-raudenaerde commented Jun 6, 2018

Maybe just highlight the last used / active window instead of putting it on top? That would always be useful, even if the current one is on top :)

@oosterholt
Copy link

Maybe this behavior can be configured via a setting. So the default behavior displays the most recent active window as fist and one can choose to not have the order of the window changed.

@PureLines
Copy link

The same problem.
@micheleg, please, add this feature to your plans.

@thenewnano
Copy link

The reordering is really confusing to me and many of my colleagues that are experienced programers I kind of forced to upgrade to 18.04 also do suffer because of this issue, as one sometimes want to switch to another window and switch back just to find out that the top order of the windows has changed.
Honestly Ubuntu without this extension is lacking a lot and this feature... that it totally breaking any interactive design rules to my understanding is really pity to have to deal with.
I have now turned off previews that is default on Ubuntu and chosen switch windows instead but would really like to have previews with a static order.
Please prioritise this.
Can we maybe put together another pull request to just have this behaviour configurable or changed ? is merging changes to Ubuntu dash goes trough another approval process or merging here will at some point make its way to that branch as well?

@micheleg
Copy link
Owner

@thenewnano @PureLines can yuo checkout this branch https://github.com/micheleg/dash-to-dock/tree/feature/windows_previews_static_order?

I have change the behaviour to be a stable order (from the first to the latest launched window I believe), which implies no separation between windows on different workspace is considered. This only applies to the dedicated popup menu (i.e. the onw available as a click option), which I believe is where the confusion mostly happens.

Is this the behaviour you are looking for? Does it work as expected?

@thenewnano
Copy link

Hi @micheleg YES!
Thank you , I just yesterday started trying out another plug in, now I feel back at home again!

I did check out the branch and run it and it is exactly how we wanted it to behave!
I tested also across workspaces, it also behaves as expected, window previews are now static and predictable.
Please merge this to master as soon as possible and I'll start migrating all users to dash to dock from Ubuntu dock for now.

@PureLines
Copy link

Is this the behaviour you are looking for? Does it work as expected?

Yes! Thank you a lot, @micheleg!
Now it works perfectly!

@8none1
Copy link

8none1 commented Oct 31, 2018

I’d like us to get this merged in to the Ubuntu version this cycle too. Thank you very much for working on it!

@oosterholt
Copy link

I've tested the feature/windows_previews_static_order version as well and now the window preview works exactly how I would expect it to.
Would be nice to have this as an option in the release.

@silcowitz
Copy link

+1 for static order of windows in the dock. So unbearable having to click through similarly looking windows all day long, to find the one you need.

@micheleg
Copy link
Owner

micheleg commented Dec 2, 2018

I've merged the branch in master [86f4404] as the new and only behaviour, as it seems indeed more reasonable than the current one.

@micheleg micheleg closed this as completed Dec 2, 2018
@vainyksi
Copy link

vainyksi commented Dec 6, 2018

Hi, I just want to note.
If anyone wants to apply the patch [86f4404] to running ubuntu 18.04 without extensions enabled, it needs to just update file /usr/share/gnome-shell/extensions/ubuntu-dock@ubuntu.com/windowPreview.js and restart gnome-shell (Alt + F2 and then r enter).

@GriffinCodes
Copy link

Hi, I'm running Dash to Dock v64 in gnome-tweak-tools extensions on ubuntu 18.10, and I'm still having windows re-order themselves by most recently used. How would I go about adding this patch to my machine?

@micheleg
Copy link
Owner

@zbynekwinkler
Copy link

Any chance for v65 appearing on https://extensions.gnome.org/extension/307/dash-to-dock/?

@doom-fr
Copy link

doom-fr commented Jun 24, 2019

Thank you so much @vainyksi !

@bviktor
Copy link

bviktor commented Aug 14, 2019

Current patch that works on up-to-date 18.04:

--- windowPreview.js.orig	2019-01-21 11:39:02.000000000 +0100
+++ windowPreview.js	2019-08-14 12:10:32.207495268 +0200
@@ -188,15 +188,6 @@
     },
 
     _redisplay: function () {
-        // Remove separator
-        let nonWinItem = this._getMenuItems().filter(function(actor) {
-                return !actor._window;
-            });
-        for (let i = 0; i < nonWinItem.length; i++) {
-             let item = nonWinItem[i];
-             item.destroy();
-        }
-
         let children = this._getMenuItems().filter(function(actor) {
                 return actor._window;
             });
@@ -206,8 +197,10 @@
                 return actor._window;
             });
 
-        // All app windows
-        let newWin = this._source.getInterestingWindows().sort(this.sortWindowsCompareFunction);
+        // All app windows with a static order
+        let newWin = this._source.getInterestingWindows().sort(function(a, b) {
+            return a.get_stable_sequence() > b.get_stable_sequence();
+        });
 
         let addedItems = [];
         let removedActors = [];
@@ -271,26 +264,6 @@
                 item.actor.destroy();
         }
 
-        // Separate windows from other workspaces
-        let ws_index = global.screen.get_active_workspace_index();
-        let separator_index = 0;
-        for (let i = 0; i < newWin.length; i++)
-            if (newWin[i].get_workspace().index() == ws_index)
-                separator_index++;
-
-        if (separator_index > 0 && separator_index !== newWin.length) {
-            let separatorItem = new PopupMenu.PopupSeparatorMenuItem();
-            if (this.isHorizontal) {
-                separatorItem._separator.set_x_expand(false);
-                separatorItem._separator.set_y_expand(true);
-                separatorItem._separator.set_name('dashtodockPreviewSeparator');
-                separatorItem._separator.add_style_class_name('popup-separator-menu-item-horizontal');
-                separatorItem._separator.set_x_align(Clutter.ActorAlign.CENTER);
-                separatorItem._separator.set_y_align(Clutter.ActorAlign.FILL);
-            }
-            this.addMenuItem(separatorItem, separator_index);
-        }
-
         // Skip animations on first run when adding the initial set
         // of items, to avoid all items zooming in at once
         let animate = this._shownInitially;
@@ -346,18 +319,6 @@
         return this.actor.get_children().reduce(function(result, actor) {
                    return result || actor.animatingOut;
                }, false);
-    },
-
-    sortWindowsCompareFunction: function(windowA, windowB) {
-        let ws_index = global.screen.get_active_workspace_index();
-        let winA_inActiveWS = windowA.get_workspace().index() == ws_index;
-        let winB_inActiveWS = windowB.get_workspace().index() == ws_index;
-
-        // Only change the order if winA is not in the current WS, while winB is
-        if (!winA_inActiveWS && winB_inActiveWS)
-            return 1;
-
-        return 0;
     }
 });
 

@rarajks
Copy link

rarajks commented Oct 29, 2019

Hi, I just want to note.
If anyone wants to apply the patch [86f4404] to running ubuntu 18.04 without extensions enabled, it needs to just update file /usr/share/gnome-shell/extensions/ubuntu-dock@ubuntu.com/windowPreview.js and restart gnome-shell (Alt + 2 and then r enter).

Thanks for the help. It worked! Just to avoid confusion for others, it is Alt + F2

@vghero
Copy link

vghero commented Nov 15, 2019

THANK YOU :D! This was really annoying...

@tommai78101
Copy link

tommai78101 commented May 12, 2020

Just to add, for someone like me who is new to applying patch files to code.

  1. Set your current working directory to /usr/share/gnome-shell/extensions/ubuntu-dock@ubuntu.com/ using cd.
  2. Type sudo cp windowPreview.js windowPreview.js.old.
  3. Type sudo nano windowPreview_patch.
  4. Copy the git diff patch content from @bviktor above.
  5. Paste the contents in the nano.
  6. Save and exit nano.
  7. Type patch windowPreview.js windowPreview_patch
  8. Press ALT+F2
  9. Type "restart" or "r" for short.
  10. Press Enter.

@lon9man
Copy link

lon9man commented Nov 18, 2020

Ubuntu 18.10
i changed windowPreview.js, restarted (Alt+F2) and i don't see any effect.
any thoughts?

@divyanshj16
Copy link

divyanshj16 commented Dec 18, 2020

My Gnome didn't restart.

got it fixed:
In patch: 86f4404, do not modify L349
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests