! 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 !
Fullscreen Apps (especially SDL) cause grid resize and destroy icon placement
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Adam 2010-01-11 22:07:19 CET
Created attachment 2780 
patch to allow for disabling grid resize on resolution change

Whenever an application changes your desktop resolution (in this case to a lower one) xfdesktop resizes te grid and auto-arranges the icons.
This makes arranging my icons (something I tend to do) pointless if another application can come along and undo that.  SDL apps most commonly cause this.
I couldn't find another way to overcome this so on my system I've added the ability to ignore these resolution changes that can be set at startup or passed to a running instance.

Is this a good way to do it?  My patch is attached.  Sorry if it looks bizarre (I don't code much and even rarer does anybody else see what I do...)
Comment 1 Jaromír Cápík 2011-11-12 17:00:38 CET
Hi Adam.

I submitted a similar bug - https://bugzilla.xfce.org/show_bug.cgi?id=6653
where I proposed a little different solution, but without looking in the sources - maybe it's not even possible with the current design to do it like I proposed.

I haven't tested Your patch yet, but in this case I'm unsure what would happen with the icons if You change the resolution on purpose. Will they stay outside the screen limits -> that means invisible and unreachable?

Thanks in advance for any answer.

Jaromir.
Comment 2 Fab 2011-11-12 19:53:21 CET
Created attachment 3952 
rebased patch on 4.8.3

I don't know if the proposed patch is the best solution, but in the meanwhile I rebased it on xfdesktop-4.8.3.

This seems to work fine : xfdesktop gives me two more options that let me turn on or off the automatic resizing :

> $ xfdesktop --help | grep resize
>  --resize                 Enable icon grid resizing on resolution change
>  --noresize               Disable icon grid resizing on resolution change
Comment 3 Jaromír Cápík 2011-11-13 12:00:22 CET
I was thinking about that again and ... loosing few icons probably won't hurt anyone. At least it wouldn't be so annoying like losing the icon positions.
Comment 4 Adam 2011-11-15 15:30:36 CET
Actually, this no longer seems to be a problem (4.8.3)

Currently, it works better than my patch did (it was a dirty, dirty hack...)

The current behavior, which I feel is correct, is that I am able to run fullscreen apps that change my resolution and it doesn't change the desktop size (when exiting the app, everything is where I left it).  However, using the display application does change the desktop size and triggers auto-arrangement.

In order to do that with my patch on 4.6, you had to toggle the grid resize back on if you wanted to change your desktop size intentionally (which you could do by just running xfdesktop with the correct args; it would update a running instance).


So, does anybody actually still see this problem on 4.8.3?  If not, then it might be safe to close this as it's been handled much better than I could have (I don't quite know how that works since it's a 4.6 bug that's not present in the current 4.8).

