! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Updated patch implementing gravity option
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Jean-Pierre Demailly 2018-12-17 10:12:57 CET
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
Comment 1 Andre Miranda editbugs 2018-12-19 04:25:10 CET
*** Bug 14957 has been marked as a duplicate of this bug. ***
Comment 2 Andre Miranda editbugs 2018-12-19 04:32:55 CET
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.
Comment 3 Andre Miranda editbugs 2018-12-19 04:55:43 CET
*** Bug 3746 has been marked as a duplicate of this bug. ***
Comment 4 Jean-Pierre Demailly 2018-12-19 18:42:17 CET
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.
Comment 5 Simon Steinbeiss editbugs 2018-12-19 20:11:56 CET
@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?
Comment 6 Andre Miranda editbugs 2018-12-19 20:19:55 CET
(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)"
Comment 7 Jean-Pierre Demailly 2018-12-19 20:21:17 CET
@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.
Comment 8 Simon Steinbeiss editbugs 2018-12-19 21:27:07 CET
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.
Comment 9 Git Bot editbugs 2018-12-22 02:13:26 CET
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
Comment 10 Andre Miranda editbugs 2018-12-22 02:19:22 CET
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.
Comment 11 Simon Steinbeiss editbugs 2018-12-22 23:42:24 CET
(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.
Comment 12 Jean-Pierre Demailly 2018-12-23 21:50:00 CET
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.
Comment 13 Andre Miranda editbugs 2018-12-27 00:04:32 CET
Created attachment 8201 
ask_arrange_icons.diff

See the attached patch, it asks for confirmation before arranging icons, please review the wording.
Comment 14 Jean-Pierre Demailly 2018-12-27 14:35:22 CET
Created attachment 8202 
Patch for fr.po for new arrange icons stuff
Comment 15 Jean-Pierre Demailly 2018-12-27 14:36:08 CET
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.
Comment 16 Andre Miranda editbugs 2018-12-27 15:43:05 CET
(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
Comment 17 Git Bot editbugs 2018-12-30 19:04:29 CET
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
Comment 18 Andre Miranda editbugs 2018-12-30 19:06:26 CET
@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.

Bug #14979

Reported by:
Jean-Pierre Demailly
Reported on: 2018-12-17
Last modified on: 2018-12-30
Duplicates (2):
  • 3746 [enh] Change stacking position/orientation of new icons
  • 14957 Icon placement option for xfdesktop

People

Assignee:
Eric Koegel
CC List:
3 users

Version

Version:
4.13.2

Attachments

Patch to xfdesktop-4.13.2 implementing gravity option (25.86 KB, patch)
2018-12-17 10:12 CET , Jean-Pierre Demailly
no flags
reviewed patch (30.86 KB, patch)
2018-12-19 04:32 CET , Andre Miranda
no flags
tooltip.diff (1.20 KB, patch)
2018-12-22 02:19 CET , Andre Miranda
no flags
ask_arrange_icons.diff (2.47 KB, patch)
2018-12-27 00:04 CET , Andre Miranda
no flags
Patch for fr.po for new arrange icons stuff (2.41 KB, patch)
2018-12-27 14:35 CET , Jean-Pierre Demailly
no flags

Additional information