Merge lp:~noskcaj/unity-control-center/gnome-desktop-3.10 into lp:unity-control-center

Proposed by Jackson Doak
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~noskcaj/unity-control-center/gnome-desktop-3.10
Merge into: lp:unity-control-center
Diff against target: 296 lines (+46/-159)
3 files modified
debian/control (+1/-1)
panels/display/cc-display-panel.c (+13/-111)
panels/wacom/gsd-wacom-device.c (+32/-47)
To merge this branch: bzr merge lp:~noskcaj/unity-control-center/gnome-desktop-3.10
Reviewer Review Type Date Requested Status
Sebastien Bacher Disapprove
Review via email: mp+208912@code.launchpad.net

Description of the change

Allows unity-settings-daemon to work with gnome-desktop 3.10.
See lp:1228765

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your work but trusty has gnome-desktop 3.8
https://launchpad.net/distros/ubuntu/+source/gnome-desktop3

(the description is misleading, it doesn't add support for 3.10, it does port to 3.10 dropping support for the Ubuntu version, that can't be done this way)

review: Disapprove
Revision history for this message
Sebastien Bacher (seb128) wrote :

closing as rejecting, the code got updated in another changeset

Unmerged revisions

12741. By Jackson Doak

Bump build-depend on libgnome-desktop-3-dev to 3.10

12740. By Jackson Doak

Add support for gnome-desktop 3.10

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-02-26 20:00:59 +0000
+++ debian/control 2014-03-01 03:47:58 +0000
@@ -25,7 +25,7 @@
25 libgdk-pixbuf2.0-dev (>= 2.23.0),25 libgdk-pixbuf2.0-dev (>= 2.23.0),
26 libglib2.0-dev (>= 2.31.2),26 libglib2.0-dev (>= 2.31.2),
27 libgnome-bluetooth-dev (>= 3.3.4),27 libgnome-bluetooth-dev (>= 3.3.4),
28 libgnome-desktop-3-dev (>= 3.5.91),28 libgnome-desktop-3-dev (>= 3.10),
29 libgnome-menu-3-dev,29 libgnome-menu-3-dev,
30 libgnomekbd-dev,30 libgnomekbd-dev,
31 libgoa-1.0-dev (>= 3.5.90),31 libgoa-1.0-dev (>= 3.5.90),
3232
=== modified file 'panels/display/cc-display-panel.c'
--- panels/display/cc-display-panel.c 2014-02-26 15:58:33 +0000
+++ panels/display/cc-display-panel.c 2014-03-01 03:47:58 +0000
@@ -113,8 +113,6 @@
113 gboolean ignore_gui_changes;113 gboolean ignore_gui_changes;
114 gboolean dragging_top_bar;114 gboolean dragging_top_bar;
115115
116 /* These are used while we are waiting for the ApplyConfiguration method to be executed over D-bus */
117 GDBusProxy *proxy;
118};116};
119117
120typedef struct118typedef struct
@@ -131,7 +129,6 @@
131static void select_current_output_from_dialog_position (CcDisplayPanel *self);129static void select_current_output_from_dialog_position (CcDisplayPanel *self);
132static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data);130static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data);
133static void get_geometry (GnomeRROutputInfo *output, int *w, int *h);131static void get_geometry (GnomeRROutputInfo *output, int *w, int *h);
134static void apply_configuration_returned_cb (GObject *proxy, GAsyncResult *res, gpointer data);
135static gboolean get_clone_size (GnomeRRScreen *screen, int *width, int *height);132static gboolean get_clone_size (GnomeRRScreen *screen, int *width, int *height);
136static gboolean output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height);133static gboolean output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height);
137static char *make_resolution_string (int width, int height);134static char *make_resolution_string (int width, int height);
@@ -2428,128 +2425,33 @@
2428}2425}
24292426
2430static void2427static void
2431begin_version2_apply_configuration (CcDisplayPanel *self, GdkWindow *parent_window, guint32 timestamp)2428sanitize_configuration (CcDisplayPanel *self)
2432{2429{
2433 XID parent_window_xid;
2434 GError *error = NULL;
2435
2436 parent_window_xid = GDK_WINDOW_XID (parent_window);
2437
2438 self->priv->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
2439 G_DBUS_PROXY_FLAGS_NONE,
2440 NULL,
2441 "org.gnome.SettingsDaemon",
2442 "/org/gnome/SettingsDaemon/XRANDR",
2443 "org.gnome.SettingsDaemon.XRANDR_2",
2444 NULL,
2445 &error);
2446 if (self->priv->proxy == NULL) {
2447 error_message (self, _("Failed to apply configuration: %s"), error->message);
2448 g_error_free (error);
2449 return;
2450 }
2451
2452 g_dbus_proxy_call (self->priv->proxy,
2453 "ApplyConfiguration",
2454 g_variant_new ("(xx)", (gint64) parent_window_xid, (gint64) timestamp),
2455 G_DBUS_CALL_FLAGS_NONE,
2456 -1,
2457 NULL,
2458 apply_configuration_returned_cb,
2459 self);
2460}
2461
2462static void
2463ensure_current_configuration_is_saved (void)
2464{
2465 GnomeRRScreen *rr_screen;
2466 GnomeRRConfig *rr_config;
2467
2468 /* Normally, gnome_rr_config_save() creates a backup file based on the
2469 * old monitors.xml. However, if *that* file didn't exist, there is
2470 * nothing from which to create a backup. So, here we'll save the
2471 * current/unchanged configuration and then let our caller call
2472 * gnome_rr_config_save() again with the new/changed configuration, so
2473 * that there *will* be a backup file in the end.
2474 */
2475
2476 rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */
2477 if (!rr_screen)
2478 return;
2479
2480 rr_config = gnome_rr_config_new_current (rr_screen, NULL);
2481 gnome_rr_config_ensure_primary (rr_config);
2482 gnome_rr_config_save (rr_config, NULL); /* NULL-GError */
2483
2484 g_object_unref (rr_config);
2485 g_object_unref (rr_screen);
2486}
2487
2488static void
2489apply_configuration_returned_cb (GObject *proxy,
2490 GAsyncResult *res,
2491 gpointer data)
2492{
2493 CcDisplayPanel *self = data;
2494 GVariant *result;
2495 GError *error = NULL;
2496
2497 result = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, &error);
2498 if (error)
2499 error_message (self, _("Failed to apply configuration: %s"), error->message);
2500 g_clear_error (&error);
2501 if (result)
2502 g_variant_unref (result);
2503
2504 g_object_unref (self->priv->proxy);
2505 self->priv->proxy = NULL;
2506
2507 gtk_widget_set_sensitive (self->priv->panel, TRUE);
2508}
2509
2510static gboolean
2511sanitize_and_save_configuration (CcDisplayPanel *self)
2512{
2513 GError *error;
2514
2515 gnome_rr_config_sanitize (self->priv->current_configuration);2430 gnome_rr_config_sanitize (self->priv->current_configuration);
2516 gnome_rr_config_ensure_primary (self->priv->current_configuration);2431 gnome_rr_config_ensure_primary (self->priv->current_configuration);
25172432
2518 check_required_virtual_size (self);2433 check_required_virtual_size (self);
25192434
2520 foo_scroll_area_invalidate (FOO_SCROLL_AREA (self->priv->area));2435 foo_scroll_area_invalidate (FOO_SCROLL_AREA (self->priv->area));
2521
2522 ensure_current_configuration_is_saved ();
2523
2524 error = NULL;
2525 if (!gnome_rr_config_save (self->priv->current_configuration, &error))
2526 {
2527 error_message (self, _("Could not save the monitor configuration"), error->message);
2528 g_error_free (error);
2529 return FALSE;
2530 }
2531
2532 return TRUE;
2533}2436}
25342437
2535static void2438static void
2536apply (CcDisplayPanel *self)2439apply (CcDisplayPanel *self)
2537{2440{
2538 GdkWindow *window;2441 GError *error;
2442 gboolean ok;
25392443
2540 self->priv->apply_button_clicked_timestamp = gtk_get_current_event_time ();2444 self->priv->apply_button_clicked_timestamp = gtk_get_current_event_time ();
25412445
2542 if (!sanitize_and_save_configuration (self))2446 sanitize_configuration (self);
2543 return;2447
25442448 error = NULL;
2545 g_assert (self->priv->proxy == NULL);2449 ok = gnome_rr_config_apply_persistent (self->priv->current_configuration,
25462450 self->priv->screen, &error);
2547 gtk_widget_set_sensitive (self->priv->panel, FALSE);2451
25482452 if (!ok)
2549 window = gtk_widget_get_window (gtk_widget_get_toplevel (self->priv->panel));2453 error_message (self, _("Failed to apply configuration"), error->message);
25502454 g_clear_error (&error);
2551 begin_version2_apply_configuration (self, window,
2552 self->priv->apply_button_clicked_timestamp);
2553}2455}
25542456
2555#if 02457#if 0
25562458
=== modified file 'panels/wacom/gsd-wacom-device.c'
--- panels/wacom/gsd-wacom-device.c 2014-02-19 02:24:52 +0000
+++ panels/wacom/gsd-wacom-device.c 2014-03-01 03:47:58 +0000
@@ -521,35 +521,26 @@
521 rr_outputs = gnome_rr_screen_list_outputs (rr_screen);521 rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
522522
523 for (i = 0; rr_outputs[i] != NULL; i++) {523 for (i = 0; rr_outputs[i] != NULL; i++) {
524 gchar *o_vendor_s;524 gchar *o_vendor;
525 gchar *o_product_s;525 gchar *o_product;
526 int o_product;526 gchar *o_serial;
527 gchar *o_serial_s;
528 int o_serial;
529 gboolean match;527 gboolean match;
530528
531 if (!gnome_rr_output_is_connected (rr_outputs[i]))529 gnome_rr_output_get_ids_from_edid (rr_outputs[i],
532 continue;530 &o_vendor,
533531 &o_product,
534 if (!gnome_rr_output_get_ids_from_edid (rr_outputs[i],532 &o_serial);
535 &o_vendor_s,
536 &o_product,
537 &o_serial))
538 continue;
539
540 o_product_s = g_strdup_printf ("%d", o_product);
541 o_serial_s = g_strdup_printf ("%d", o_serial);
542533
543 g_debug ("Checking for match between '%s','%s','%s' and '%s','%s','%s'", \534 g_debug ("Checking for match between '%s','%s','%s' and '%s','%s','%s'", \
544 vendor, product, serial, o_vendor_s, o_product_s, o_serial_s);535 vendor, product, serial, o_vendor, o_product, o_serial);
545536
546 match = (vendor == NULL || g_strcmp0 (vendor, o_vendor_s) == 0) && \537 match = (vendor == NULL || g_strcmp0 (vendor, o_vendor) == 0) && \
547 (product == NULL || g_strcmp0 (product, o_product_s) == 0) && \538 (product == NULL || g_strcmp0 (product, o_product) == 0) && \
548 (serial == NULL || g_strcmp0 (serial, o_serial_s) == 0);539 (serial == NULL || g_strcmp0 (serial, o_serial) == 0);
549540
550 g_free (o_vendor_s);541 g_free (o_vendor);
551 g_free (o_product_s);542 g_free (o_product);
552 g_free (o_serial_s);543 g_free (o_serial);
553544
554 if (match) {545 if (match) {
555 retval = rr_outputs[i];546 retval = rr_outputs[i];
@@ -573,10 +564,7 @@
573564
574 rr_outputs = gnome_rr_screen_list_outputs (rr_screen);565 rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
575 for (i = 0; rr_outputs[i] != NULL; i++) {566 for (i = 0; rr_outputs[i] != NULL; i++) {
576 if (!gnome_rr_output_is_connected (rr_outputs[i]))567 if (gnome_rr_output_is_builtin_display(rr_outputs[i])) {
577 continue;
578
579 if (gnome_rr_output_is_laptop(rr_outputs[i])) {
580 retval = rr_outputs[i];568 retval = rr_outputs[i];
581 break;569 break;
582 }570 }
@@ -699,8 +687,7 @@
699 GVariant *c_array;687 GVariant *c_array;
700 GVariant *n_array;688 GVariant *n_array;
701 gsize nvalues;689 gsize nvalues;
702 gchar *o_vendor_s, *o_product_s, *o_serial_s;690 gchar *o_vendor, *o_product, *o_serial;
703 int o_product, o_serial;
704 const gchar *values[3];691 const gchar *values[3];
705692
706 tablet = gsd_wacom_device_get_settings (device);693 tablet = gsd_wacom_device_get_settings (device);
@@ -711,28 +698,26 @@
711 return;698 return;
712 }699 }
713700
714 if (rr_output == NULL ||701 if (rr_output == NULL) {
715 !gnome_rr_output_get_ids_from_edid (rr_output,702 o_vendor = g_strdup ("");
716 &o_vendor_s,703 o_product = g_strdup ("");
717 &o_product,704 o_serial = g_strdup ("");
718 &o_serial)) {
719 o_vendor_s = g_strdup ("");
720 o_product_s = g_strdup ("");
721 o_serial_s = g_strdup ("");
722 } else {705 } else {
723 o_product_s = g_strdup_printf ("%d", o_product);706 gnome_rr_output_get_ids_from_edid (rr_output,
724 o_serial_s = g_strdup_printf ("%d", o_serial);707 &o_vendor,
708 &o_product,
709 &o_serial);
725 }710 }
726711
727 values[0] = o_vendor_s;712 values[0] = o_vendor;
728 values[1] = o_product_s;713 values[1] = o_product;
729 values[2] = o_serial_s;714 values[2] = o_serial;
730 n_array = g_variant_new_strv ((const gchar * const *) &values, 3);715 n_array = g_variant_new_strv ((const gchar * const *) &values, 3);
731 g_settings_set_value (tablet, "display", n_array);716 g_settings_set_value (tablet, "display", n_array);
732717
733 g_free (o_vendor_s);718 g_free (o_vendor);
734 g_free (o_product_s);719 g_free (o_product);
735 g_free (o_serial_s);720 g_free (o_serial);
736}721}
737722
738static GsdWacomRotation723static GsdWacomRotation

Subscribers

People subscribed via source and target branches