Adam
Comment 5 Fab 2011-11-15 17:15:45 CET
(In reply to comment #4)
> So, does anybody actually still see this problem on 4.8.3?

Yes.

> The current behavior, which I feel is correct, is that I am able to run
> fullscreen apps that change my resolution and it doesn't change the desktop
> size (when exiting the app, everything is where I left it).

Not here. What is your distribution ? Is your xfdesktop patched ?
Comment 6 Adam 2011-11-16 10:42:00 CET
I use Debian unstable.  The current version is 4.8.3 (4.8.3-1)

I checked the source and it's simply a debianized upstream version (no patching at all).

I have not had to patch/rebuild this package at all since 4.8 came to debian-unstable.
Comment 7 Fab 2011-11-17 10:45:13 CET
Which application do you use to test the behavior ?

For example, here, the grid automatic resizing happens with all games running
through wine, and with supertux [1], but this does not happen with supertuxkart [2].

[1] http://supertux.lethargik.org/
[2] http://supertuxkart.sourceforge.net/
Comment 8 Adam 2011-11-18 03:02:04 CET
(In reply to comment #7)
> Which application do you use to test the behavior ?
> 
I mostly used other SDL applications (hexahop, black-box, etc).
SuperTux is an SDL application; I no longer have a problem with it (installed the package and made sure).
SuperTuxKart is not SDL, I didn't test it (I'll take your word that it's no problem)

I don't use wine too often.  I haven't used one in full-screen mode since before the switch to 4.8 (I'm pretty nitpicky about my wine instances and how I run each program).
So I tried a game and it resized my desktop and screwed up my icons. Looks like in my case, the issue remains for some apps and it looks like there is more than one way for an app to resize the screen when going fullscreen.  One affects xfdesktop4 (wine, any others?), and another does not (SDL games, at least on my system.)
Comment 9 Daniel Richard G. 2011-11-18 04:49:34 CET
I've uploaded some screenshots to bug #6589 that corroborate the problem in xfdesktop4 version 4.8.3 in Ubuntu Oneiric.
Comment 10 Eric Koegel editbugs 2011-11-18 20:34:52 CET
Created attachment 3975 
[PATCH] Modifify how xfdesktop moves icons during a grid resize to  mimic what xfwm4 does with its windows.

  This patch allows xfdesktop to move the icons in from outside the bounds of a grid resize rather than resetting them to 0,0. This mimics how xfwm4 handles a screen resize to make both consistent.
  So if an icon was at 15,5 and the new grid's max was 10,7 then the icon should show up at 10,5 rather than get reset back to 0,0.
Comment 11 Eric Koegel editbugs 2012-01-03 19:51:07 CET
Comment on attachment 3975 
[PATCH] Modifify how xfdesktop moves icons during a grid resize to  mimic what xfwm4 does with its windows.

My patch isn't a good way to fix this bug. A better way would be to save an rc file per screen resolution. That will take some time, I'll put it on my todo list.
Comment 12 Jaromír Cápík 2012-01-06 18:04:53 CET
This sounds like a good idea :]
Comment 13 Eric Koegel editbugs 2012-01-07 08:35:02 CET
Created attachment 4087 
[PATCH] Icon positions are saved/restored per resolution.

Icon positions are now stored in seperate rc files per screen
resolution so that when reverting from a lower screen resolution
the icons aren't stuck at the upper-left. The old rc file is used
as a fallback so that the migration is seemless.
I haven't tested a screen resolution change during login, I'd be
interested in hearing about any issues with it or with this patch.
Comment 14 Nick Schermer editbugs 2012-01-18 15:39:11 CET
xfce_rc_config_open never returns null, so you can only use this in xfdesktop_file_icon_manager_save_icons().

In xfdesktop_file_icon_manager_get_cached_icon_position() you need to use:

filename = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, relpath_for_resolution).
if (filename == NULL) {
    filename = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, relpath_old).
}

if (filename != NULL) {
  rc = xfce_rc_simple_open (filname, TRUE);
  g_free (filename);
}
Comment 15 Eric Koegel editbugs 2012-01-20 13:39:43 CET
Created attachment 4114 
[PATCH] Icon positions are saved/restored per resolution.

Fixed the problems in xfdesktop_file_icon_manager_save_icons, thanks!
Comment 16 Eric Koegel editbugs 2012-02-07 13:36:47 CET
Created attachment 4169 
[PATCH] Icon positions are saved/restored per resolution

Added code to make all the grid areas free before repositing icons during a
resolution change. This will fix issues where icons don't get their spot back
because another icon is there.
Comment 17 Eric Koegel editbugs 2012-03-09 07:54:13 CET
*** Bug 6653 has been marked as a duplicate of this bug. ***
Comment 18 Eric Koegel editbugs 2012-03-09 18:36:12 CET
*** Bug 7670 has been marked as a duplicate of this bug. ***

Bug #6149

Reported by:
Adam
Reported on: 2010-01-11
Last modified on: 2012-03-09
Duplicates (2):
  • 6653 Desktop icon positions messed each time I exit from low-res fullscreen games/apps
  • 7670 Screen size changes from gdm to login mess up the icon position

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
6 users

Version

Attachments

Additional information