! 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 !
Expand icon spacing to fill the screen.
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Matias De lellis 2013-05-10 16:26:16 CEST
Created attachment 5033 
Attached small screenshot

Hi,
I would like that space between icons allows to use all the space on the desktop.

Particularly, usually place the trash at the bottom right of the desktop, but keeps too much space in this corner. Attached small screenshot to see. (90px on button and 70 px pn left) I can not get closer, wasting space and it looks ugly.. :S
Comment 1 Matias De lellis 2014-09-04 03:31:00 CEST
Created attachment 5627 
Dynamically add space between the icons to fill the screen
Comment 2 Matias De lellis 2014-09-04 03:32:55 CEST
Created attachment 5628 
After: Icons are distributed equitably to the entire screen
Comment 3 Matias De lellis 2014-09-04 03:53:57 CEST
Hi all,
It is not worthy of merging, as It is the first result, but grateful that you test it.

* There duplicated code (That probably will not be a problem, but not elegant)
* Not tested in xinerama.
* I do not know. must test it. :S

Regards.
Matias.
Comment 4 Matias De lellis 2014-09-06 01:53:50 CEST
Created attachment 5632 
My desktop looks before the patch.
Comment 5 Matias De lellis 2014-09-06 01:56:23 CEST
Created attachment 5633 
How look after the the patch: Icons are distributed equitably to the entire screen
Comment 6 Matias De lellis 2014-09-06 02:40:51 CEST
Hi there,

First, Sorry for the span. ;S

Now attach a few screenshots for you to understand the change.. 

The first shot is xfdesktop-4.11.7, with icons distributed trying to use the larger size of the screen as possible. As you can see there is much wasted space (Both the right and bottom of the screen).
The second screenshot, is applying the patch to git.

Both screenshots have the same size of icons, panel size, number of icons, etc. but was added a space between thems to distribute more equitably around the screen.

I think the result is obvious.. Do you not like them? =) haha.

Well.. Now lets the problems.. (Nothing serious.) =)

 1. When change panel size. These are not distributed correctly again. But fixed easy commenting return on the line http://git.xfce.org/xfce/xfdesktop/tree/src/xfdesktop-icon-view.c#n3406
 1.a: this brings another problem: Basically write a new configuration file icons (Also is described here: https://bugzilla.xfce.org/show_bug.cgi?id=7823). any time that change the size, and when save distribution and resize the panel, this saves the distribution again. When move any icon, an return to first size, returns to the original position, forgetting all changes..

 Difficult to explain, but in short, steps to reproduce the new bug:
  1: Apply the patch, comment line http://git.xfce.org/xfce/xfdesktop/tree/src/xfdesktop-icon-view.c#n3406 and compile.
  2: Change panel size to size+1;
  3: Change any icon position. (Move it erratically to understand better.)
  4: Repeat 3 and 4.
  5: Change panel size to size-1;
  6: Again change panel size to size-1;

Basically xfdesktop wrote 3 configuration files for each panel size, and the icons they move "erratically" as have saved.

I can improve the patch, but I need some help to fix this. Please.. Someone want to help? =)

Regards,
Matias.
Comment 7 Matias De lellis 2014-09-06 02:58:42 CEST
Hi,
Excuse again the span.. haha​​..

The way to fix it is change the file format which saves the configuration:

Now is: ~/.config/xfce4/desktop/icons.screen[Screen-Number]-[Usable-Desktop-Size].rc

Usable-Desktop-Size is approximated as: (real_screen_size - panel_size - 16 (The 16 is due margins)

Okay. Would have to change this format to ~/.config/xfce4/desktop/icons.screen[Screen-Number]-[ICONS-ON-ROW]x[ICONS-ON-COLUMS].rc

Thus, xfdesktop not write new files unless absolutely necessary!.

This is writed here: http://git.xfce.org/xfce/xfdesktop/tree/src/xfdesktop-file-icon-manager.c#n1801

Any official maintainer wanted to do it? =)
Comment 8 Eric Koegel editbugs 2014-09-08 09:29:41 CEST
Hey, Sorry. I'm usually busy during the week and only have time to work on stuff during my day off. I will hopefully look into this more later today.

