[gnome-control-center: 3/3] Merge branch 'gobject-gnomerr'



commit de6af5ee29ca9f7de2677053328898a8880db3d8
Merge: d76b70b 66e8e90
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Jan 6 20:45:40 2011 +0100

    Merge branch 'gobject-gnomerr'
    
    Conflicts:
    	panels/display/xrandr-capplet.c

 panels/display/xrandr-capplet.c |  664 +++++++++++++++++++--------------------
 1 files changed, 327 insertions(+), 337 deletions(-)
---
diff --cc panels/display/xrandr-capplet.c
index ab1d80f,3dbe9f9..4396753
--- a/panels/display/xrandr-capplet.c
+++ b/panels/display/xrandr-capplet.c
@@@ -84,13 -85,13 +84,13 @@@ struct Ap
  
  static void rebuild_gui (App *app);
  static void on_clone_changed (GtkWidget *box, gpointer data);
- static gboolean output_overlaps (GnomeOutputInfo *output, GnomeRRConfig *config);
+ static gboolean output_overlaps (GnomeRROutputInfo *output, GnomeRRConfig *config);
  static void select_current_output_from_dialog_position (App *app);
 -static void monitor_on_off_toggled_cb (GtkToggleButton *toggle, gpointer data);
 +static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data);
- static void get_geometry (GnomeOutputInfo *output, int *w, int *h);
+ static void get_geometry (GnomeRROutputInfo *output, int *w, int *h);
  static void apply_configuration_returned_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, void *data);
  static gboolean get_clone_size (GnomeRRScreen *screen, int *width, int *height);
- static gboolean output_info_supports_mode (App *app, GnomeOutputInfo *info, int width, int height);
+ static gboolean output_info_supports_mode (App *app, GnomeRROutputInfo *info, int width, int height);
  
  static void
  error_message (App *app, const char *primary_text, const char *secondary_text)
@@@ -323,8 -324,8 +323,8 @@@ rebuild_rotation_combo (App *app
  
    clear_combo (app->rotation_combo);
  
-   gtk_widget_set_sensitive (
-                             app->rotation_combo, app->current_output && app->current_output->on);
+   gtk_widget_set_sensitive (app->rotation_combo,
 -                            app->current_output && gnome_rr_output_info_get_active (app->current_output));
++                            app->current_output && gnome_rr_output_info_is_active (app->current_output));
  
    if (!app->current_output)
      return;
