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

Z-Order is not preserved when switching desktops #2

Open
octalmage opened this issue Jun 18, 2014 · 2 comments
Open

Z-Order is not preserved when switching desktops #2

octalmage opened this issue Jun 18, 2014 · 2 comments
Labels

Comments

@octalmage
Copy link
Owner

octalmage commented Jun 18, 2014

What steps will reproduce the problem?

  1. Observe window A on top of window B
  2. Switch to another desktop and switch back
  3. Observe window B on top of window A

I expect to see the same window that was on top be on top. Instead what I see is as if I did an Alt+Tab to switch between the top two windows in the Z-Order

Source: https://code.google.com/p/mdesktop/issues/detail?id=11

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2710093-z-order-is-not-preserved-when-switching-desktops?utm_campaign=plugin&utm_content=tracker%2F1897034&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1897034&utm_medium=issues&utm_source=github).
@octalmage octalmage added the bug label Jun 18, 2014
@octalmage
Copy link
Owner Author

I've tried to resolve this issue before without much luck. When I grab the list of visible windows it's suppose to grab them in order, but for some reason this doesn't always happen. So as a "hack" I store the top most window then move that to the front when I switch back to the desktop. I'll see if I can find a more reliable way to get the windows in order.

@MPagel
Copy link

MPagel commented Sep 10, 2014

Z order problems extend to the taskbar window order, as well as the desktop display order.

It seems to me that your application is treating it as a FIFO system, rather than LIFO (or vice versa?:P) for a given application. I do not stack/collapse the windows of one application into a single entity, but rather I have a taskbar item for each open window. Windows 8/7 (and I think vista) clump all windows from the same application as a contiguous group on the taskbar.

In the following A, B, C and D are applications, 1-x are windows. * is the topmost active window. For simplicity all other windows are minimized.
If I have
A1
A2*
A3
A4
A5
B1
B2
C1
D1
D2

This will sort (upon paging away and back to the desktop)
A2*
A5
A4
A3
A1
B2
B1
C1
D2
D1

If the order was
A1
A2
A3
B1
B2*
C1
D1

This reorders as
B2
B1
A3
A2
A1
C1
D1

So...It looks like active windows are assumed to be on the "top" of the Z order of the taskbar. I also witness the behavior of this bug report: Z order is being reversed for desktop windows (at least within an application)

I think the solution is to put the most recently active windows into the queue first, followed by the other windows DESC by datetime (if possible: for taskbar by time created, rather than accessed; for desktop by non-minimized, then by access time). Then you pop them off the top of the stack, so the oldest windows/applications get seeded onto the desktop first upon reload and your recent and active windows get placed on the new desktop last.

@octalmage octalmage added bug and removed bug labels Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants