Re: Responding to resolution changes

Tony Houghton <[email protected]> Sun, 30 Nov 2008 17:36:54 +0000
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
On Sun, 23 Nov 2008 12:07:36 +0000
"Thomas Leonard" <[email protected]> wrote:

> 2008/11/18 Tony Houghton <[email protected]>:
> > Is it possible for ROX to hook into some sort of signal so it can
> > respond to resolution changes? It would be handy if it could adjust its
> > panels and backdrop icons to fit new resolutions.
> 
> Perhaps this?
> 
> http://library.gnome.org/devel/gdk/stable/GdkScreen.html#GdkScreen-size-changed
> 
> I had a vague idea the filer already adapted to size changes, but I'm
> stuck with an NVidia card at the moment, so xrandr doesn't work for me
> anyway.

I've just checked and found it was supposed to respond to size changes,
but it wasn't updating the panels' copies of the screen geometry. That
might well have been my oversight when I did the xinerama stuff! The fix
is quite simple, patch attached.

This still doesn't solve the problem of icons disappearing off the edge
of the pinboard when the size decreases. IMO moving the icons
permanently a la Windows is just about the lesser of two evils but I can
think of two possible better strategies:

Store the icons' positions relative to the nearest edges rather than the
top left. But then we have the problem, did the user really want the
icon positioned relative to the right or bottom edge or is it there
because there are so many icons above or to the left of it?

Perhaps preferable is, if an icon has to be moved to fit it on screen,
remember its previous position, and move it back if another resolution
change permits. In the case of a sequence of changes, say widths
changing from 1280 -> 800 -> 1024 -> 1280, I think the best way to
handle when we get to 1024 is to try to move everything to its original
position (for 1280) before adjusting it again for 1024.

Whichever strategy is used to move the icons there's still the
complication that an icon can't simply be moved to the left or upwards
until it's on screen, because there might already be another icon in the
way, and it would be better to move that in turn rather than find a
completely new place for the first icon, and so on.

-- 
TH * http://www.realh.co.uk

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
rox-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rox-devel
rox-filer-xrandr-size-change-panel.patch (text/x-patch, 390 B)
diff --git a/ROX-Filer/src/panel.c b/ROX-Filer/src/panel.c
index 0db6ecd..22c9a97 100644
--- a/ROX-Filer/src/panel.c
+++ b/ROX-Filer/src/panel.c
@@ -618,6 +618,7 @@ void panel_update_size(void)
 	{
 		if (current_panel[i])
 		{
+			panel_update_geometry(current_panel[i]);
 			reposition_panel(current_panel[i]->window,
 					&current_panel[i]->window->allocation,
 					current_panel[i]);