@@@ -358,11 -359,11 +358,11 @@@ static in
  count_active_outputs (App *app)
  {
    int i, count = 0;
+   GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (app->current_configuration);
  
-   for (i = 0; app->current_configuration->outputs[i] != NULL; ++i)
+   for (i = 0; outputs[i] != NULL; ++i)
      {
-       GnomeOutputInfo *output = app->current_configuration->outputs[i];
-       if (output->on)
 -      if (gnome_rr_output_info_get_active (outputs[i]))
++      if (gnome_rr_output_info_is_active (outputs[i]))
          count++;
      }
  
@@@ -405,16 -408,14 +407,14 @@@ mirror_screens_is_supported (App *app
  
      num_outputs_with_clone_size = 0;
  
-     for (i = 0; app->current_configuration->outputs[i] != NULL; i++)
+     for (i = 0; outputs[i] != NULL; i++)
        {
-         GnomeOutputInfo *output = app->current_configuration->outputs[i];
- 
-         /* We count the connected outputs that support the clone size.  It
-          * doesn't matter if those outputs aren't actually On currently; we
-          * will turn them on in on_clone_changed().
-          */
-         if (output->connected && output_info_supports_mode (app, output, clone_width, clone_height))
-           num_outputs_with_clone_size++;
+          /* We count the connected outputs that support the clone size.  It
+           * doesn't matter if those outputs aren't actually On currently; we
+           * will turn them on in on_clone_changed().
+           */
 -         if (gnome_rr_output_info_get_connected (outputs[i]) && output_info_supports_mode (app, outputs[i], clone_width, clone_height))
++         if (gnome_rr_output_info_is_connected (outputs[i]) && output_info_supports_mode (app, outputs[i], clone_width, clone_height))
+            num_outputs_with_clone_size++;
        }
  
      if (num_outputs_with_clone_size >= 2)
@@@ -464,10 -454,10 +464,10 @@@ rebuild_current_monitor_label (App *app
  
    if (app->current_output)
      {
-       if (app->current_configuration->clone)
+       if (gnome_rr_config_get_clone (app->current_configuration))
 -        tmp = g_strdup (_("Mirror Screens"));
 +        tmp = mirror_monitor_name ();
        else
-         tmp = g_strdup (app->current_output->display_name);
+         tmp = g_strdup (gnome_rr_output_info_get_display_name (app->current_output));
  
        str = g_strdup_printf ("<b>%s</b>", tmp);
        gnome_rr_labeler_get_color_for_output (app->labeler, app->current_output, &color);
@@@ -520,14 -511,14 +520,14 @@@ rebuild_on_off_radios (App *app
    on_active = FALSE;
    off_active = FALSE;
  
-   if (!app->current_configuration->clone && app->current_output)
+   if (!gnome_rr_config_get_clone (app->current_configuration) && app->current_output)
      {
-       if (count_active_outputs (app) > 1 || !app->current_output->on)
 -      if (count_active_outputs (app) > 1 || !gnome_rr_output_info_get_active (app->current_output))
++      if (count_active_outputs (app) > 1 || !gnome_rr_output_info_is_active (app->current_output))
          sensitive = TRUE;
        else
          sensitive = FALSE;
  
-       on_active = app->current_output->on;
 -      on_active = gnome_rr_output_info_get_active (app->current_output);
++      on_active = gnome_rr_output_info_is_active (app->current_output);
        off_active = !on_active;
      }
  
@@@ -616,7 -611,7 +617,7 @@@ rebuild_resolution_combo (App *app
  
    if (!(modes = get_current_modes (app))
        || !app->current_output
-       || !app->current_output->on)
 -      || !gnome_rr_output_info_get_active (app->current_output))
++      || !gnome_rr_output_info_is_active (app->current_output))
      {
        gtk_widget_set_sensitive (app->resolution_combo, FALSE);
        return;
@@@ -675,7 -672,7 +678,7 @@@ rebuild_gui (App *app
    rebuild_rotation_combo (app);
  
  #if 0
-   g_debug ("sensitive: %d, on: %d", sensitive, app->current_output->on);
 -  g_debug ("sensitive: %d, on: %d", sensitive, gnome_rr_output_info_get_active (app->current_output));
++  g_debug ("sensitive: %d, on: %d", sensitive, gnome_rr_output_info_is_active (app->current_output));
  #endif
  
    app->ignore_gui_changes = FALSE;
@@@ -765,18 -762,24 +771,18 @@@ monitor_switch_active_cb (GObject    *o
    if (!app->current_output)
      return;
  
 -  if (!gtk_toggle_button_get_active (toggle))
 -    return;
 +  value = gtk_switch_get_active (GTK_SWITCH (object));
  
 -  if (GTK_WIDGET (toggle) == app->monitor_on_radio)
 +  if (value)
      {
-       app->current_output->on = TRUE;
+       gnome_rr_output_info_set_active (app->current_output, TRUE);
        select_resolution_for_current_output (app);
      }
 -  else if (GTK_WIDGET (toggle) == app->monitor_off_radio)
 +  else
      {
-       app->current_output->on = FALSE;
+       gnome_rr_output_info_set_active (app->current_output, FALSE);
        gnome_rr_config_ensure_primary (app->current_configuration);
      }
 -  else
 -    {
 -      g_assert_not_reached ();
 -      return;
 -    }
  
    rebuild_gui (app);
    foo_scroll_area_invalidate (FOO_SCROLL_AREA (app->area));
@@@ -797,36 -802,41 +805,41 @@@ realign_outputs_after_resolution_chang
  
    g_assert (app->current_configuration != NULL);
  
-   if (output_that_changed->width == old_width && output_that_changed->height == old_height)
+   gnome_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height); 
+ 
+   if (width == old_width && height == old_height)
      return;
  
-   old_right_edge = output_that_changed->x + old_width;
-   old_bottom_edge = output_that_changed->y + old_height;
+   old_right_edge = x + old_width;
+   old_bottom_edge = y + old_height;
  
-   dx = output_that_changed->width - old_width;
-   dy = output_that_changed->height - old_height;
+   dx = width - old_width;
+   dy = height - old_height;
  
-   for (i = 0; app->current_configuration->outputs[i] != NULL; i++) {
-     GnomeOutputInfo *output;
-     int output_width, output_height;
+   outputs = gnome_rr_config_get_outputs (app->current_configuration);
  
-     output = app->current_configuration->outputs[i];
+   for (i = 0; outputs[i] != NULL; i++)
+     {
+       int output_x, output_y;
+       int output_width, output_height;
  
-     if (output == output_that_changed || !output->connected)
-       continue;
 -      if (outputs[i] == output_that_changed || !gnome_rr_output_info_get_connected (outputs[i]))
++      if (outputs[i] == output_that_changed || !gnome_rr_output_info_is_connected (outputs[i]))
+         continue;
  
-     get_geometry (output, &output_width, &output_height);
+       gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
  
-     if (output->x >= old_right_edge)
-       output->x += dx;
-     else if (output->x + output_width == old_right_edge)
-       output->x = output_that_changed->x + output_that_changed->width - output_width;
+       if (output_x >= old_right_edge)
+          output_x += dx;
+       else if (output_x + output_width == old_right_edge)
+          output_x = x + width - output_width;
  
-     if (output->y >= old_bottom_edge)
-       output->y += dy;
-     else if (output->y + output_height == old_bottom_edge)
-       output->y = output_that_changed->y + output_that_changed->height - output_height;
-   }
+       if (output_y >= old_bottom_edge)
+          output_y += dy;
+       else if (output_y + output_height == old_bottom_edge)
+          output_y = y + height - output_height;
+ 
+       gnome_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height);
+     }
  }
  
  static void
@@@ -875,31 -885,30 +888,30 @@@ lay_out_outputs_horizontally (App *app
    x = 0;
  
    /* First pass, all "on" outputs */
+   outputs = gnome_rr_config_get_outputs (app->current_configuration);
  
-   for (i = 0; app->current_configuration->outputs[i]; ++i)
+   for (i = 0; outputs[i]; ++i)
      {
-       GnomeOutputInfo *output;
- 
-       output = app->current_configuration->outputs[i];
-       if (output->connected && output->on) {
-         output->x = x;
-         output->y = 0;
-         x += output->width;
-       }
+       int width, height;
 -      if (gnome_rr_output_info_get_connected (outputs[i]) && gnome_rr_output_info_get_active (outputs[i]))
++      if (gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i]))
+         {
+           gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
+           gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
+           x += width;
+         }
      }
  
    /* Second pass, all the black screens */
  
-   for (i = 0; app->current_configuration->outputs[i]; ++i)
+     for (i = 0; outputs[i]; ++i)
      {
-       GnomeOutputInfo *output;
- 
-       output = app->current_configuration->outputs[i];
-       if (!(output->connected && output->on)) {
-         output->x = x;
-         output->y = 0;
-         x += output->width;
-       }
+       int width, height;
 -      if (!(gnome_rr_output_info_get_connected (outputs[i]) && gnome_rr_output_info_get_active (outputs[i])))
++      if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i])))
+         {
+           gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height);
+           gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height);
+           x += width;
+         }
      }
  
  }
