GNOME Bugzilla – Bug 544700
[PATCH] Treat expandable applets as fully expanded when finding free spot
Last modified: 2020-11-06 20:20:53 UTC
The algorithm for finding a free spot when you right click on a menu item and say "Add this launcher to panel" starts at the left and works its way right until it finds a free pixel that isn't absolutely claimed by an applet already. This breaks down when you have an expandable applet near the left. If you organize your panel with the Window List on the very left, and you "Add this launcher to panel" for any launcher, it squished the Window List down to just the drag handle. I'm attaching a patch that treats the Window List (or any expandable applet) as expanded as much as it can be so that new applets will go to it's right. It leaves one pixel free so that the expandable applet does allow its space to be taken. Expandable applets are not treated as expanded for the purposes of a 'free move' like when you are moving applets with your mouse. In that case, you still want the user to see the effect on the expandable applets. This patch should only affect the 'auto placement' algorithm. This patch is against gnome-panel 2.22.1, but it's small, and I assume it applies cleanly against SVN.
Created attachment 115252 [details] [review] Proposed patch
Oh, and the patch is copyright Canonical, Ltd.
Thanks for the patch. I didn't have time to test it, but how does it work if (assuming the standard layout) I click in the middle of the bottom panel to add an applet. Does it add the applet in the middle or at the right of the panel? I'd think that fully expanded would be wrong too -- we want to leave some space, not all space. But maybe your patch already does that?
With this patch, if you click in the middle of the bottom panel, it will still use that location. This patch only modifies the "find a free pixel and I don't care where it is" algorithm. It's not _quite_ fully expanded. It's fully expanded minus one pixel (which gives the panel applet the hook -- it consumes what space it needs after it is created).
Just a friendly poke about this patch. I confirmed the bug in 2.27, and the patch still applies cleanly to master. It's easy to test: 1) Have your normal 'Applications/Places/System' on top left 2) Add a 'Window List' applet (or any expandable applet) to the top and slide it so it abuts the main menu. Make sure it's snug and there are no pixels in between. 3) Go to any application in the main menu (e.g. Accessories/Calculator), right click it, and say 'Add this launcher to Panel'. 4) Note how your window list got squished.
I can easily reproduce this using the steps in comment 5. The patch still applies cleanly to 2.30.2.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years. If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/ Thank you for reporting this issue and we are sorry it could not be fixed.