-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix dnd with chrome #156
Fix dnd with chrome #156
Conversation
Before approving we should discuss if reversing the stack list is correct - or if we should use the bottom to top order in stack list to begin with. I didn't make this change yet because I couldn't remember if there a reason we went to top to bottom on stack list. |
Great catch. As for the ordering I am not sure. I think the window order was based on the order we would display them on switcher. So either we reverse it here, or in the switcher code. We should probably document the order in the |
wm.go
Outdated
@@ -14,13 +14,13 @@ type WindowManager interface { | |||
} | |||
|
|||
// Stack describes an ordered list of windows. | |||
// The order of the windows in this list matches the stacking order on screen. | |||
// TopWindow() returns the 0th element with each item after that being stacked below the previous. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I forgot that we defined it this way around.
Are we certain that reversing it for all platforms is the right thing to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any reason why it wouldn't be fine for any other platform -- I'm not certain though. However I'm less certain that having it top to bottom is the right thing to do. So far we have one implementation - X and it says bottom to top. That should be fine for Wayland from what I can tell so far too... I would say between the two there isn't a lot of certainty of which one is better - but the one concrete thing we have and know is how the one platform we have wants it bottom to top and from a code stand point that means less conversions and slice walking so I think that tips that scales for me.
Code changes should have removed approval
I jumped over to WinGo as an example of another WM in go - they have stacked it how we previously did: |
Yes and they had to provide a helper function to convert it. Walking the slice to convert the stack changes on every focus, raise, lower, add, and remove of windows surely isn't ideal, and appending new windows or raised windows to the end of a slice surely makes more sense than inserting them at the beginning. |
If The X11 driver code wants to use the reverse order for performance reasons then that is fair enough. Another approach would be that the |
Fair enough - I reverted the interface/switcher changes and made the change to reverse the stack on Windows() method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this feels like a nice clean change and a very welcome fix :)
This fixes dnd with chrome and fixes #49