@@@ -949,10 -958,10 +961,10 @@@ output_info_supports_mode (App *app, Gn
    GnomeRRMode **modes;
    int i;
  
-   if (!info->connected)
 -  if (!gnome_rr_output_info_get_connected (info))
++  if (!gnome_rr_output_info_is_connected (info))
      return FALSE;
  
-   output = gnome_rr_screen_get_output_by_name (app->screen, info->name);
+   output = gnome_rr_screen_get_output_by_name (app->screen, gnome_rr_output_info_get_name (info));
    if (!output)
      return FALSE;
  
@@@ -979,18 -987,19 +990,19 @@@ on_clone_changed (GtkWidget *box, gpoin
      {
        int i;
        int width, height;
+       GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (app->current_configuration);
  
-       for (i = 0; app->current_configuration->outputs[i]; ++i)
-         {
-           if (app->current_configuration->outputs[i]->connected)
-             {
-               app->current_output = app->current_configuration->outputs[i];
-               break;
-             }
-         }
+       for (i = 0; outputs[i]; ++i)
+ 	{
 -	  if (gnome_rr_output_info_get_connected (outputs[i]))
++	  if (gnome_rr_output_info_is_connected (outputs[i]))
+ 	    {
+ 	      app->current_output = outputs[i];
+ 	      break;
+ 	    }
+ 	}
  
        /* Turn on all the connected screens that support the best clone mode.
 -       * The user may hit "Mirror Screens", but he shouldn't have to turn on
 +       * The user may hit "Mirror displays", but he shouldn't have to turn on
         * all the required outputs as well.
         */
  
@@@ -1014,12 -1024,13 +1027,13 @@@
  }
  
  static void
- get_geometry (GnomeOutputInfo *output, int *w, int *h)
+ get_geometry (GnomeRROutputInfo *output, int *w, int *h)
  {
-   if (output->on)
+   GnomeRRRotation rotation;
+ 
 -  if (gnome_rr_output_info_get_active (output))
++  if (gnome_rr_output_info_is_active (output))
      {
-       *h = output->height;
-       *w = output->width;
+       gnome_rr_output_info_get_geometry (output, NULL, NULL, w, h);
      }
    else
      {
@@@ -1051,17 -1065,17 +1068,17 @@@ list_connected_outputs (App *app, int *
  
    *total_w = 0;
    *total_h = 0;
-   for (i = 0; app->current_configuration->outputs[i] != NULL; ++i)
-     {
-       GnomeOutputInfo *output = app->current_configuration->outputs[i];
  
-       if (output->connected)
-         {
-           int w, h;
+   outputs = gnome_rr_config_get_outputs (app->current_configuration);
+   for (i = 0; outputs[i] != NULL; ++i)
+     {
 -      if (gnome_rr_output_info_get_connected (outputs[i]))
++      if (gnome_rr_output_info_is_connected (outputs[i]))
+ 	{
+ 	  int w, h;
  
-           result = g_list_prepend (result, output);
+ 	  result = g_list_prepend (result, outputs[i]);
  
-           get_geometry (output, &w, &h);
+ 	  get_geometry (outputs[i], &w, &h);
  
            *total_w += w;
            *total_h += h;
@@@ -1153,13 -1165,12 +1168,12 @@@ static voi
  list_edges (GnomeRRConfig *config, GArray *edges)
  {
    int i;
+   GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config);
  
-   for (i = 0; config->outputs[i]; ++i)
+   for (i = 0; outputs[i]; ++i)
      {
-       GnomeOutputInfo *output = config->outputs[i];
- 
-       if (output->connected)
-         list_edges_for_output (output, edges);
 -      if (gnome_rr_output_info_get_connected (outputs[i]))
++      if (gnome_rr_output_info_is_connected (outputs[i]))
+ 	list_edges_for_output (outputs[i], edges);
      }
  }
  
@@@ -1359,18 -1364,17 +1367,17 @@@ output_overlaps (GnomeRROutputInfo *out
  
    get_output_rect (output, &output_rect);
  
-   for (i = 0; config->outputs[i]; ++i)
+   outputs = gnome_rr_config_get_outputs (config);
+   for (i = 0; outputs[i]; ++i)
      {
-       GnomeOutputInfo *other = config->outputs[i];
- 
-       if (other != output && other->connected)
-         {
-           GdkRectangle other_rect;
- 
-           get_output_rect (other, &other_rect);
-           if (gdk_rectangle_intersect (&output_rect, &other_rect, NULL))
-             return TRUE;
-         }
 -      if (outputs[i] != output && gnome_rr_output_info_get_connected (outputs[i]))
++      if (outputs[i] != output && gnome_rr_output_info_is_connected (outputs[i]))
+ 	{
+ 	  GdkRectangle other_rect;
+ 
+ 	  get_output_rect (outputs[i], &other_rect);
+ 	  if (gdk_rectangle_intersect (&output_rect, &other_rect, NULL))
+ 	    return TRUE;
+ 	}
      }
  
    return FALSE;
@@@ -1381,19 -1385,19 +1388,19 @@@ gnome_rr_config_is_aligned (GnomeRRConf
  {
    int i;
    gboolean result = TRUE;
+   GnomeRROutputInfo **outputs;
  
-   for (i = 0; config->outputs[i]; ++i)
+   outputs = gnome_rr_config_get_outputs (config);
+   for (i = 0; outputs[i]; ++i)
      {
-       GnomeOutputInfo *output = config->outputs[i];
- 
-       if (output->connected)
-         {
-           if (!output_is_aligned (output, edges))
-             return FALSE;
- 
-           if (output_overlaps (output, config))
-             return FALSE;
-         }
 -      if (gnome_rr_output_info_get_connected (outputs[i]))
++      if (gnome_rr_output_info_is_connected (outputs[i]))
+ 	{
+ 	  if (!output_is_aligned (outputs[i], edges))
+ 	    return FALSE;
+ 
+ 	  if (output_overlaps (outputs[i], config))
+ 	    return FALSE;
+ 	}
      }
  
    return result;
@@@ -1576,7 -1571,7 +1574,7 @@@ on_output_event (FooScrollArea *area
  
    if (event->type == FOO_DRAG_HOVER)
      {
-       if (output->on && app->dragging_top_bar)
 -      if (gnome_rr_output_info_get_active (output) && app->dragging_top_bar)
++      if (gnome_rr_output_info_is_active (output) && app->dragging_top_bar)
          set_primary_output (app, output);
        return;
      }
@@@ -1713,10 -1705,16 +1708,10 @@@ get_display_name (App *app
    PangoLayout *layout;
    char *text;
  
-   if (app->current_configuration->clone)
 -  if (gnome_rr_config_get_clone (app->current_configuration)) {
 -    /* Translators:  this is the feature where what you see on your laptop's
 -     * screen is the same as your external monitor.  Here, "Mirror" is being
 -     * used as an adjective, not as a verb.  For example, the Spanish
 -     * translation could be "Pantallas en Espejo", *not* "Espejar Pantallas".
 -     */
 -    text = g_strdup(_("Mirror Screens"));
 -  } else {
++  if (gnome_rr_config_get_clone (app->current_configuration))
 +    text = mirror_monitor_name ();
 +  else
-     text = g_strdup (output->display_name);
+     text = g_strdup (gnome_rr_output_info_get_display_name (output));
 -  }
  
    layout = gtk_widget_create_pango_layout (GTK_WIDGET (app->area), text);
    g_free (text);
@@@ -1872,7 -1869,7 +1866,7 @@@ paint_output (App *app, cairo_t *cr, in
    g = output_color.green / 65535.0;
    b = output_color.blue / 65535.0;
  
-   if (!output->on)
 -  if (!gnome_rr_output_info_get_active (output))
++  if (!gnome_rr_output_info_is_active (output))
      {
        /* If the output is turned off, just darken the selected color */
        color_shade (&r, &g, &b, 0.4);
@@@ -1909,8 -1906,7 +1903,7 @@@
                   y + ((h * scale + 0.5) - factor * log_extent.height) / 2);
  
    cairo_scale (cr, factor, factor);
- 
-   if (output->on)
 -  if (gnome_rr_output_info_get_active (output))
++  if (gnome_rr_output_info_is_active (output))
      cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
    else
      cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
@@@ -2046,17 -2044,15 +2041,15 @@@ compute_virtual_size_for_configuration 
  
    width = height = 0;
  
-   for (i = 0; config->outputs[i] != NULL; i++)
+   outputs = gnome_rr_config_get_outputs (config);
+   for (i = 0; outputs[i] != NULL; i++)
      {
-       GnomeOutputInfo *output;
- 
-       output = config->outputs[i];
- 
-       if (output->on)
-         {
-           width = MAX (width, output->x + output->width);
-           height = MAX (height, output->y + output->height);
-         }
 -      if (gnome_rr_output_info_get_active (outputs[i]))
++      if (gnome_rr_output_info_is_active (outputs[i]))
+ 	{
+ 	  gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
+ 	  width = MAX (width, output_x + output_width);
+ 	  height = MAX (height, output_y + output_height);
+ 	}
      }
  
    *ret_width = width;
@@@ -2310,35 -2307,36 +2304,36 @@@ get_nearest_output (GnomeRRConfig *conf
    nearest_index = -1;
    nearest_dist = G_MAXINT;
  
-   for (i = 0; configuration->outputs[i] != NULL; i++)
+   outputs = gnome_rr_config_get_outputs (configuration);
+   for (i = 0; outputs[i] != NULL; i++)
      {
-       GnomeOutputInfo *output;
        int dist_x, dist_y;
+       int output_x, output_y, output_width, output_height;
  
-       output = configuration->outputs[i];
 -      if (!(gnome_rr_output_info_get_connected (outputs[i]) && gnome_rr_output_info_get_active (outputs[i])))
++      if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i])))
+ 	continue;
  
-       if (!(output->connected && output->on))
-         continue;
+       gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height);
  
-       if (x < output->x)
-         dist_x = output->x - x;
-       else if (x >= output->x + output->width)
-         dist_x = x - (output->x + output->width) + 1;
+       if (x < output_x)
+ 	dist_x = output_x - x;
+       else if (x >= output_x + output_width)
+ 	dist_x = x - (output_x + output_width) + 1;
        else
-         dist_x = 0;
+ 	dist_x = 0;
  
-       if (y < output->y)
-         dist_y = output->y - y;
-       else if (y >= output->y + output->height)
-         dist_y = y - (output->y + output->height) + 1;
+       if (y < output_y)
+ 	dist_y = output_y - y;
+       else if (y >= output_y + output_height)
+ 	dist_y = y - (output_y + output_height) + 1;
        else
-         dist_y = 0;
+ 	dist_y = 0;
  
        if (MIN (dist_x, dist_y) < nearest_dist)
-         {
-           nearest_dist = MIN (dist_x, dist_y);
-           nearest_index = i;
-         }
+ 	{
+ 	  nearest_dist = MIN (dist_x, dist_y);
+ 	  nearest_index = i;
+ 	}
      }
  
    if (nearest_index != -1)
@@@ -2358,36 -2355,32 +2352,32 @@@ get_output_for_window (GnomeRRConfig *c
    int i;
    int largest_area;
    int largest_index;
+   GnomeRROutputInfo **outputs;
  
 -  gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height, NULL);
 +  gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height);
    gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
  
    largest_area = 0;
    largest_index = -1;
  
-   for (i = 0; configuration->outputs[i] != NULL; i++)
+   outputs = gnome_rr_config_get_outputs (configuration);
+   for (i = 0; outputs[i] != NULL; i++)
      {
-       GnomeOutputInfo *output;
        GdkRectangle output_rect, intersection;
  
-       output = configuration->outputs[i];
+       gnome_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height);
  
-       output_rect.x      = output->x;
-       output_rect.y      = output->y;
-       output_rect.width  = output->width;
-       output_rect.height = output->height;
 -      if (gnome_rr_output_info_get_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
++      if (gnome_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
+ 	{
+ 	  int area;
  
-       if (output->connected && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection))
-         {
-           int area;
- 
-           area = intersection.width * intersection.height;
-           if (area > largest_area)
-             {
-               largest_area = area;
-               largest_index = i;
-             }
-         }
+ 	  area = intersection.width * intersection.height;
+ 	  if (area > largest_area)
+ 	    {
+ 	      largest_area = area;
+ 	      largest_index = i;
+ 	    }
+ 	}
      }
  
    if (largest_index != -1)
@@@ -2497,8 -2490,8 +2487,8 @@@ run_application (void
        return NULL;
      }
  
-   app->screen = gnome_rr_screen_new (gdk_screen_get_default (),
-                                      on_screen_changed, app, &error);
+   app->screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
 -  g_signal_connect (app->screen, "screen-changed", G_CALLBACK (on_screen_changed), app);
++  g_signal_connect (app->screen, "changed", G_CALLBACK (on_screen_changed), app);
    if (!app->screen)
      {
        error_message (NULL, _("Could not get screen information"), error->message);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]