-
Notifications
You must be signed in to change notification settings - Fork 804
Fix bug which caused duplicate applet orders when dropping them in the same position #13057
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
base: master
Are you sure you want to change the base?
Conversation
I can't figure out what this does. What bug does it fix? |
@fredcw Occasionally, if you drag and drop an applet that is next to another applet in the same position, it will cause two applets to have an order of 0. In cinnamon looking glass you can tell if it occurred when you see that the applet was reloaded when dropping it. |
Yes, I see the problem. This solution doesn't work though because you can end up with an applet having a panel position of -1. I think instead that the function should quit early if I would rewrite it like this: 4021e1d |
You're right, that is better. Thanks! |
7e5ee77
to
202d576
Compare
Ended up reverting to the previous way of doing this. The early return can prevent the user from dropping an applet in an empty location. The added check My way works fine, and an applet cannot end up with a panel position of -1. This check prevents it |
You're right sorry, I miss-edited the code I tested with. You can however have positions 1 and 2 instead of 0 and 1 in a zone with 2 applets:
This is due to an error in
here
If
I'm not sure what you mean, the icon just floats back to it's original position indicating an invalid drop or no change. The problem with the way you've done it is that it's complicated enough to be hard to follow the logic and figure out what's going on even if it does work. Code needs to be readable and easy to follow. |
202d576
to
0f8628b
Compare
No description provided.