From a4a7ac50fbbd8517c4afe7674ba796a5b86d35b6 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sat, 16 Aug 2008 02:00:35 +0000 Subject: [PATCH] Create a GnomeRRLabeler when getting a new screen configuration Signed-off-by: Federico Mena Quintero svn path=/trunk/; revision=8863 --- capplets/display/ChangeLog | 7 +++++++ capplets/display/xrandr-capplet.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog index df3f4ecd1..1d4d2bbb6 100644 --- a/capplets/display/ChangeLog +++ b/capplets/display/ChangeLog @@ -1,3 +1,10 @@ +2008-08-13 Federico Mena Quintero + + * xrandr-capplet.c (on_screen_changed): Create a GnomeRRLabeler + based on the current screen configuration, so that the physical + monitors will be labeled while the capplet is up. + (struct App): New field "labeler". + 2008-08-11 Jens Granseuer * xrandr-capplet.c: (run_application): fail gracefully if we cannot diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 23d3c5d20..f6fff0a53 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -28,6 +28,7 @@ #define GNOME_DESKTOP_USE_UNSTABLE_API #include #include +#include #include #include #include @@ -40,6 +41,7 @@ struct App { GnomeRRScreen *screen; GnomeRRConfig *current_configuration; + GnomeRRLabeler *labeler; GnomeOutputInfo *current_output; GtkWidget *dialog; @@ -139,6 +141,13 @@ on_screen_changed (GnomeRRScreen *scr, qsort (app->current_configuration->outputs, i, sizeof (GnomeOutputInfo *), compare_outputs); + if (app->labeler) { + gnome_rr_labeler_hide (app->labeler); + g_object_unref (app->labeler); + } + + app->labeler = gnome_rr_labeler_new (app->current_configuration); + #if 0 for (i = 0; app->current_configuration->outputs[i] != NULL; ++i) {