One comment I have is that at some point it would be nice to support allowing the user to place icons anywhere rather than by a grid, which is why I didn't do the row x col.rc format. So we'd have to migrate back to the width x height.rc at some point. Is there a way we can make this work with the width x height during save/restore?

Removing the DBG("old_size == new_size exiting"); code isn't a big deal. I added it because some systems were having grid resize events a lot during xfdesktop startup. I was just trying to make it ignore those so it didn't recalc the grid over and over. With your patch it would make a difference so we could remove it.
Comment 9 Matias De lellis 2014-09-08 16:52:16 CEST
Hey,
(In reply to Eric Koegel from comment #8)
> Hey, Sorry. I'm usually busy during the week and only have time to work on
> stuff during my day off. I will hopefully look into this more later today.

Not worry we all have our responsibilities. =)

> One comment I have is that at some point it would be nice to support
> allowing the user to place icons anywhere rather than by a grid, which is
> why I didn't do the row x col.rc format. So we'd have to migrate back to the
> width x height.rc at some point.

Personally prefer the ordering that only allows a grid, but it would be interesting to have it .. =)

> Is there a way we can make this work with the width x height during save/restore? 

MM.. Maybe, when move an icon (we assume that it will reorganize to taste), remove the cache of other size. Basically, do not store pocicion in all sizes. While it did not move anything, we can assume that the user can repent and return to the panel size to move their icons to their original positions.
If you change it once, we assume that no matter the original positions.

> Removing the DBG("old_size == new_size exiting"); code isn't a big deal. I

No. Need comment the return. Not the debug.. haha. ;)
But again, this path has zero quality. I can improve it (Addind marging and space properties to avoid constantly recalculating it), but I'll try to do the least intrusive possible.

> added it because some systems were having grid resize events a lot during
> xfdesktop startup. I was just trying to make it ignore those so it didn't
> recalc the grid over and over. With your patch it would make a difference so
> we could remove it.

This part did not investigate much, so I ask help to official maintainers. However, it is not something that is continually running, only when the useful screen size changes.

Regards.
Comment 10 Matias De lellis 2014-09-09 04:29:21 CEST
Created attachment 5644 
[Patch] Add a space between icons to fill the entire screen.

In general cleanup of previous patch.
* The margin and spaces variables are added as private members. (Do not continually recalculate its)
* Now the icons are automatically accommodated when you resize the panel, etc.
  * With this patch, the cache operates as usual.. only saved when the grid changes. That IMHO is not ideal, but less traumatic.
* Yes now updates the grid every time necessary independently if change the number of icons, but I think it is not intrusive. Making a deeper restructuring of the code, may be avoided but I think is not worth it.

