Open octalmage opened 10 years ago
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.
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.
What steps will reproduce the problem?
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