For Alex Larsson :

2004-04-15  Jody Goldberg <jody@gnome.org>

	For Alex Larsson :
	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119494
	* main.c : fix reverting size change
This commit is contained in:
Jody Goldberg 2004-04-15 21:14:50 +00:00 committed by Jody Goldberg
parent ee01439afa
commit f13ff93f8f
4 changed files with 76 additions and 6 deletions

4
NEWS
View file

@ -1,5 +1,9 @@
gnome-control-center 2.6.1
Alex Larsson:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119494
* Fix reverting a size change.
Chris Lahey:
* Fix ordering of themes in theme manager
* Fix sizing of svg backgrounds

View file

@ -1,3 +1,9 @@
2004-04-15 Jody Goldberg <jody@gnome.org>
For Alex Larsson :
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119494
* main.c : fix reverting size change
2004-04-01 Jody Goldberg <jody@gnome.org>
* Release 2.6.0.3

View file

@ -20,6 +20,10 @@ struct ScreenInfo
short current_rate;
Rotation current_rotation;
SizeID old_size;
short old_rate;
Rotation old_rotation;
XRRScreenConfiguration *config;
XRRScreenSize *sizes;
int n_sizes;
@ -73,6 +77,40 @@ read_display_info (GdkDisplay *display)
return info;
}
void
update_display_info (struct DisplayInfo *info, GdkDisplay *display)
{
struct ScreenInfo *screen_info;
GdkScreen *screen;
GdkWindow *root_window;
int i;
g_assert (info->n_screens == gdk_display_get_n_screens (display));
for (i = 0; i < info->n_screens; i++)
{
screen = gdk_display_get_screen (display, i);
screen_info = &info->screens[i];
screen_info->old_rate = screen_info->current_rate;
screen_info->old_size = screen_info->current_size;
screen_info->old_rotation = screen_info->current_rotation;
screen_info->current_width = gdk_screen_get_width (screen);
screen_info->current_height = gdk_screen_get_height (screen);
root_window = gdk_screen_get_root_window (screen);
XRRFreeScreenConfigInfo (screen_info->config);
screen_info->config = XRRGetScreenInfo (gdk_x11_display_get_xdisplay (display),
gdk_x11_drawable_get_xid (GDK_DRAWABLE (root_window)));
screen_info->current_rate = XRRConfigCurrentRate (screen_info->config);
screen_info->current_size = XRRConfigCurrentConfiguration (screen_info->config, &screen_info->current_rotation);
screen_info->sizes = XRRConfigSizes (screen_info->config, &screen_info->n_sizes);
}
}
static int
get_current_resolution (struct ScreenInfo *screen_info)
{
@ -151,6 +189,8 @@ apply_config (struct DisplayInfo *info)
}
}
update_display_info (info, display);
/* xscreensaver should handle this itself, but does not currently so we hack
* it. Ignore failures in case xscreensaver is not installed */
if (changed)
@ -182,14 +222,28 @@ revert_config (struct DisplayInfo *info)
status = XRRSetScreenConfigAndRate (xdisplay,
screen_info->config,
gdk_x11_drawable_get_xid (GDK_DRAWABLE (root_window)),
screen_info->current_size,
screen_info->current_rotation,
screen_info->current_rate,
screen_info->old_size,
screen_info->old_rotation,
screen_info->old_rate,
GDK_CURRENT_TIME);
generate_resolution_menu(screen_info);
generate_rate_menu(screen_info);
}
update_display_info (info, display);
/* Need to update the menus to the new settings */
for (i = 0; i < info->n_screens; i++)
{
struct ScreenInfo *screen_info = &info->screens[i];
generate_resolution_menu (screen_info);
generate_rate_menu (screen_info);
}
/* xscreensaver should handle this itself, but does not currently so we hack
* it. Ignore failures in case xscreensaver is not installed */
g_spawn_command_line_async ("xscreensaver-command -restart", NULL);
return 0;
}

View file

@ -1,3 +1,9 @@
2004-04-15 Jody Goldberg <jody@gnome.org>
* capplet-dir.c (find_icon) : pull in some code from nautilus and eel
to ignore some image extensions. Themed icons should have
extensions.
2004-04-01 Jody Goldberg <jody@gnome.org>
* Release 2.6.0.3