Off course, We must to test intensively, but I think was able to be commited. ;)
Comment 11 Matias De lellis 2014-09-09 16:04:59 CEST
D'Oh!.
I forgot one small detail.. :(

Xinerama,
Never tested it and now guess that xfdesktop always distribute the icons like the monitor0, and monitor[1,n] never make their own calculations to make them look good.

Honestly, I no have hardware to test it properly, and still not quite understand the code completely to write it. Also, I never test the original code to know their behavior and comment properly..
Comment 12 Eric Koegel editbugs 2014-09-09 18:33:40 CEST
Don't feel bad I can't test dual monitors at the moment either...

But Xinerama should just work, to xfdesktop it's just one big screen so it's the same as changing resolution to play a game and then changing back. That was the primary reason for the different resolution files to being with (it also fixes the issue where your monitor does screen resolution changes during system startup).

I'm looking to do a dev release of xfdesktop shortly for the Xubuntu guys since they requested it. After that we can merge this in and give it more testing. I'll also poke Simon, he usually is good at the small visual changes that I overlook.
Comment 13 Matias De lellis 2014-09-09 19:45:25 CEST
(In reply to Eric Koegel from comment #12)
> Don't feel bad I can't test dual monitors at the moment either...

Tomorrow maybe can do some tests.

> But Xinerama should just work, to xfdesktop it's just one big screen so it's
> the same as changing resolution to play a game and then changing back. That
> was the primary reason for the different resolution files to being with (it
> also fixes the issue where your monitor does screen resolution changes
> during system startup).

Excellent reasons, (I had never considered screen changes due to games) but also will have the same results considering only the size of the grid. However now it works exactly as before, so we can ignore this discussion for now. ;)

Well, If it really is a big screen, it should work perfectly.

The only detail is that on the second screen, the first column of icons probably does not have enough space, and will are viewable only from the second column.

Hard to explain in the air without testing, but basically missing adding two additional margins to icons of the second screen.

This is not due my changes, the original code has the same problem. But it's 
nothing serious. In summary, in the first screen the icons will look properly, and the second will have a different margin.

It can be fixed, but add a lot of complexity to the code, especially the calculation of dnd the second monitor.

The current patch works, only that in xinerama (which only a few people use), the second screen will have an additional space to the left. And again, the same is true in the original code

Need test it, but if it is the only problem, I will not propose further changes in this bug.

> I'm looking to do a dev release of xfdesktop shortly for the Xubuntu guys
> since they requested it. After that we can merge this in and give it more
> testing.

Of course. These changes should not affect any plans to release that have already established.

> I'll also poke Simon, he usually is good at the small visual
> changes that I overlook.

+1
Comment 14 Matias De lellis 2014-09-11 16:56:43 CEST
Well,
In the few tests that i made (Fast, due use one of the monitors of the school), it seems to work properly.

By "properly", understood, it is fully usable.. Due to the code checks that the icon is completely settles in a unique screen. (Do not allow the icon to display the middle of each side).

Therefore, there is a margin on the right of the first monitor, and one to the left of the second monitor (Where there would be a column of icons, which fails to completely placed in any of the two monitors).

The good thing is that the code does not allow to use this space, and works properly.

You could say that in xinerama does not meet with the mission of this bug, but it works to expand the vertical icons, and also seen correctly to the right of second monitor. The only problem is the space between the two monitors.

As I said, this is very difficult to improve, more than I imagined, therefore I will not propose any new change to improve more xinerama (Unless, of course, that this introduces a problem).

So, Test it and write me anything. Always happy to help. =)

Regards,
Matias.

p.s: The examples are using the notebook as monitor0, and an external monitor as monitor1 placed on the right. The same applies to the left, or analogously configured vertically. ;)
Comment 15 Matias De lellis 2014-09-17 18:09:25 CEST
Created attachment 5652 
Add a space between icons to fill the entire screen.

Any change.. Just updated to latest changes in git.
Comment 16 Matias De lellis 2014-09-17 18:37:56 CEST
Created attachment 5653 
Add a space between icons to fill the entire screen.

Add a space between icons to fill the entire screen.
Any new change. Just updated to the latest changes in git.

NOTE: The patch uploaded a moment ago was wrong. Sorry!. This is correct!.
Comment 17 Eric Koegel editbugs 2014-09-21 07:19:34 CEST
Thanks, pushed to master in:

commit 9f0ed62821804ac49dabb20e3580f09a19a036b9
Author: Matias De lellis <mati86dl@gmail.com>
Date:   Wed Sep 17 13:33:54 2014 -0300

    Add a space between icons to fill the entire screen.
http://git.xfce.org/xfce/xfdesktop/commit/?id=9f0ed62821804ac49dabb20e3580f09a19a036b9

Bug #10078

Reported by:
Matias De lellis
Reported on: 2013-05-10
Last modified on: 2014-09-21

People

Assignee:
Eric Koegel
CC List:
4 users

Version

Version:
Unspecified

Attachments

Additional information