Created attachment 8187 Patch to xfdesktop-4.13.2 implementing gravity option Dear All, Here is a complete implementation of a "gravity option" for xfdesktop (8 modes depending on three flags : GRAVITY_HORIZONTAL=1, GRAVITY_RIGHT=2, GRAVITY_BOTTOM=4). it works fine here, including rearrangement of icons that is now implemented taking into account gravity. The right click menu of the desktop root window brings a new "gravity submenu". By default, though, setting gravity does not rearrange the icons (as users may prefer their own arrangement rather than what xfdesktop would do by default). The patch is with respect to xfdesktop-4.13.2, it should also essentially work with earlier version 4.12. Best, Jean-Pierre
*** Bug 14957 has been marked as a duplicate of this bug. ***
Created attachment 8190 reviewed patch I have reviewed/simplified your patch, here are my comments: - I removed the context menu and introduced a combo box in Desktop Settings -> Icons - I understand but don't fancy the duplicated nested fors in xfdesktop_grid_get_next_free_position and xfdesktop_next_slot, though I don't know how to avoid them - you may use git diff to generate patches - please pay attention to whitespace and avoid the temptation to fix the indentation of parts of code unrelated to the modification. Please check if it still works.
*** Bug 3746 has been marked as a duplicate of this bug. ***
The modified patch works fine here with the git source code. Thanks for the nice implementation of the option in Desktop Settings -> Icons, that's a more natural place for it.
@Andre: I tried your patch on top of current git master, but it didn't work for me (icon positions never changed). I presume from the user perspective it should be as simple as changing the combo box value to get a different grid layout..? Does this maybe conflict with something that went into master after 4.13.2 like the primary display feature?
(In reply to Simon Steinbeiss from comment #5) > @Andre: I tried your patch on top of current git master, but it didn't work > for me (icon positions never changed). I presume from the user perspective > it should be as simple as changing the combo box value to get a different > grid layout..? > Does this maybe conflict with something that went into master after 4.13.2 > like the primary display feature? You need to select the "Arrange Desktop Icons" from the context menu. Quoting Jean-Pierre: "(as users may prefer their own arrangement rather than what xfdesktop would do by default)"
@Simon @Andre : the intent of the new option is not to change the icons already in place, just to change the default placement of the next icons or files to be created. After adjusting the orientation, a click on "Arrange Desktop Icons" should however have an effect.
Ah, I see - thanks now it works! I'm not sure if that "arrange icons" thing is really great/intuitive/easily-discoverable. In theory you could pop up a dialog asking you whether you want to re-arrange your icons according to that layout now, but that may also be annoying... Maybe an "apply" button next to that combo-box..? One thing I noticed: with the primary option your desktop icons get moved to the display that is now marked as "primary" (you can set this via the display dialog or xrandr) and this also affects the icon layout to some extent. xfdesktop actually seems to correctly remember all icon positions, almost like a display profile. Maybe this all works as it should or as you would expect it, just saying, maybe test this part a little bit. It feels semi-confusing after the first minutes.
Jean-Pierre Demailly referenced this bugreport in commit 608d0d4a51378e138bc064d7ce86c67e88951155 Add orientation option to arrange icons (Bug #14979) https://git.xfce.org/xfce/xfdesktop/commit?id=608d0d4a51378e138bc064d7ce86c67e88951155
Created attachment 8192 tooltip.diff Pushed to master, thanks Jean-Pierre! (In reply to Simon Steinbeiss from comment #8) > I'm not sure if that "arrange icons" thing is really > great/intuitive/easily-discoverable. In theory you could pop up a dialog > asking you whether you want to re-arrange your icons according to that > layout now, but that may also be annoying... Maybe an "apply" button next to > that combo-box..? I agree, just not sure how to improve this. As xfdesktop-settings is an independent process, it's not possible to directly call the arrange icons function, we would need to expose it via dbus, too troublesome I think, so let's avoid it for now. I tried an infobar+revealer below that row, but the grid's column becomes too spaced. I also tried an information button beside the combobox to show a popover, but the popover label didn't wrap... What do you think of the attached patch? > One thing I noticed: with the primary option your desktop icons get moved to > the display that is now marked as "primary" (you can set this via the > display dialog or xrandr) and this also affects the icon layout to some > extent. xfdesktop actually seems to correctly remember all icon positions, > almost like a display profile. Maybe this all works as it should or as you > would expect it, just saying, maybe test this part a little bit. It feels > semi-confusing after the first minutes. Looks good to me, let's see if users complain.
(In reply to Andre Miranda from comment #10) > Created attachment 8192 > tooltip.diff > > Pushed to master, thanks Jean-Pierre! > > (In reply to Simon Steinbeiss from comment #8) > > I'm not sure if that "arrange icons" thing is really > > great/intuitive/easily-discoverable. In theory you could pop up a dialog > > asking you whether you want to re-arrange your icons according to that > > layout now, but that may also be annoying... Maybe an "apply" button next to > > that combo-box..? > I agree, just not sure how to improve this. As xfdesktop-settings is an > independent process, it's not possible to directly call the arrange icons > function, we would need to expose it via dbus, too troublesome I think, so > let's avoid it for now. I tried an infobar+revealer below that row, but the > grid's column becomes too spaced. I also tried an information button beside > the combobox to show a popover, but the popover label didn't wrap... What do > you think of the attached patch? Why not just call "xfdesktop --arrange" on the command-line (g_spawn_command_line_async) instead? No infobar or dbus needed from my pov.
A call "xfdesktop --arrange" from xfdesktop-settings seems to work here. In my opinion, the rearrangement should not be enforced - an ad hoc "rearrange icons: yes/no" popup dialog on a change of orientation would seem appropriate, especially for users that do not realize they can use the right click desktop menu for this purpose.
Created attachment 8201 ask_arrange_icons.diff See the attached patch, it asks for confirmation before arranging icons, please review the wording.
Created attachment 8202 Patch for fr.po for new arrange icons stuff
I just applied "ask_arrange_icons.diff" and made a test on my setup - it works fine. Please find above a patch for a translation to French of the additional strings.
(In reply to Jean-Pierre Demailly from comment #14) > Created attachment 8202 > Patch for fr.po for new arrange icons stuff We don't update .po files directly, they are handled via Transifex[1][2]. 1 - https://www.transifex.com/xfce/public/ 2 - https://docs.xfce.org/contribute/translate/start
Andre Miranda referenced this bugreport in commit 725c1927d851f134d55dbc3174411436800e67ed Ask to arrange icons when icon orientation is changed (Bug #14979) https://git.xfce.org/xfce/xfdesktop/commit?id=725c1927d851f134d55dbc3174411436800e67ed
@Jean-Pierre, thanks for this improvement! @Simon, thanks for suggesting g_spawn_command_line_async, if you have any other suggestion or would like to improve the message wording, let me know at #xfce-dev.