Merge lp:~robert-ancell/unity-control-center/libusd into lp:unity-control-center
- libusd
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Iain Lane |
Approved revision: | 12788 |
Merged at revision: | 12787 |
Proposed branch: | lp:~robert-ancell/unity-control-center/libusd |
Merge into: | lp:unity-control-center |
Diff against target: |
1984 lines (+338/-341) 7 files modified
configure.ac (+2/-2) debian/control (+1/-0) panels/display/cc-display-panel.c (+232/-233) panels/display/cc-rr-labeler.c (+19/-19) panels/display/cc-rr-labeler.h (+3/-4) panels/wacom/cc-wacom-mapping-panel.c (+14/-15) panels/wacom/gsd-wacom-device.c (+67/-68) |
To merge this branch: | bzr merge lp:~robert-ancell/unity-control-center/libusd |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Iain Lane | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+232676@code.launchpad.net |
Commit message
Use libunity-
Description of the change
Use libunity-
- 12786. By Robert Ancell
-
Merge with trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:12786
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 12787. By Robert Ancell
-
libunity-
settings- daemon was moved into it's own package - 12788. By Robert Ancell
-
Build-dep on libunity-
settings- daemon- dev
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:12788
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Robert Ancell (robert-ancell) wrote : | # |
Note that Jenkins can't build this because it requires the associated change from lp:~robert-ancell/unity-settings-daemon/xrandr 
Preview Diff
1 | === modified file 'configure.ac' | |||
2 | --- configure.ac 2014-02-26 20:00:59 +0000 | |||
3 | +++ configure.ac 2014-08-29 10:31:11 +0000 | |||
4 | @@ -121,7 +121,7 @@ | |||
5 | 121 | gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION) | 121 | gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION) |
6 | 122 | PKG_CHECK_MODULES(DATETIME_PANEL, $COMMON_MODULES timezonemap | 122 | PKG_CHECK_MODULES(DATETIME_PANEL, $COMMON_MODULES timezonemap |
7 | 123 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) | 123 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) |
9 | 124 | PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES gnome-desktop-3.0 >= 3.1.0 x11) | 124 | PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES libunity-settings-daemon x11) |
10 | 125 | PKG_CHECK_MODULES(INFO_PANEL, $COMMON_MODULES libgtop-2.0 gl x11 | 125 | PKG_CHECK_MODULES(INFO_PANEL, $COMMON_MODULES libgtop-2.0 gl x11 |
11 | 126 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkitgtk-3.0) | 126 | polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkitgtk-3.0) |
12 | 127 | PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMON_MODULES | 127 | PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMON_MODULES |
13 | @@ -236,7 +236,7 @@ | |||
14 | 236 | PKG_CHECK_MODULES(WACOM_PANEL, $COMMON_MODULES | 236 | PKG_CHECK_MODULES(WACOM_PANEL, $COMMON_MODULES |
15 | 237 | unity-settings-daemon | 237 | unity-settings-daemon |
16 | 238 | xi >= 1.2 x11 libwacom >= $LIBWACOM_REQUIRED_VERSION | 238 | xi >= 1.2 x11 libwacom >= $LIBWACOM_REQUIRED_VERSION |
18 | 239 | gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION) | 239 | libunity-settings-daemon) |
19 | 240 | AC_DEFINE(BUILD_WACOM, 1, [Define to 1 to build the Wacom panel]) | 240 | AC_DEFINE(BUILD_WACOM, 1, [Define to 1 to build the Wacom panel]) |
20 | 241 | have_wacom=yes | 241 | have_wacom=yes |
21 | 242 | fi | 242 | fi |
22 | 243 | 243 | ||
23 | === modified file 'debian/control' | |||
24 | --- debian/control 2014-05-30 09:34:24 +0000 | |||
25 | +++ debian/control 2014-08-29 10:31:11 +0000 | |||
26 | @@ -12,6 +12,7 @@ | |||
27 | 12 | gnome-common, | 12 | gnome-common, |
28 | 13 | gnome-pkg-tools (>= 0.10), | 13 | gnome-pkg-tools (>= 0.10), |
29 | 14 | unity-settings-daemon-dev, | 14 | unity-settings-daemon-dev, |
30 | 15 | libunity-settings-daemon-dev, | ||
31 | 15 | gsettings-desktop-schemas-dev (>= 3.7.2.2), | 16 | gsettings-desktop-schemas-dev (>= 3.7.2.2), |
32 | 16 | hardening-wrapper, | 17 | hardening-wrapper, |
33 | 17 | intltool (>= 0.37.1), | 18 | intltool (>= 0.37.1), |
34 | 18 | 19 | ||
35 | === modified file 'panels/display/cc-display-panel.c' | |||
36 | --- panels/display/cc-display-panel.c 2014-04-04 08:48:39 +0000 | |||
37 | +++ panels/display/cc-display-panel.c 2014-08-29 10:31:11 +0000 | |||
38 | @@ -30,9 +30,8 @@ | |||
39 | 30 | #include <gtk/gtk.h> | 30 | #include <gtk/gtk.h> |
40 | 31 | #include <glib.h> | 31 | #include <glib.h> |
41 | 32 | #include "scrollarea.h" | 32 | #include "scrollarea.h" |
45 | 33 | #define GNOME_DESKTOP_USE_UNSTABLE_API | 33 | #include <libunity-settings-daemon/gsd-rr.h> |
46 | 34 | #include <libgnome-desktop/gnome-rr.h> | 34 | #include <libunity-settings-daemon/gsd-rr-config.h> |
44 | 35 | #include <libgnome-desktop/gnome-rr-config.h> | ||
47 | 36 | #include <gdk/gdkx.h> | 35 | #include <gdk/gdkx.h> |
48 | 37 | #include <X11/Xlib.h> | 36 | #include <X11/Xlib.h> |
49 | 38 | #include <glib/gi18n.h> | 37 | #include <glib/gi18n.h> |
50 | @@ -86,10 +85,10 @@ | |||
51 | 86 | 85 | ||
52 | 87 | struct _CcDisplayPanelPrivate | 86 | struct _CcDisplayPanelPrivate |
53 | 88 | { | 87 | { |
56 | 89 | GnomeRRScreen *screen; | 88 | GsdRRScreen *screen; |
57 | 90 | GnomeRRConfig *current_configuration; | 89 | GsdRRConfig *current_configuration; |
58 | 91 | CcRRLabeler *labeler; | 90 | CcRRLabeler *labeler; |
60 | 92 | GnomeRROutputInfo *current_output; | 91 | GsdRROutputInfo *current_output; |
61 | 93 | 92 | ||
62 | 94 | GSettings *clock_settings; | 93 | GSettings *clock_settings; |
63 | 95 | GSettings *unity_settings; | 94 | GSettings *unity_settings; |
64 | @@ -134,18 +133,18 @@ | |||
65 | 134 | 133 | ||
66 | 135 | static void rebuild_gui (CcDisplayPanel *self); | 134 | static void rebuild_gui (CcDisplayPanel *self); |
67 | 136 | static void on_clone_changed (GtkWidget *box, gpointer data); | 135 | static void on_clone_changed (GtkWidget *box, gpointer data); |
69 | 137 | static gboolean output_overlaps (GnomeRROutputInfo *output, GnomeRRConfig *config); | 136 | static gboolean output_overlaps (GsdRROutputInfo *output, GsdRRConfig *config); |
70 | 138 | static void select_current_output_from_dialog_position (CcDisplayPanel *self); | 137 | static void select_current_output_from_dialog_position (CcDisplayPanel *self); |
71 | 139 | static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data); | 138 | static void monitor_switch_active_cb (GObject *object, GParamSpec *pspec, gpointer data); |
73 | 140 | static void get_geometry (GnomeRROutputInfo *output, int *w, int *h); | 139 | static void get_geometry (GsdRROutputInfo *output, int *w, int *h); |
74 | 141 | static void apply_configuration_returned_cb (GObject *proxy, GAsyncResult *res, gpointer data); | 140 | static void apply_configuration_returned_cb (GObject *proxy, GAsyncResult *res, gpointer data); |
77 | 142 | static gboolean get_clone_size (GnomeRRScreen *screen, int *width, int *height); | 141 | static gboolean get_clone_size (GsdRRScreen *screen, int *width, int *height); |
78 | 143 | static gboolean output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height); | 142 | static gboolean output_info_supports_mode (CcDisplayPanel *self, GsdRROutputInfo *info, int width, int height); |
79 | 144 | static char *make_resolution_string (int width, int height); | 143 | static char *make_resolution_string (int width, int height); |
80 | 145 | static GObject *cc_display_panel_constructor (GType gtype, | 144 | static GObject *cc_display_panel_constructor (GType gtype, |
81 | 146 | guint n_properties, | 145 | guint n_properties, |
82 | 147 | GObjectConstructParam *properties); | 146 | GObjectConstructParam *properties); |
84 | 148 | static void on_screen_changed (GnomeRRScreen *scr, gpointer data); | 147 | static void on_screen_changed (GsdRRScreen *scr, gpointer data); |
85 | 149 | static void refresh_unity_launcher_placement (CcDisplayPanel *self); | 148 | static void refresh_unity_launcher_placement (CcDisplayPanel *self); |
86 | 150 | static void refresh_unity_monitor_scale (CcDisplayPanel *self); | 149 | static void refresh_unity_monitor_scale (CcDisplayPanel *self); |
87 | 151 | static gboolean unity_launcher_on_all_monitors (GSettings *settings); | 150 | static gboolean unity_launcher_on_all_monitors (GSettings *settings); |
88 | @@ -295,14 +294,14 @@ | |||
89 | 295 | } | 294 | } |
90 | 296 | 295 | ||
91 | 297 | static void | 296 | static void |
93 | 298 | on_screen_changed (GnomeRRScreen *scr, | 297 | on_screen_changed (GsdRRScreen *scr, |
94 | 299 | gpointer data) | 298 | gpointer data) |
95 | 300 | { | 299 | { |
97 | 301 | GnomeRRConfig *current; | 300 | GsdRRConfig *current; |
98 | 302 | CcDisplayPanel *self = data; | 301 | CcDisplayPanel *self = data; |
99 | 303 | 302 | ||
102 | 304 | current = gnome_rr_config_new_current (self->priv->screen, NULL); | 303 | current = gsd_rr_config_new_current (self->priv->screen, NULL); |
103 | 305 | gnome_rr_config_ensure_primary (current); | 304 | gsd_rr_config_ensure_primary (current); |
104 | 306 | 305 | ||
105 | 307 | if (self->priv->current_configuration) | 306 | if (self->priv->current_configuration) |
106 | 308 | g_object_unref (self->priv->current_configuration); | 307 | g_object_unref (self->priv->current_configuration); |
107 | @@ -399,7 +398,7 @@ | |||
108 | 399 | const char *text, | 398 | const char *text, |
109 | 400 | gboolean preferred, | 399 | gboolean preferred, |
110 | 401 | int width, int height, int rate, | 400 | int width, int height, int rate, |
112 | 402 | GnomeRRRotation rotation) | 401 | GsdRRRotation rotation) |
113 | 403 | { | 402 | { |
114 | 404 | ForeachInfo info; | 403 | ForeachInfo info; |
115 | 405 | 404 | ||
116 | @@ -456,23 +455,23 @@ | |||
117 | 456 | 455 | ||
118 | 457 | static void | 456 | static void |
119 | 458 | add_mode (CcDisplayPanel *self, | 457 | add_mode (CcDisplayPanel *self, |
121 | 459 | GnomeRRMode *mode, | 458 | GsdRRMode *mode, |
122 | 460 | gint output_width, | 459 | gint output_width, |
123 | 461 | gint output_height, | 460 | gint output_height, |
124 | 462 | guint preferred_id) | 461 | guint preferred_id) |
125 | 463 | { | 462 | { |
126 | 464 | int width, height, rate; | 463 | int width, height, rate; |
127 | 465 | 464 | ||
131 | 466 | width = gnome_rr_mode_get_width (mode); | 465 | width = gsd_rr_mode_get_width (mode); |
132 | 467 | height = gnome_rr_mode_get_height (mode); | 466 | height = gsd_rr_mode_get_height (mode); |
133 | 468 | rate = gnome_rr_mode_get_freq (mode); | 467 | rate = gsd_rr_mode_get_freq (mode); |
134 | 469 | 468 | ||
135 | 470 | if (should_show_resolution (output_width, output_height, width, height)) | 469 | if (should_show_resolution (output_width, output_height, width, height)) |
136 | 471 | { | 470 | { |
137 | 472 | char *text; | 471 | char *text; |
138 | 473 | gboolean preferred; | 472 | gboolean preferred; |
139 | 474 | 473 | ||
141 | 475 | preferred = (gnome_rr_mode_get_id (mode) == preferred_id); | 474 | preferred = (gsd_rr_mode_get_id (mode) == preferred_id); |
142 | 476 | text = make_resolution_string (width, height); | 475 | text = make_resolution_string (width, height); |
143 | 477 | add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->resolution_combo)), | 476 | add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->resolution_combo)), |
144 | 478 | text, preferred, width, height, rate, -1); | 477 | text, preferred, width, height, rate, -1); |
145 | @@ -501,27 +500,27 @@ | |||
146 | 501 | return TRUE; | 500 | return TRUE; |
147 | 502 | } | 501 | } |
148 | 503 | 502 | ||
150 | 504 | static GnomeRRMode ** | 503 | static GsdRRMode ** |
151 | 505 | get_current_modes (CcDisplayPanel *self) | 504 | get_current_modes (CcDisplayPanel *self) |
152 | 506 | { | 505 | { |
154 | 507 | GnomeRROutput *output; | 506 | GsdRROutput *output; |
155 | 508 | 507 | ||
157 | 509 | if (gnome_rr_config_get_clone (self->priv->current_configuration)) | 508 | if (gsd_rr_config_get_clone (self->priv->current_configuration)) |
158 | 510 | { | 509 | { |
160 | 511 | return gnome_rr_screen_list_clone_modes (self->priv->screen); | 510 | return gsd_rr_screen_list_clone_modes (self->priv->screen); |
161 | 512 | } | 511 | } |
162 | 513 | else | 512 | else |
163 | 514 | { | 513 | { |
164 | 515 | if (!self->priv->current_output) | 514 | if (!self->priv->current_output) |
165 | 516 | return NULL; | 515 | return NULL; |
166 | 517 | 516 | ||
169 | 518 | output = gnome_rr_screen_get_output_by_name (self->priv->screen, | 517 | output = gsd_rr_screen_get_output_by_name (self->priv->screen, |
170 | 519 | gnome_rr_output_info_get_name (self->priv->current_output)); | 518 | gsd_rr_output_info_get_name (self->priv->current_output)); |
171 | 520 | 519 | ||
172 | 521 | if (!output) | 520 | if (!output) |
173 | 522 | return NULL; | 521 | return NULL; |
174 | 523 | 522 | ||
176 | 524 | return gnome_rr_output_list_modes (output); | 523 | return gsd_rr_output_list_modes (output); |
177 | 525 | } | 524 | } |
178 | 526 | } | 525 | } |
179 | 527 | 526 | ||
180 | @@ -530,38 +529,38 @@ | |||
181 | 530 | { | 529 | { |
182 | 531 | typedef struct | 530 | typedef struct |
183 | 532 | { | 531 | { |
185 | 533 | GnomeRRRotation rotation; | 532 | GsdRRRotation rotation; |
186 | 534 | const char * name; | 533 | const char * name; |
187 | 535 | } RotationInfo; | 534 | } RotationInfo; |
188 | 536 | static const RotationInfo rotations[] = { | 535 | static const RotationInfo rotations[] = { |
193 | 537 | { GNOME_RR_ROTATION_0, NC_("display panel, rotation", "Normal") }, | 536 | { GSD_RR_ROTATION_0, NC_("display panel, rotation", "Normal") }, |
194 | 538 | { GNOME_RR_ROTATION_90, NC_("display panel, rotation", "Counterclockwise") }, | 537 | { GSD_RR_ROTATION_90, NC_("display panel, rotation", "Counterclockwise") }, |
195 | 539 | { GNOME_RR_ROTATION_270, NC_("display panel, rotation", "Clockwise") }, | 538 | { GSD_RR_ROTATION_270, NC_("display panel, rotation", "Clockwise") }, |
196 | 540 | { GNOME_RR_ROTATION_180, NC_("display panel, rotation", "180 Degrees") }, | 539 | { GSD_RR_ROTATION_180, NC_("display panel, rotation", "180 Degrees") }, |
197 | 541 | }; | 540 | }; |
198 | 542 | const char *selection; | 541 | const char *selection; |
200 | 543 | GnomeRRRotation current; | 542 | GsdRRRotation current; |
201 | 544 | int i; | 543 | int i; |
202 | 545 | 544 | ||
203 | 546 | clear_combo (self->priv->rotation_combo); | 545 | clear_combo (self->priv->rotation_combo); |
204 | 547 | 546 | ||
205 | 548 | gtk_widget_set_sensitive (self->priv->rotation_combo, | 547 | gtk_widget_set_sensitive (self->priv->rotation_combo, |
207 | 549 | self->priv->current_output && gnome_rr_output_info_is_active (self->priv->current_output)); | 548 | self->priv->current_output && gsd_rr_output_info_is_active (self->priv->current_output)); |
208 | 550 | 549 | ||
209 | 551 | if (!self->priv->current_output) | 550 | if (!self->priv->current_output) |
210 | 552 | return; | 551 | return; |
211 | 553 | 552 | ||
213 | 554 | current = gnome_rr_output_info_get_rotation (self->priv->current_output); | 553 | current = gsd_rr_output_info_get_rotation (self->priv->current_output); |
214 | 555 | 554 | ||
215 | 556 | selection = NULL; | 555 | selection = NULL; |
216 | 557 | for (i = 0; i < G_N_ELEMENTS (rotations); ++i) | 556 | for (i = 0; i < G_N_ELEMENTS (rotations); ++i) |
217 | 558 | { | 557 | { |
218 | 559 | const RotationInfo *info = &(rotations[i]); | 558 | const RotationInfo *info = &(rotations[i]); |
219 | 560 | 559 | ||
221 | 561 | gnome_rr_output_info_set_rotation (self->priv->current_output, info->rotation); | 560 | gsd_rr_output_info_set_rotation (self->priv->current_output, info->rotation); |
222 | 562 | 561 | ||
223 | 563 | /* NULL-GError --- FIXME: we should say why this rotation is not available! */ | 562 | /* NULL-GError --- FIXME: we should say why this rotation is not available! */ |
225 | 564 | if (gnome_rr_config_applicable (self->priv->current_configuration, self->priv->screen, NULL)) | 563 | if (gsd_rr_config_applicable (self->priv->current_configuration, self->priv->screen, NULL)) |
226 | 565 | { | 564 | { |
227 | 566 | add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->rotation_combo)), g_dpgettext2 (NULL, "display panel, rotation", info->name), FALSE, 0, 0, 0, info->rotation); | 565 | add_key (gtk_combo_box_get_model (GTK_COMBO_BOX (self->priv->rotation_combo)), g_dpgettext2 (NULL, "display panel, rotation", info->name), FALSE, 0, 0, 0, info->rotation); |
228 | 567 | 566 | ||
229 | @@ -570,7 +569,7 @@ | |||
230 | 570 | } | 569 | } |
231 | 571 | } | 570 | } |
232 | 572 | 571 | ||
234 | 573 | gnome_rr_output_info_set_rotation (self->priv->current_output, current); | 572 | gsd_rr_output_info_set_rotation (self->priv->current_output, current); |
235 | 574 | 573 | ||
236 | 575 | if (!(selection && combo_select (self->priv->rotation_combo, selection))) | 574 | if (!(selection && combo_select (self->priv->rotation_combo, selection))) |
237 | 576 | gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->rotation_combo), 0); | 575 | gtk_combo_box_set_active (GTK_COMBO_BOX (self->priv->rotation_combo), 0); |
238 | @@ -618,8 +617,8 @@ | |||
239 | 618 | int output_width, output_height; | 617 | int output_width, output_height; |
240 | 619 | float max_scale; | 618 | float max_scale; |
241 | 620 | 619 | ||
244 | 621 | GnomeRROutputInfo *output = self->priv->current_output; | 620 | GsdRROutputInfo *output = self->priv->current_output; |
245 | 622 | const char *monitor_name = gnome_rr_output_info_get_name (output); | 621 | const char *monitor_name = gsd_rr_output_info_get_name (output); |
246 | 623 | int current_ui_scale = get_ui_scale_from_monitor (self, monitor_name); | 622 | int current_ui_scale = get_ui_scale_from_monitor (self, monitor_name); |
247 | 624 | float current_scale_factor = (float)current_ui_scale / 8.0; | 623 | float current_scale_factor = (float)current_ui_scale / 8.0; |
248 | 625 | float win_scale_factor = current_scale_factor > 1 ? floor (current_scale_factor) : 1; | 624 | float win_scale_factor = current_scale_factor > 1 ? floor (current_scale_factor) : 1; |
249 | @@ -644,7 +643,7 @@ | |||
250 | 644 | GVariant *new_dict; | 643 | GVariant *new_dict; |
251 | 645 | 644 | ||
252 | 646 | GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE(self->priv->ui_scale)); | 645 | GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE(self->priv->ui_scale)); |
254 | 647 | const char *monitor_name = gnome_rr_output_info_get_name (self->priv->current_output); | 646 | const char *monitor_name = gsd_rr_output_info_get_name (self->priv->current_output); |
255 | 648 | if (!monitor_name) | 647 | if (!monitor_name) |
256 | 649 | { | 648 | { |
257 | 650 | g_warning("Failed to get monitor name."); | 649 | g_warning("Failed to get monitor name."); |
258 | @@ -673,11 +672,11 @@ | |||
259 | 673 | count_active_outputs (CcDisplayPanel *self) | 672 | count_active_outputs (CcDisplayPanel *self) |
260 | 674 | { | 673 | { |
261 | 675 | int i, count = 0; | 674 | int i, count = 0; |
263 | 676 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 675 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
264 | 677 | 676 | ||
265 | 678 | for (i = 0; outputs[i] != NULL; ++i) | 677 | for (i = 0; outputs[i] != NULL; ++i) |
266 | 679 | { | 678 | { |
268 | 680 | if (gnome_rr_output_info_is_active (outputs[i])) | 679 | if (gsd_rr_output_info_is_active (outputs[i])) |
269 | 681 | count++; | 680 | count++; |
270 | 682 | } | 681 | } |
271 | 683 | 682 | ||
272 | @@ -686,10 +685,10 @@ | |||
273 | 686 | 685 | ||
274 | 687 | #if 0 | 686 | #if 0 |
275 | 688 | static int | 687 | static int |
277 | 689 | count_all_outputs (GnomeRRConfig *config) | 688 | count_all_outputs (GsdRRConfig *config) |
278 | 690 | { | 689 | { |
279 | 691 | int i; | 690 | int i; |
281 | 692 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config); | 691 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config); |
282 | 693 | 692 | ||
283 | 694 | for (i = 0; outputs[i] != NULL; i++) | 693 | for (i = 0; outputs[i] != NULL; i++) |
284 | 695 | ; | 694 | ; |
285 | @@ -718,7 +717,7 @@ | |||
286 | 718 | if (have_clone_size) { | 717 | if (have_clone_size) { |
287 | 719 | int i; | 718 | int i; |
288 | 720 | int num_outputs_with_clone_size; | 719 | int num_outputs_with_clone_size; |
290 | 721 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 720 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
291 | 722 | 721 | ||
292 | 723 | num_outputs_with_clone_size = 0; | 722 | num_outputs_with_clone_size = 0; |
293 | 724 | 723 | ||
294 | @@ -728,7 +727,7 @@ | |||
295 | 728 | * doesn't matter if those outputs aren't actually On currently; we | 727 | * doesn't matter if those outputs aren't actually On currently; we |
296 | 729 | * will turn them on in on_clone_changed(). | 728 | * will turn them on in on_clone_changed(). |
297 | 730 | */ | 729 | */ |
299 | 731 | if (gnome_rr_output_info_is_connected (outputs[i]) && output_info_supports_mode (self, outputs[i], clone_width, clone_height)) | 730 | if (gsd_rr_output_info_is_connected (outputs[i]) && output_info_supports_mode (self, outputs[i], clone_width, clone_height)) |
300 | 732 | num_outputs_with_clone_size++; | 731 | num_outputs_with_clone_size++; |
301 | 733 | } | 732 | } |
302 | 734 | 733 | ||
303 | @@ -747,7 +746,7 @@ | |||
304 | 747 | 746 | ||
305 | 748 | g_signal_handlers_block_by_func (self->priv->clone_checkbox, G_CALLBACK (on_clone_changed), self); | 747 | g_signal_handlers_block_by_func (self->priv->clone_checkbox, G_CALLBACK (on_clone_changed), self); |
306 | 749 | 748 | ||
308 | 750 | mirror_is_active = self->priv->current_configuration && gnome_rr_config_get_clone (self->priv->current_configuration); | 749 | mirror_is_active = self->priv->current_configuration && gsd_rr_config_get_clone (self->priv->current_configuration); |
309 | 751 | 750 | ||
310 | 752 | /* If mirror_is_active, then it *must* be possible to turn mirroring off */ | 751 | /* If mirror_is_active, then it *must* be possible to turn mirroring off */ |
311 | 753 | mirror_is_supported = mirror_is_active || mirror_screens_is_supported (self); | 752 | mirror_is_supported = mirror_is_active || mirror_screens_is_supported (self); |
312 | @@ -786,7 +785,7 @@ | |||
313 | 786 | 785 | ||
314 | 787 | if (self->priv->current_output) | 786 | if (self->priv->current_output) |
315 | 788 | { | 787 | { |
317 | 789 | if (gnome_rr_config_get_clone (self->priv->current_configuration)) | 788 | if (gsd_rr_config_get_clone (self->priv->current_configuration)) |
318 | 790 | { | 789 | { |
319 | 791 | gchar *str = mirror_monitor_name (); | 790 | gchar *str = mirror_monitor_name (); |
320 | 792 | gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str); | 791 | gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str); |
321 | @@ -794,7 +793,7 @@ | |||
322 | 794 | } | 793 | } |
323 | 795 | else | 794 | else |
324 | 796 | { | 795 | { |
326 | 797 | str = gnome_rr_output_info_get_display_name (self->priv->current_output); | 796 | str = gsd_rr_output_info_get_display_name (self->priv->current_output); |
327 | 798 | gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str); | 797 | gtk_label_set_text (GTK_LABEL (self->priv->current_monitor_label), str); |
328 | 799 | } | 798 | } |
329 | 800 | 799 | ||
330 | @@ -845,14 +844,14 @@ | |||
331 | 845 | sensitive = FALSE; | 844 | sensitive = FALSE; |
332 | 846 | on_active = FALSE; | 845 | on_active = FALSE; |
333 | 847 | 846 | ||
335 | 848 | if (!gnome_rr_config_get_clone (self->priv->current_configuration) && self->priv->current_output) | 847 | if (!gsd_rr_config_get_clone (self->priv->current_configuration) && self->priv->current_output) |
336 | 849 | { | 848 | { |
338 | 850 | if (count_active_outputs (self) > 1 || !gnome_rr_output_info_is_active (self->priv->current_output)) | 849 | if (count_active_outputs (self) > 1 || !gsd_rr_output_info_is_active (self->priv->current_output)) |
339 | 851 | sensitive = TRUE; | 850 | sensitive = TRUE; |
340 | 852 | else | 851 | else |
341 | 853 | sensitive = FALSE; | 852 | sensitive = FALSE; |
342 | 854 | 853 | ||
344 | 855 | on_active = gnome_rr_output_info_is_active (self->priv->current_output); | 854 | on_active = gsd_rr_output_info_is_active (self->priv->current_output); |
345 | 856 | } | 855 | } |
346 | 857 | 856 | ||
347 | 858 | gtk_widget_set_sensitive (self->priv->monitor_switch, sensitive); | 857 | gtk_widget_set_sensitive (self->priv->monitor_switch, sensitive); |
348 | @@ -910,7 +909,7 @@ | |||
349 | 910 | } | 909 | } |
350 | 911 | 910 | ||
351 | 912 | static void | 911 | static void |
353 | 913 | find_best_mode (GnomeRRMode **modes, int *out_width, int *out_height) | 912 | find_best_mode (GsdRRMode **modes, int *out_width, int *out_height) |
354 | 914 | { | 913 | { |
355 | 915 | int i; | 914 | int i; |
356 | 916 | 915 | ||
357 | @@ -921,8 +920,8 @@ | |||
358 | 921 | { | 920 | { |
359 | 922 | int w, h; | 921 | int w, h; |
360 | 923 | 922 | ||
363 | 924 | w = gnome_rr_mode_get_width (modes[i]); | 923 | w = gsd_rr_mode_get_width (modes[i]); |
364 | 925 | h = gnome_rr_mode_get_height (modes[i]); | 924 | h = gsd_rr_mode_get_height (modes[i]); |
365 | 926 | 925 | ||
366 | 927 | if (w * h > *out_width * *out_height) | 926 | if (w * h > *out_width * *out_height) |
367 | 928 | { | 927 | { |
368 | @@ -936,18 +935,18 @@ | |||
369 | 936 | rebuild_resolution_combo (CcDisplayPanel *self) | 935 | rebuild_resolution_combo (CcDisplayPanel *self) |
370 | 937 | { | 936 | { |
371 | 938 | int i; | 937 | int i; |
374 | 939 | GnomeRRMode **modes; | 938 | GsdRRMode **modes; |
375 | 940 | GnomeRRMode *mode; | 939 | GsdRRMode *mode; |
376 | 941 | char *current; | 940 | char *current; |
377 | 942 | int output_width, output_height; | 941 | int output_width, output_height; |
378 | 943 | guint32 preferred_id; | 942 | guint32 preferred_id; |
380 | 944 | GnomeRROutput *output; | 943 | GsdRROutput *output; |
381 | 945 | 944 | ||
382 | 946 | clear_combo (self->priv->resolution_combo); | 945 | clear_combo (self->priv->resolution_combo); |
383 | 947 | 946 | ||
384 | 948 | if (!(modes = get_current_modes (self)) | 947 | if (!(modes = get_current_modes (self)) |
385 | 949 | || !self->priv->current_output | 948 | || !self->priv->current_output |
387 | 950 | || !gnome_rr_output_info_is_active (self->priv->current_output)) | 949 | || !gsd_rr_output_info_is_active (self->priv->current_output)) |
388 | 951 | { | 950 | { |
389 | 952 | gtk_widget_set_sensitive (self->priv->resolution_combo, FALSE); | 951 | gtk_widget_set_sensitive (self->priv->resolution_combo, FALSE); |
390 | 953 | return; | 952 | return; |
391 | @@ -955,22 +954,22 @@ | |||
392 | 955 | 954 | ||
393 | 956 | g_assert (self->priv->current_output != NULL); | 955 | g_assert (self->priv->current_output != NULL); |
394 | 957 | 956 | ||
396 | 958 | gnome_rr_output_info_get_geometry (self->priv->current_output, NULL, NULL, &output_width, &output_height); | 957 | gsd_rr_output_info_get_geometry (self->priv->current_output, NULL, NULL, &output_width, &output_height); |
397 | 959 | g_assert (output_width != 0 && output_height != 0); | 958 | g_assert (output_width != 0 && output_height != 0); |
398 | 960 | 959 | ||
399 | 961 | gtk_widget_set_sensitive (self->priv->resolution_combo, TRUE); | 960 | gtk_widget_set_sensitive (self->priv->resolution_combo, TRUE); |
400 | 962 | 961 | ||
405 | 963 | output = gnome_rr_screen_get_output_by_name (self->priv->screen, | 962 | output = gsd_rr_screen_get_output_by_name (self->priv->screen, |
406 | 964 | gnome_rr_output_info_get_name (self->priv->current_output)); | 963 | gsd_rr_output_info_get_name (self->priv->current_output)); |
407 | 965 | mode = gnome_rr_output_get_preferred_mode (output); | 964 | mode = gsd_rr_output_get_preferred_mode (output); |
408 | 966 | preferred_id = gnome_rr_mode_get_id (mode); | 965 | preferred_id = gsd_rr_mode_get_id (mode); |
409 | 967 | 966 | ||
410 | 968 | for (i = 0; modes[i] != NULL; ++i) | 967 | for (i = 0; modes[i] != NULL; ++i) |
411 | 969 | add_mode (self, modes[i], output_width, output_height, preferred_id); | 968 | add_mode (self, modes[i], output_width, output_height, preferred_id); |
412 | 970 | 969 | ||
413 | 971 | /* And force the preferred mode in the drop-down (when not in clone mode) | 970 | /* And force the preferred mode in the drop-down (when not in clone mode) |
414 | 972 | * https://bugzilla.gnome.org/show_bug.cgi?id=680969 */ | 971 | * https://bugzilla.gnome.org/show_bug.cgi?id=680969 */ |
416 | 973 | if (!gnome_rr_config_get_clone (self->priv->current_configuration)) | 972 | if (!gsd_rr_config_get_clone (self->priv->current_configuration)) |
417 | 974 | add_mode (self, mode, output_width, output_height, preferred_id); | 973 | add_mode (self, mode, output_width, output_height, preferred_id); |
418 | 975 | 974 | ||
419 | 976 | current = make_resolution_string (output_width, output_height); | 975 | current = make_resolution_string (output_width, output_height); |
420 | @@ -1012,7 +1011,7 @@ | |||
421 | 1012 | } | 1011 | } |
422 | 1013 | 1012 | ||
423 | 1014 | static gboolean | 1013 | static gboolean |
425 | 1015 | get_mode (GtkWidget *widget, int *width, int *height, int *rate, GnomeRRRotation *rot) | 1014 | get_mode (GtkWidget *widget, int *width, int *height, int *rate, GsdRRRotation *rot) |
426 | 1016 | { | 1015 | { |
427 | 1017 | GtkTreeIter iter; | 1016 | GtkTreeIter iter; |
428 | 1018 | GtkTreeModel *model; | 1017 | GtkTreeModel *model; |
429 | @@ -1032,7 +1031,7 @@ | |||
430 | 1032 | rate = &dummy; | 1031 | rate = &dummy; |
431 | 1033 | 1032 | ||
432 | 1034 | if (!rot) | 1033 | if (!rot) |
434 | 1035 | rot = (GnomeRRRotation *)&dummy; | 1034 | rot = (GsdRRRotation *)&dummy; |
435 | 1036 | 1035 | ||
436 | 1037 | model = gtk_combo_box_get_model (box); | 1036 | model = gtk_combo_box_get_model (box); |
437 | 1038 | gtk_tree_model_get (model, &iter, | 1037 | gtk_tree_model_get (model, &iter, |
438 | @@ -1050,13 +1049,13 @@ | |||
439 | 1050 | on_rotation_changed (GtkComboBox *box, gpointer data) | 1049 | on_rotation_changed (GtkComboBox *box, gpointer data) |
440 | 1051 | { | 1050 | { |
441 | 1052 | CcDisplayPanel *self = data; | 1051 | CcDisplayPanel *self = data; |
443 | 1053 | GnomeRRRotation rotation; | 1052 | GsdRRRotation rotation; |
444 | 1054 | 1053 | ||
445 | 1055 | if (!self->priv->current_output) | 1054 | if (!self->priv->current_output) |
446 | 1056 | return; | 1055 | return; |
447 | 1057 | 1056 | ||
448 | 1058 | if (get_mode (self->priv->rotation_combo, NULL, NULL, NULL, &rotation)) | 1057 | if (get_mode (self->priv->rotation_combo, NULL, NULL, NULL, &rotation)) |
450 | 1059 | gnome_rr_output_info_set_rotation (self->priv->current_output, rotation); | 1058 | gsd_rr_output_info_set_rotation (self->priv->current_output, rotation); |
451 | 1060 | 1059 | ||
452 | 1061 | foo_scroll_area_invalidate (FOO_SCROLL_AREA (self->priv->area)); | 1060 | foo_scroll_area_invalidate (FOO_SCROLL_AREA (self->priv->area)); |
453 | 1062 | } | 1061 | } |
454 | @@ -1082,7 +1081,7 @@ | |||
455 | 1082 | GVariant *dict; | 1081 | GVariant *dict; |
456 | 1083 | GVariant *new_dict; | 1082 | GVariant *new_dict; |
457 | 1084 | 1083 | ||
459 | 1085 | monitor_name = gnome_rr_output_info_get_name (self->priv->current_output); | 1084 | monitor_name = gsd_rr_output_info_get_name (self->priv->current_output); |
460 | 1086 | if (!monitor_name) | 1085 | if (!monitor_name) |
461 | 1087 | { | 1086 | { |
462 | 1088 | g_warning("Failed to get monitor name."); | 1087 | g_warning("Failed to get monitor name."); |
463 | @@ -1107,17 +1106,17 @@ | |||
464 | 1107 | static void | 1106 | static void |
465 | 1108 | select_resolution_for_current_output (CcDisplayPanel *self) | 1107 | select_resolution_for_current_output (CcDisplayPanel *self) |
466 | 1109 | { | 1108 | { |
468 | 1110 | GnomeRRMode **modes; | 1109 | GsdRRMode **modes; |
469 | 1111 | int width, height; | 1110 | int width, height; |
470 | 1112 | int x,y; | 1111 | int x,y; |
472 | 1113 | gnome_rr_output_info_get_geometry (self->priv->current_output, &x, &y, NULL, NULL); | 1112 | gsd_rr_output_info_get_geometry (self->priv->current_output, &x, &y, NULL, NULL); |
473 | 1114 | 1113 | ||
476 | 1115 | width = gnome_rr_output_info_get_preferred_width (self->priv->current_output); | 1114 | width = gsd_rr_output_info_get_preferred_width (self->priv->current_output); |
477 | 1116 | height = gnome_rr_output_info_get_preferred_height (self->priv->current_output); | 1115 | height = gsd_rr_output_info_get_preferred_height (self->priv->current_output); |
478 | 1117 | 1116 | ||
479 | 1118 | if (width != 0 && height != 0) | 1117 | if (width != 0 && height != 0) |
480 | 1119 | { | 1118 | { |
482 | 1120 | gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); | 1119 | gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); |
483 | 1121 | return; | 1120 | return; |
484 | 1122 | } | 1121 | } |
485 | 1123 | 1122 | ||
486 | @@ -1127,7 +1126,7 @@ | |||
487 | 1127 | 1126 | ||
488 | 1128 | find_best_mode (modes, &width, &height); | 1127 | find_best_mode (modes, &width, &height); |
489 | 1129 | 1128 | ||
491 | 1130 | gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); | 1129 | gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); |
492 | 1131 | } | 1130 | } |
493 | 1132 | 1131 | ||
494 | 1133 | static void | 1132 | static void |
495 | @@ -1145,13 +1144,13 @@ | |||
496 | 1145 | 1144 | ||
497 | 1146 | if (value) | 1145 | if (value) |
498 | 1147 | { | 1146 | { |
500 | 1148 | gnome_rr_output_info_set_active (self->priv->current_output, TRUE); | 1147 | gsd_rr_output_info_set_active (self->priv->current_output, TRUE); |
501 | 1149 | select_resolution_for_current_output (self); | 1148 | select_resolution_for_current_output (self); |
502 | 1150 | } | 1149 | } |
503 | 1151 | else | 1150 | else |
504 | 1152 | { | 1151 | { |
507 | 1153 | gnome_rr_output_info_set_active (self->priv->current_output, FALSE); | 1152 | gsd_rr_output_info_set_active (self->priv->current_output, FALSE); |
508 | 1154 | gnome_rr_config_ensure_primary (self->priv->current_configuration); | 1153 | gsd_rr_config_ensure_primary (self->priv->current_configuration); |
509 | 1155 | } | 1154 | } |
510 | 1156 | 1155 | ||
511 | 1157 | rebuild_gui (self); | 1156 | rebuild_gui (self); |
512 | @@ -1159,7 +1158,7 @@ | |||
513 | 1159 | } | 1158 | } |
514 | 1160 | 1159 | ||
515 | 1161 | static void | 1160 | static void |
517 | 1162 | realign_outputs_after_resolution_change (CcDisplayPanel *self, GnomeRROutputInfo *output_that_changed, int old_width, int old_height) | 1161 | realign_outputs_after_resolution_change (CcDisplayPanel *self, GsdRROutputInfo *output_that_changed, int old_width, int old_height) |
518 | 1163 | { | 1162 | { |
519 | 1164 | /* We find the outputs that were below or to the right of the output that | 1163 | /* We find the outputs that were below or to the right of the output that |
520 | 1165 | * changed, and realign them; we also do that for outputs that shared the | 1164 | * changed, and realign them; we also do that for outputs that shared the |
521 | @@ -1171,11 +1170,11 @@ | |||
522 | 1171 | int old_right_edge, old_bottom_edge; | 1170 | int old_right_edge, old_bottom_edge; |
523 | 1172 | int dx, dy; | 1171 | int dx, dy; |
524 | 1173 | int x, y, width, height; | 1172 | int x, y, width, height; |
526 | 1174 | GnomeRROutputInfo **outputs; | 1173 | GsdRROutputInfo **outputs; |
527 | 1175 | 1174 | ||
528 | 1176 | g_assert (self->priv->current_configuration != NULL); | 1175 | g_assert (self->priv->current_configuration != NULL); |
529 | 1177 | 1176 | ||
531 | 1178 | gnome_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height); | 1177 | gsd_rr_output_info_get_geometry (output_that_changed, &x, &y, &width, &height); |
532 | 1179 | 1178 | ||
533 | 1180 | if (width == old_width && height == old_height) | 1179 | if (width == old_width && height == old_height) |
534 | 1181 | return; | 1180 | return; |
535 | @@ -1186,17 +1185,17 @@ | |||
536 | 1186 | dx = width - old_width; | 1185 | dx = width - old_width; |
537 | 1187 | dy = height - old_height; | 1186 | dy = height - old_height; |
538 | 1188 | 1187 | ||
540 | 1189 | outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 1188 | outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
541 | 1190 | 1189 | ||
542 | 1191 | for (i = 0; outputs[i] != NULL; i++) | 1190 | for (i = 0; outputs[i] != NULL; i++) |
543 | 1192 | { | 1191 | { |
544 | 1193 | int output_x, output_y; | 1192 | int output_x, output_y; |
545 | 1194 | int output_width, output_height; | 1193 | int output_width, output_height; |
546 | 1195 | 1194 | ||
548 | 1196 | if (outputs[i] == output_that_changed || !gnome_rr_output_info_is_connected (outputs[i])) | 1195 | if (outputs[i] == output_that_changed || !gsd_rr_output_info_is_connected (outputs[i])) |
549 | 1197 | continue; | 1196 | continue; |
550 | 1198 | 1197 | ||
552 | 1199 | gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); | 1198 | gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); |
553 | 1200 | 1199 | ||
554 | 1201 | if (output_x >= old_right_edge) | 1200 | if (output_x >= old_right_edge) |
555 | 1202 | output_x += dx; | 1201 | output_x += dx; |
556 | @@ -1208,7 +1207,7 @@ | |||
557 | 1208 | else if (output_y + output_height == old_bottom_edge) | 1207 | else if (output_y + output_height == old_bottom_edge) |
558 | 1209 | output_y = y + height - output_height; | 1208 | output_y = y + height - output_height; |
559 | 1210 | 1209 | ||
561 | 1211 | gnome_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height); | 1210 | gsd_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height); |
562 | 1212 | } | 1211 | } |
563 | 1213 | } | 1212 | } |
564 | 1214 | 1213 | ||
565 | @@ -1224,16 +1223,16 @@ | |||
566 | 1224 | if (!self->priv->current_output) | 1223 | if (!self->priv->current_output) |
567 | 1225 | return; | 1224 | return; |
568 | 1226 | 1225 | ||
570 | 1227 | gnome_rr_output_info_get_geometry (self->priv->current_output, &x, &y, &old_width, &old_height); | 1226 | gsd_rr_output_info_get_geometry (self->priv->current_output, &x, &y, &old_width, &old_height); |
571 | 1228 | 1227 | ||
572 | 1229 | if (get_mode (self->priv->resolution_combo, &width, &height, NULL, NULL)) | 1228 | if (get_mode (self->priv->resolution_combo, &width, &height, NULL, NULL)) |
573 | 1230 | { | 1229 | { |
575 | 1231 | gnome_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); | 1230 | gsd_rr_output_info_set_geometry (self->priv->current_output, x, y, width, height); |
576 | 1232 | 1231 | ||
577 | 1233 | if (width == 0 || height == 0) | 1232 | if (width == 0 || height == 0) |
579 | 1234 | gnome_rr_output_info_set_active (self->priv->current_output, FALSE); | 1233 | gsd_rr_output_info_set_active (self->priv->current_output, FALSE); |
580 | 1235 | else | 1234 | else |
582 | 1236 | gnome_rr_output_info_set_active (self->priv->current_output, TRUE); | 1235 | gsd_rr_output_info_set_active (self->priv->current_output, TRUE); |
583 | 1237 | } | 1236 | } |
584 | 1238 | 1237 | ||
585 | 1239 | realign_outputs_after_resolution_change (self, self->priv->current_output, old_width, old_height); | 1238 | realign_outputs_after_resolution_change (self, self->priv->current_output, old_width, old_height); |
586 | @@ -1248,7 +1247,7 @@ | |||
587 | 1248 | { | 1247 | { |
588 | 1249 | int i; | 1248 | int i; |
589 | 1250 | int x; | 1249 | int x; |
591 | 1251 | GnomeRROutputInfo **outputs; | 1250 | GsdRROutputInfo **outputs; |
592 | 1252 | 1251 | ||
593 | 1253 | /* Lay out all the monitors horizontally when "mirror screens" is turned | 1252 | /* Lay out all the monitors horizontally when "mirror screens" is turned |
594 | 1254 | * off, to avoid having all of them overlapped initially. We put the | 1253 | * off, to avoid having all of them overlapped initially. We put the |
595 | @@ -1258,15 +1257,15 @@ | |||
596 | 1258 | x = 0; | 1257 | x = 0; |
597 | 1259 | 1258 | ||
598 | 1260 | /* First pass, all "on" outputs */ | 1259 | /* First pass, all "on" outputs */ |
600 | 1261 | outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 1260 | outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
601 | 1262 | 1261 | ||
602 | 1263 | for (i = 0; outputs[i]; ++i) | 1262 | for (i = 0; outputs[i]; ++i) |
603 | 1264 | { | 1263 | { |
604 | 1265 | int width, height; | 1264 | int width, height; |
606 | 1266 | if (gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i])) | 1265 | if (gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i])) |
607 | 1267 | { | 1266 | { |
610 | 1268 | gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height); | 1267 | gsd_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height); |
611 | 1269 | gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height); | 1268 | gsd_rr_output_info_set_geometry (outputs[i], x, 0, width, height); |
612 | 1270 | x += width; | 1269 | x += width; |
613 | 1271 | } | 1270 | } |
614 | 1272 | } | 1271 | } |
615 | @@ -1276,10 +1275,10 @@ | |||
616 | 1276 | for (i = 0; outputs[i]; ++i) | 1275 | for (i = 0; outputs[i]; ++i) |
617 | 1277 | { | 1276 | { |
618 | 1278 | int width, height; | 1277 | int width, height; |
620 | 1279 | if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i]))) | 1278 | if (!(gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i]))) |
621 | 1280 | { | 1279 | { |
624 | 1281 | gnome_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height); | 1280 | gsd_rr_output_info_get_geometry (outputs[i], NULL, NULL, &width, &height); |
625 | 1282 | gnome_rr_output_info_set_geometry (outputs[i], x, 0, width, height); | 1281 | gsd_rr_output_info_set_geometry (outputs[i], x, 0, width, height); |
626 | 1283 | x += width; | 1282 | x += width; |
627 | 1284 | } | 1283 | } |
628 | 1285 | } | 1284 | } |
629 | @@ -1290,9 +1289,9 @@ | |||
630 | 1290 | * Do we need to put this function in gnome-desktop for public use? | 1289 | * Do we need to put this function in gnome-desktop for public use? |
631 | 1291 | */ | 1290 | */ |
632 | 1292 | static gboolean | 1291 | static gboolean |
634 | 1293 | get_clone_size (GnomeRRScreen *screen, int *width, int *height) | 1292 | get_clone_size (GsdRRScreen *screen, int *width, int *height) |
635 | 1294 | { | 1293 | { |
637 | 1295 | GnomeRRMode **modes = gnome_rr_screen_list_clone_modes (screen); | 1294 | GsdRRMode **modes = gsd_rr_screen_list_clone_modes (screen); |
638 | 1296 | int best_w, best_h; | 1295 | int best_w, best_h; |
639 | 1297 | int i; | 1296 | int i; |
640 | 1298 | 1297 | ||
641 | @@ -1300,11 +1299,11 @@ | |||
642 | 1300 | best_h = 0; | 1299 | best_h = 0; |
643 | 1301 | 1300 | ||
644 | 1302 | for (i = 0; modes[i] != NULL; ++i) { | 1301 | for (i = 0; modes[i] != NULL; ++i) { |
646 | 1303 | GnomeRRMode *mode = modes[i]; | 1302 | GsdRRMode *mode = modes[i]; |
647 | 1304 | int w, h; | 1303 | int w, h; |
648 | 1305 | 1304 | ||
651 | 1306 | w = gnome_rr_mode_get_width (mode); | 1305 | w = gsd_rr_mode_get_width (mode); |
652 | 1307 | h = gnome_rr_mode_get_height (mode); | 1306 | h = gsd_rr_mode_get_height (mode); |
653 | 1308 | 1307 | ||
654 | 1309 | if (w * h > best_w * best_h) { | 1308 | if (w * h > best_w * best_h) { |
655 | 1310 | best_w = w; | 1309 | best_w = w; |
656 | @@ -1325,24 +1324,24 @@ | |||
657 | 1325 | } | 1324 | } |
658 | 1326 | 1325 | ||
659 | 1327 | static gboolean | 1326 | static gboolean |
661 | 1328 | output_info_supports_mode (CcDisplayPanel *self, GnomeRROutputInfo *info, int width, int height) | 1327 | output_info_supports_mode (CcDisplayPanel *self, GsdRROutputInfo *info, int width, int height) |
662 | 1329 | { | 1328 | { |
665 | 1330 | GnomeRROutput *output; | 1329 | GsdRROutput *output; |
666 | 1331 | GnomeRRMode **modes; | 1330 | GsdRRMode **modes; |
667 | 1332 | int i; | 1331 | int i; |
668 | 1333 | 1332 | ||
670 | 1334 | if (!gnome_rr_output_info_is_connected (info)) | 1333 | if (!gsd_rr_output_info_is_connected (info)) |
671 | 1335 | return FALSE; | 1334 | return FALSE; |
672 | 1336 | 1335 | ||
674 | 1337 | output = gnome_rr_screen_get_output_by_name (self->priv->screen, gnome_rr_output_info_get_name (info)); | 1336 | output = gsd_rr_screen_get_output_by_name (self->priv->screen, gsd_rr_output_info_get_name (info)); |
675 | 1338 | if (!output) | 1337 | if (!output) |
676 | 1339 | return FALSE; | 1338 | return FALSE; |
677 | 1340 | 1339 | ||
679 | 1341 | modes = gnome_rr_output_list_modes (output); | 1340 | modes = gsd_rr_output_list_modes (output); |
680 | 1342 | 1341 | ||
681 | 1343 | for (i = 0; modes[i]; i++) { | 1342 | for (i = 0; modes[i]; i++) { |
684 | 1344 | if (gnome_rr_mode_get_width (modes[i]) == width | 1343 | if (gsd_rr_mode_get_width (modes[i]) == width |
685 | 1345 | && gnome_rr_mode_get_height (modes[i]) == height) | 1344 | && gsd_rr_mode_get_height (modes[i]) == height) |
686 | 1346 | return TRUE; | 1345 | return TRUE; |
687 | 1347 | } | 1346 | } |
688 | 1348 | 1347 | ||
689 | @@ -1354,17 +1353,17 @@ | |||
690 | 1354 | { | 1353 | { |
691 | 1355 | CcDisplayPanel *self = data; | 1354 | CcDisplayPanel *self = data; |
692 | 1356 | 1355 | ||
694 | 1357 | gnome_rr_config_set_clone (self->priv->current_configuration, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->priv->clone_checkbox))); | 1356 | gsd_rr_config_set_clone (self->priv->current_configuration, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->priv->clone_checkbox))); |
695 | 1358 | 1357 | ||
697 | 1359 | if (gnome_rr_config_get_clone (self->priv->current_configuration)) | 1358 | if (gsd_rr_config_get_clone (self->priv->current_configuration)) |
698 | 1360 | { | 1359 | { |
699 | 1361 | int i; | 1360 | int i; |
700 | 1362 | int width, height; | 1361 | int width, height; |
702 | 1363 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 1362 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
703 | 1364 | 1363 | ||
704 | 1365 | for (i = 0; outputs[i]; ++i) | 1364 | for (i = 0; outputs[i]; ++i) |
705 | 1366 | { | 1365 | { |
707 | 1367 | if (gnome_rr_output_info_is_connected (outputs[i])) | 1366 | if (gsd_rr_output_info_is_connected (outputs[i])) |
708 | 1368 | { | 1367 | { |
709 | 1369 | self->priv->current_output = outputs[i]; | 1368 | self->priv->current_output = outputs[i]; |
710 | 1370 | break; | 1369 | break; |
711 | @@ -1381,9 +1380,9 @@ | |||
712 | 1381 | for (i = 0; outputs[i]; i++) { | 1380 | for (i = 0; outputs[i]; i++) { |
713 | 1382 | int x, y; | 1381 | int x, y; |
714 | 1383 | if (output_info_supports_mode (self, outputs[i], width, height)) { | 1382 | if (output_info_supports_mode (self, outputs[i], width, height)) { |
718 | 1384 | gnome_rr_output_info_set_active (outputs[i], TRUE); | 1383 | gsd_rr_output_info_set_active (outputs[i], TRUE); |
719 | 1385 | gnome_rr_output_info_get_geometry (outputs[i], &x, &y, NULL, NULL); | 1384 | gsd_rr_output_info_get_geometry (outputs[i], &x, &y, NULL, NULL); |
720 | 1386 | gnome_rr_output_info_set_geometry (outputs[i], x, y, width, height); | 1385 | gsd_rr_output_info_set_geometry (outputs[i], x, y, width, height); |
721 | 1387 | } | 1386 | } |
722 | 1388 | } | 1387 | } |
723 | 1389 | } | 1388 | } |
724 | @@ -1397,12 +1396,12 @@ | |||
725 | 1397 | } | 1396 | } |
726 | 1398 | 1397 | ||
727 | 1399 | static void | 1398 | static void |
729 | 1400 | apply_rotation_to_geometry (GnomeRROutputInfo *output, int *w, int *h) | 1399 | apply_rotation_to_geometry (GsdRROutputInfo *output, int *w, int *h) |
730 | 1401 | { | 1400 | { |
732 | 1402 | GnomeRRRotation rotation; | 1401 | GsdRRRotation rotation; |
733 | 1403 | 1402 | ||
736 | 1404 | rotation = gnome_rr_output_info_get_rotation (output); | 1403 | rotation = gsd_rr_output_info_get_rotation (output); |
737 | 1405 | if ((rotation & GNOME_RR_ROTATION_90) || (rotation & GNOME_RR_ROTATION_270)) | 1404 | if ((rotation & GSD_RR_ROTATION_90) || (rotation & GSD_RR_ROTATION_270)) |
738 | 1406 | { | 1405 | { |
739 | 1407 | int tmp; | 1406 | int tmp; |
740 | 1408 | tmp = *h; | 1407 | tmp = *h; |
741 | @@ -1412,16 +1411,16 @@ | |||
742 | 1412 | } | 1411 | } |
743 | 1413 | 1412 | ||
744 | 1414 | static void | 1413 | static void |
746 | 1415 | get_geometry (GnomeRROutputInfo *output, int *w, int *h) | 1414 | get_geometry (GsdRROutputInfo *output, int *w, int *h) |
747 | 1416 | { | 1415 | { |
749 | 1417 | if (gnome_rr_output_info_is_active (output)) | 1416 | if (gsd_rr_output_info_is_active (output)) |
750 | 1418 | { | 1417 | { |
752 | 1419 | gnome_rr_output_info_get_geometry (output, NULL, NULL, w, h); | 1418 | gsd_rr_output_info_get_geometry (output, NULL, NULL, w, h); |
753 | 1420 | } | 1419 | } |
754 | 1421 | else | 1420 | else |
755 | 1422 | { | 1421 | { |
758 | 1423 | *h = gnome_rr_output_info_get_preferred_height (output); | 1422 | *h = gsd_rr_output_info_get_preferred_height (output); |
759 | 1424 | *w = gnome_rr_output_info_get_preferred_width (output); | 1423 | *w = gsd_rr_output_info_get_preferred_width (output); |
760 | 1425 | } | 1424 | } |
761 | 1426 | 1425 | ||
762 | 1427 | apply_rotation_to_geometry (output, w, h); | 1426 | apply_rotation_to_geometry (output, w, h); |
763 | @@ -1435,7 +1434,7 @@ | |||
764 | 1435 | { | 1434 | { |
765 | 1436 | int i, dummy; | 1435 | int i, dummy; |
766 | 1437 | GList *result = NULL; | 1436 | GList *result = NULL; |
768 | 1438 | GnomeRROutputInfo **outputs; | 1437 | GsdRROutputInfo **outputs; |
769 | 1439 | 1438 | ||
770 | 1440 | if (!total_w) | 1439 | if (!total_w) |
771 | 1441 | total_w = &dummy; | 1440 | total_w = &dummy; |
772 | @@ -1445,10 +1444,10 @@ | |||
773 | 1445 | *total_w = 0; | 1444 | *total_w = 0; |
774 | 1446 | *total_h = 0; | 1445 | *total_h = 0; |
775 | 1447 | 1446 | ||
777 | 1448 | outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 1447 | outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
778 | 1449 | for (i = 0; outputs[i] != NULL; ++i) | 1448 | for (i = 0; outputs[i] != NULL; ++i) |
779 | 1450 | { | 1449 | { |
781 | 1451 | if (gnome_rr_output_info_is_connected (outputs[i])) | 1450 | if (gsd_rr_output_info_is_connected (outputs[i])) |
782 | 1452 | { | 1451 | { |
783 | 1453 | int w, h; | 1452 | int w, h; |
784 | 1454 | 1453 | ||
785 | @@ -1500,7 +1499,7 @@ | |||
786 | 1500 | 1499 | ||
787 | 1501 | typedef struct Edge | 1500 | typedef struct Edge |
788 | 1502 | { | 1501 | { |
790 | 1503 | GnomeRROutputInfo *output; | 1502 | GsdRROutputInfo *output; |
791 | 1504 | int x1, y1; | 1503 | int x1, y1; |
792 | 1505 | int x2, y2; | 1504 | int x2, y2; |
793 | 1506 | } Edge; | 1505 | } Edge; |
794 | @@ -1513,7 +1512,7 @@ | |||
795 | 1513 | } Snap; | 1512 | } Snap; |
796 | 1514 | 1513 | ||
797 | 1515 | static void | 1514 | static void |
799 | 1516 | add_edge (GnomeRROutputInfo *output, int x1, int y1, int x2, int y2, GArray *edges) | 1515 | add_edge (GsdRROutputInfo *output, int x1, int y1, int x2, int y2, GArray *edges) |
800 | 1517 | { | 1516 | { |
801 | 1518 | Edge e; | 1517 | Edge e; |
802 | 1519 | 1518 | ||
803 | @@ -1527,11 +1526,11 @@ | |||
804 | 1527 | } | 1526 | } |
805 | 1528 | 1527 | ||
806 | 1529 | static void | 1528 | static void |
808 | 1530 | list_edges_for_output (GnomeRROutputInfo *output, GArray *edges) | 1529 | list_edges_for_output (GsdRROutputInfo *output, GArray *edges) |
809 | 1531 | { | 1530 | { |
810 | 1532 | int x, y, w, h; | 1531 | int x, y, w, h; |
811 | 1533 | 1532 | ||
813 | 1534 | gnome_rr_output_info_get_geometry (output, &x, &y, &w, &h); | 1533 | gsd_rr_output_info_get_geometry (output, &x, &y, &w, &h); |
814 | 1535 | 1534 | ||
815 | 1536 | apply_rotation_to_geometry (output, &w, &h); | 1535 | apply_rotation_to_geometry (output, &w, &h); |
816 | 1537 | 1536 | ||
817 | @@ -1543,14 +1542,14 @@ | |||
818 | 1543 | } | 1542 | } |
819 | 1544 | 1543 | ||
820 | 1545 | static void | 1544 | static void |
822 | 1546 | list_edges (GnomeRRConfig *config, GArray *edges) | 1545 | list_edges (GsdRRConfig *config, GArray *edges) |
823 | 1547 | { | 1546 | { |
824 | 1548 | int i; | 1547 | int i; |
826 | 1549 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config); | 1548 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config); |
827 | 1550 | 1549 | ||
828 | 1551 | for (i = 0; outputs[i]; ++i) | 1550 | for (i = 0; outputs[i]; ++i) |
829 | 1552 | { | 1551 | { |
831 | 1553 | if (gnome_rr_output_info_is_connected (outputs[i])) | 1552 | if (gsd_rr_output_info_is_connected (outputs[i])) |
832 | 1554 | list_edges_for_output (outputs[i], edges); | 1553 | list_edges_for_output (outputs[i], edges); |
833 | 1555 | } | 1554 | } |
834 | 1556 | } | 1555 | } |
835 | @@ -1636,7 +1635,7 @@ | |||
836 | 1636 | } | 1635 | } |
837 | 1637 | 1636 | ||
838 | 1638 | static void | 1637 | static void |
840 | 1639 | list_snaps (GnomeRROutputInfo *output, GArray *edges, GArray *snaps) | 1638 | list_snaps (GsdRROutputInfo *output, GArray *edges, GArray *snaps) |
841 | 1640 | { | 1639 | { |
842 | 1641 | int i; | 1640 | int i; |
843 | 1642 | 1641 | ||
844 | @@ -1692,7 +1691,7 @@ | |||
845 | 1692 | } | 1691 | } |
846 | 1693 | 1692 | ||
847 | 1694 | static gboolean | 1693 | static gboolean |
849 | 1695 | output_is_aligned (GnomeRROutputInfo *output, GArray *edges) | 1694 | output_is_aligned (GsdRROutputInfo *output, GArray *edges) |
850 | 1696 | { | 1695 | { |
851 | 1697 | gboolean result = FALSE; | 1696 | gboolean result = FALSE; |
852 | 1698 | int i; | 1697 | int i; |
853 | @@ -1729,28 +1728,28 @@ | |||
854 | 1729 | } | 1728 | } |
855 | 1730 | 1729 | ||
856 | 1731 | static void | 1730 | static void |
858 | 1732 | get_output_rect (GnomeRROutputInfo *output, GdkRectangle *rect) | 1731 | get_output_rect (GsdRROutputInfo *output, GdkRectangle *rect) |
859 | 1733 | { | 1732 | { |
861 | 1734 | gnome_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height); | 1733 | gsd_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height); |
862 | 1735 | 1734 | ||
863 | 1736 | apply_rotation_to_geometry (output, &rect->width, &rect->height); | 1735 | apply_rotation_to_geometry (output, &rect->width, &rect->height); |
864 | 1737 | } | 1736 | } |
865 | 1738 | 1737 | ||
866 | 1739 | static gboolean | 1738 | static gboolean |
868 | 1740 | output_overlaps (GnomeRROutputInfo *output, GnomeRRConfig *config) | 1739 | output_overlaps (GsdRROutputInfo *output, GsdRRConfig *config) |
869 | 1741 | { | 1740 | { |
870 | 1742 | int i; | 1741 | int i; |
871 | 1743 | GdkRectangle output_rect; | 1742 | GdkRectangle output_rect; |
873 | 1744 | GnomeRROutputInfo **outputs; | 1743 | GsdRROutputInfo **outputs; |
874 | 1745 | 1744 | ||
875 | 1746 | g_assert (output != NULL); | 1745 | g_assert (output != NULL); |
876 | 1747 | 1746 | ||
877 | 1748 | get_output_rect (output, &output_rect); | 1747 | get_output_rect (output, &output_rect); |
878 | 1749 | 1748 | ||
880 | 1750 | outputs = gnome_rr_config_get_outputs (config); | 1749 | outputs = gsd_rr_config_get_outputs (config); |
881 | 1751 | for (i = 0; outputs[i]; ++i) | 1750 | for (i = 0; outputs[i]; ++i) |
882 | 1752 | { | 1751 | { |
884 | 1753 | if (outputs[i] != output && gnome_rr_output_info_is_connected (outputs[i])) | 1752 | if (outputs[i] != output && gsd_rr_output_info_is_connected (outputs[i])) |
885 | 1754 | { | 1753 | { |
886 | 1755 | GdkRectangle other_rect; | 1754 | GdkRectangle other_rect; |
887 | 1756 | 1755 | ||
888 | @@ -1764,16 +1763,16 @@ | |||
889 | 1764 | } | 1763 | } |
890 | 1765 | 1764 | ||
891 | 1766 | static gboolean | 1765 | static gboolean |
893 | 1767 | gnome_rr_config_is_aligned (GnomeRRConfig *config, GArray *edges) | 1766 | gsd_rr_config_is_aligned (GsdRRConfig *config, GArray *edges) |
894 | 1768 | { | 1767 | { |
895 | 1769 | int i; | 1768 | int i; |
896 | 1770 | gboolean result = TRUE; | 1769 | gboolean result = TRUE; |
898 | 1771 | GnomeRROutputInfo **outputs; | 1770 | GsdRROutputInfo **outputs; |
899 | 1772 | 1771 | ||
901 | 1773 | outputs = gnome_rr_config_get_outputs (config); | 1772 | outputs = gsd_rr_config_get_outputs (config); |
902 | 1774 | for (i = 0; outputs[i]; ++i) | 1773 | for (i = 0; outputs[i]; ++i) |
903 | 1775 | { | 1774 | { |
905 | 1776 | if (gnome_rr_output_info_is_connected (outputs[i])) | 1775 | if (gsd_rr_output_info_is_connected (outputs[i])) |
906 | 1777 | { | 1776 | { |
907 | 1778 | if (!output_is_aligned (outputs[i], edges)) | 1777 | if (!output_is_aligned (outputs[i], edges)) |
908 | 1779 | return FALSE; | 1778 | return FALSE; |
909 | @@ -1879,7 +1878,7 @@ | |||
910 | 1879 | * on_canvas_event() for where we reset the cursor to the default if it | 1878 | * on_canvas_event() for where we reset the cursor to the default if it |
911 | 1880 | * exits the outputs' area. | 1879 | * exits the outputs' area. |
912 | 1881 | */ | 1880 | */ |
914 | 1882 | if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) | 1881 | if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) |
915 | 1883 | set_cursor (GTK_WIDGET (area), GDK_HAND1); | 1882 | set_cursor (GTK_WIDGET (area), GDK_HAND1); |
916 | 1884 | 1883 | ||
917 | 1885 | if (event->type == FOO_BUTTON_PRESS) | 1884 | if (event->type == FOO_BUTTON_PRESS) |
918 | @@ -1887,7 +1886,7 @@ | |||
919 | 1887 | rebuild_gui (self); | 1886 | rebuild_gui (self); |
920 | 1888 | set_top_bar_tooltip (self, TRUE); | 1887 | set_top_bar_tooltip (self, TRUE); |
921 | 1889 | 1888 | ||
923 | 1890 | if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) | 1889 | if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) |
924 | 1891 | { | 1890 | { |
925 | 1892 | self->priv->dragging_top_bar = TRUE; | 1891 | self->priv->dragging_top_bar = TRUE; |
926 | 1893 | foo_scroll_area_begin_grab (area, (FooScrollAreaEventFunc) on_top_bar_event, self); | 1892 | foo_scroll_area_begin_grab (area, (FooScrollAreaEventFunc) on_top_bar_event, self); |
927 | @@ -1926,14 +1925,14 @@ | |||
928 | 1926 | 1925 | ||
929 | 1927 | static void | 1926 | static void |
930 | 1928 | set_primary_output (CcDisplayPanel *self, | 1927 | set_primary_output (CcDisplayPanel *self, |
932 | 1929 | GnomeRROutputInfo *output) | 1928 | GsdRROutputInfo *output) |
933 | 1930 | { | 1929 | { |
934 | 1931 | int i; | 1930 | int i; |
936 | 1932 | GnomeRROutputInfo **outputs; | 1931 | GsdRROutputInfo **outputs; |
937 | 1933 | 1932 | ||
939 | 1934 | outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 1933 | outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
940 | 1935 | for (i = 0; outputs[i] != NULL; ++i) | 1934 | for (i = 0; outputs[i] != NULL; ++i) |
942 | 1936 | gnome_rr_output_info_set_primary (outputs[i], outputs[i] == output); | 1935 | gsd_rr_output_info_set_primary (outputs[i], outputs[i] == output); |
943 | 1937 | 1936 | ||
944 | 1938 | gtk_widget_queue_draw (WID ("self->priv->area")); | 1937 | gtk_widget_queue_draw (WID ("self->priv->area")); |
945 | 1939 | /* refresh the combobox */ | 1938 | /* refresh the combobox */ |
946 | @@ -1945,12 +1944,12 @@ | |||
947 | 1945 | FooScrollAreaEvent *event, | 1944 | FooScrollAreaEvent *event, |
948 | 1946 | gpointer data) | 1945 | gpointer data) |
949 | 1947 | { | 1946 | { |
951 | 1948 | GnomeRROutputInfo *output = data; | 1947 | GsdRROutputInfo *output = data; |
952 | 1949 | CcDisplayPanel *self = g_object_get_data (G_OBJECT (area), "panel"); | 1948 | CcDisplayPanel *self = g_object_get_data (G_OBJECT (area), "panel"); |
953 | 1950 | 1949 | ||
954 | 1951 | if (event->type == FOO_DRAG_HOVER) | 1950 | if (event->type == FOO_DRAG_HOVER) |
955 | 1952 | { | 1951 | { |
957 | 1953 | if (gnome_rr_output_info_is_active (output) && self->priv->dragging_top_bar) | 1952 | if (gsd_rr_output_info_is_active (output) && self->priv->dragging_top_bar) |
958 | 1954 | set_primary_output (self, output); | 1953 | set_primary_output (self, output); |
959 | 1955 | return; | 1954 | return; |
960 | 1956 | } | 1955 | } |
961 | @@ -1964,7 +1963,7 @@ | |||
962 | 1964 | * on_canvas_event() for where we reset the cursor to the default if it | 1963 | * on_canvas_event() for where we reset the cursor to the default if it |
963 | 1965 | * exits the outputs' area. | 1964 | * exits the outputs' area. |
964 | 1966 | */ | 1965 | */ |
966 | 1967 | if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) | 1966 | if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) |
967 | 1968 | set_cursor (GTK_WIDGET (area), GDK_FLEUR); | 1967 | set_cursor (GTK_WIDGET (area), GDK_FLEUR); |
968 | 1969 | 1968 | ||
969 | 1970 | if (event->type == FOO_BUTTON_PRESS) | 1969 | if (event->type == FOO_BUTTON_PRESS) |
970 | @@ -1976,10 +1975,10 @@ | |||
971 | 1976 | rebuild_gui (self); | 1975 | rebuild_gui (self); |
972 | 1977 | set_monitors_tooltip (self, TRUE); | 1976 | set_monitors_tooltip (self, TRUE); |
973 | 1978 | 1977 | ||
975 | 1979 | if (!gnome_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) | 1978 | if (!gsd_rr_config_get_clone (self->priv->current_configuration) && get_n_connected (self) > 1) |
976 | 1980 | { | 1979 | { |
977 | 1981 | int output_x, output_y; | 1980 | int output_x, output_y; |
979 | 1982 | gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL); | 1981 | gsd_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL); |
980 | 1983 | 1982 | ||
981 | 1984 | foo_scroll_area_begin_grab (area, on_output_event, data); | 1983 | foo_scroll_area_begin_grab (area, on_output_event, data); |
982 | 1985 | 1984 | ||
983 | @@ -2005,11 +2004,11 @@ | |||
984 | 2005 | int i; | 2004 | int i; |
985 | 2006 | GArray *edges, *snaps, *new_edges; | 2005 | GArray *edges, *snaps, *new_edges; |
986 | 2007 | 2006 | ||
988 | 2008 | gnome_rr_output_info_get_geometry (output, &old_x, &old_y, &width, &height); | 2007 | gsd_rr_output_info_get_geometry (output, &old_x, &old_y, &width, &height); |
989 | 2009 | new_x = info->output_x + (event->x - info->grab_x) / scale; | 2008 | new_x = info->output_x + (event->x - info->grab_x) / scale; |
990 | 2010 | new_y = info->output_y + (event->y - info->grab_y) / scale; | 2009 | new_y = info->output_y + (event->y - info->grab_y) / scale; |
991 | 2011 | 2010 | ||
993 | 2012 | gnome_rr_output_info_set_geometry (output, new_x, new_y, width, height); | 2011 | gsd_rr_output_info_set_geometry (output, new_x, new_y, width, height); |
994 | 2013 | 2012 | ||
995 | 2014 | edges = g_array_new (TRUE, TRUE, sizeof (Edge)); | 2013 | edges = g_array_new (TRUE, TRUE, sizeof (Edge)); |
996 | 2015 | snaps = g_array_new (TRUE, TRUE, sizeof (Snap)); | 2014 | snaps = g_array_new (TRUE, TRUE, sizeof (Snap)); |
997 | @@ -2020,26 +2019,26 @@ | |||
998 | 2020 | 2019 | ||
999 | 2021 | g_array_sort (snaps, compare_snaps); | 2020 | g_array_sort (snaps, compare_snaps); |
1000 | 2022 | 2021 | ||
1002 | 2023 | gnome_rr_output_info_set_geometry (output, new_x, new_y, width, height); | 2022 | gsd_rr_output_info_set_geometry (output, new_x, new_y, width, height); |
1003 | 2024 | 2023 | ||
1004 | 2025 | for (i = 0; i < snaps->len; ++i) | 2024 | for (i = 0; i < snaps->len; ++i) |
1005 | 2026 | { | 2025 | { |
1006 | 2027 | Snap *snap = &(g_array_index (snaps, Snap, i)); | 2026 | Snap *snap = &(g_array_index (snaps, Snap, i)); |
1007 | 2028 | GArray *new_edges = g_array_new (TRUE, TRUE, sizeof (Edge)); | 2027 | GArray *new_edges = g_array_new (TRUE, TRUE, sizeof (Edge)); |
1008 | 2029 | 2028 | ||
1010 | 2030 | gnome_rr_output_info_set_geometry (output, new_x + snap->dx, new_y + snap->dy, width, height); | 2029 | gsd_rr_output_info_set_geometry (output, new_x + snap->dx, new_y + snap->dy, width, height); |
1011 | 2031 | 2030 | ||
1012 | 2032 | g_array_set_size (new_edges, 0); | 2031 | g_array_set_size (new_edges, 0); |
1013 | 2033 | list_edges (self->priv->current_configuration, new_edges); | 2032 | list_edges (self->priv->current_configuration, new_edges); |
1014 | 2034 | 2033 | ||
1016 | 2035 | if (gnome_rr_config_is_aligned (self->priv->current_configuration, new_edges)) | 2034 | if (gsd_rr_config_is_aligned (self->priv->current_configuration, new_edges)) |
1017 | 2036 | { | 2035 | { |
1018 | 2037 | g_array_free (new_edges, TRUE); | 2036 | g_array_free (new_edges, TRUE); |
1019 | 2038 | break; | 2037 | break; |
1020 | 2039 | } | 2038 | } |
1021 | 2040 | else | 2039 | else |
1022 | 2041 | { | 2040 | { |
1024 | 2042 | gnome_rr_output_info_set_geometry (output, info->output_x, info->output_y, width, height); | 2041 | gsd_rr_output_info_set_geometry (output, info->output_x, info->output_y, width, height); |
1025 | 2043 | } | 2042 | } |
1026 | 2044 | } | 2043 | } |
1027 | 2045 | 2044 | ||
1028 | @@ -2079,15 +2078,15 @@ | |||
1029 | 2079 | 2078 | ||
1030 | 2080 | static PangoLayout * | 2079 | static PangoLayout * |
1031 | 2081 | get_display_name (CcDisplayPanel *self, | 2080 | get_display_name (CcDisplayPanel *self, |
1033 | 2082 | GnomeRROutputInfo *output) | 2081 | GsdRROutputInfo *output) |
1034 | 2083 | { | 2082 | { |
1035 | 2084 | PangoLayout *layout; | 2083 | PangoLayout *layout; |
1036 | 2085 | char *text; | 2084 | char *text; |
1037 | 2086 | 2085 | ||
1039 | 2087 | if (gnome_rr_config_get_clone (self->priv->current_configuration)) | 2086 | if (gsd_rr_config_get_clone (self->priv->current_configuration)) |
1040 | 2088 | text = mirror_monitor_name (); | 2087 | text = mirror_monitor_name (); |
1041 | 2089 | else | 2088 | else |
1043 | 2090 | text = g_strdup (gnome_rr_output_info_get_display_name (output)); | 2089 | text = g_strdup (gsd_rr_output_info_get_display_name (output)); |
1044 | 2091 | 2090 | ||
1045 | 2092 | layout = gtk_widget_create_pango_layout (GTK_WIDGET (self->priv->area), text); | 2091 | layout = gtk_widget_create_pango_layout (GTK_WIDGET (self->priv->area), text); |
1046 | 2093 | g_free (text); | 2092 | g_free (text); |
1047 | @@ -2167,10 +2166,10 @@ | |||
1048 | 2167 | double scale = compute_scale (self); | 2166 | double scale = compute_scale (self); |
1049 | 2168 | double x, y; | 2167 | double x, y; |
1050 | 2169 | int output_x, output_y; | 2168 | int output_x, output_y; |
1052 | 2170 | GnomeRRRotation rotation; | 2169 | GsdRRRotation rotation; |
1053 | 2171 | int total_w, total_h; | 2170 | int total_w, total_h; |
1054 | 2172 | GList *connected_outputs = list_connected_outputs (self, &total_w, &total_h); | 2171 | GList *connected_outputs = list_connected_outputs (self, &total_w, &total_h); |
1056 | 2173 | GnomeRROutputInfo *output = g_list_nth (connected_outputs, i)->data; | 2172 | GsdRROutputInfo *output = g_list_nth (connected_outputs, i)->data; |
1057 | 2174 | PangoLayout *layout = get_display_name (self, output); | 2173 | PangoLayout *layout = get_display_name (self, output); |
1058 | 2175 | PangoRectangle ink_extent, log_extent; | 2174 | PangoRectangle ink_extent, log_extent; |
1059 | 2176 | GdkRectangle viewport; | 2175 | GdkRectangle viewport; |
1060 | @@ -2192,7 +2191,7 @@ | |||
1061 | 2192 | viewport.height -= 2 * MARGIN; | 2191 | viewport.height -= 2 * MARGIN; |
1062 | 2193 | viewport.width -= 2 * MARGIN; | 2192 | viewport.width -= 2 * MARGIN; |
1063 | 2194 | 2193 | ||
1065 | 2195 | gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL); | 2194 | gsd_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL); |
1066 | 2196 | x = output_x * scale + MARGIN + (viewport.width - total_w * scale) / 2.0; | 2195 | x = output_x * scale + MARGIN + (viewport.width - total_w * scale) / 2.0; |
1067 | 2197 | y = output_y * scale + MARGIN + (viewport.height - total_h * scale) / 2.0; | 2196 | y = output_y * scale + MARGIN + (viewport.height - total_h * scale) / 2.0; |
1068 | 2198 | 2197 | ||
1069 | @@ -2210,11 +2209,11 @@ | |||
1070 | 2210 | 2209 | ||
1071 | 2211 | /* rotation is already applied in get_geometry */ | 2210 | /* rotation is already applied in get_geometry */ |
1072 | 2212 | 2211 | ||
1075 | 2213 | rotation = gnome_rr_output_info_get_rotation (output); | 2212 | rotation = gsd_rr_output_info_get_rotation (output); |
1076 | 2214 | if (rotation & GNOME_RR_REFLECT_X) | 2213 | if (rotation & GSD_RR_REFLECT_X) |
1077 | 2215 | cairo_scale (cr, -1, 1); | 2214 | cairo_scale (cr, -1, 1); |
1078 | 2216 | 2215 | ||
1080 | 2217 | if (rotation & GNOME_RR_REFLECT_Y) | 2216 | if (rotation & GSD_RR_REFLECT_Y) |
1081 | 2218 | cairo_scale (cr, 1, -1); | 2217 | cairo_scale (cr, 1, -1); |
1082 | 2219 | 2218 | ||
1083 | 2220 | cairo_translate (cr, | 2219 | cairo_translate (cr, |
1084 | @@ -2244,7 +2243,7 @@ | |||
1085 | 2244 | g = output_color.green; | 2243 | g = output_color.green; |
1086 | 2245 | b = output_color.blue; | 2244 | b = output_color.blue; |
1087 | 2246 | 2245 | ||
1089 | 2247 | if (!gnome_rr_output_info_is_active (output)) | 2246 | if (!gsd_rr_output_info_is_active (output)) |
1090 | 2248 | { | 2247 | { |
1091 | 2249 | /* If the output is turned off, just darken the selected color */ | 2248 | /* If the output is turned off, just darken the selected color */ |
1092 | 2250 | color_shade (&r, &g, &b, 0.4); | 2249 | color_shade (&r, &g, &b, 0.4); |
1093 | @@ -2280,7 +2279,7 @@ | |||
1094 | 2280 | y + ((h * scale + 0.5) - factor * log_extent.height) / 2); | 2279 | y + ((h * scale + 0.5) - factor * log_extent.height) / 2); |
1095 | 2281 | 2280 | ||
1096 | 2282 | cairo_scale (cr, factor, factor); | 2281 | cairo_scale (cr, factor, factor); |
1098 | 2283 | if (gnome_rr_output_info_is_active (output)) | 2282 | if (gsd_rr_output_info_is_active (output)) |
1099 | 2284 | cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); | 2283 | cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); |
1100 | 2285 | else | 2284 | else |
1101 | 2286 | cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); | 2285 | cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); |
1102 | @@ -2292,7 +2291,7 @@ | |||
1103 | 2292 | /* Only display a launcher on all or primary monitor */ | 2291 | /* Only display a launcher on all or primary monitor */ |
1104 | 2293 | if (is_unity_session ()) | 2292 | if (is_unity_session ()) |
1105 | 2294 | { | 2293 | { |
1107 | 2295 | if (gnome_rr_output_info_is_active (output) && (unity_launcher_on_all_monitors (self->priv->unity_settings) || gnome_rr_output_info_get_primary (output))) | 2294 | if (gsd_rr_output_info_is_active (output) && (unity_launcher_on_all_monitors (self->priv->unity_settings) || gsd_rr_output_info_get_primary (output))) |
1108 | 2296 | { | 2295 | { |
1109 | 2297 | cairo_rectangle (cr, x, y, 10, h * scale + 0.5); | 2296 | cairo_rectangle (cr, x, y, 10, h * scale + 0.5); |
1110 | 2298 | cairo_set_source_rgb (cr, 0, 0, 0); | 2297 | cairo_set_source_rgb (cr, 0, 0, 0); |
1111 | @@ -2312,7 +2311,7 @@ | |||
1112 | 2312 | } | 2311 | } |
1113 | 2313 | } | 2312 | } |
1114 | 2314 | 2313 | ||
1116 | 2315 | if (gnome_rr_output_info_get_primary (output) && !is_unity_session ()) | 2314 | if (gsd_rr_output_info_get_primary (output) && !is_unity_session ()) |
1117 | 2316 | { | 2315 | { |
1118 | 2317 | const char *clock_format; | 2316 | const char *clock_format; |
1119 | 2318 | char *text; | 2317 | char *text; |
1120 | @@ -2389,7 +2388,7 @@ | |||
1121 | 2389 | { | 2388 | { |
1122 | 2390 | paint_output (self, cr, g_list_position (connected_outputs, list)); | 2389 | paint_output (self, cr, g_list_position (connected_outputs, list)); |
1123 | 2391 | 2390 | ||
1125 | 2392 | if (gnome_rr_config_get_clone (self->priv->current_configuration)) | 2391 | if (gsd_rr_config_get_clone (self->priv->current_configuration)) |
1126 | 2393 | break; | 2392 | break; |
1127 | 2394 | } | 2393 | } |
1128 | 2395 | } | 2394 | } |
1129 | @@ -2428,21 +2427,21 @@ | |||
1130 | 2428 | } | 2427 | } |
1131 | 2429 | 2428 | ||
1132 | 2430 | static void | 2429 | static void |
1134 | 2431 | compute_virtual_size_for_configuration (GnomeRRConfig *config, int *ret_width, int *ret_height) | 2430 | compute_virtual_size_for_configuration (GsdRRConfig *config, int *ret_width, int *ret_height) |
1135 | 2432 | { | 2431 | { |
1136 | 2433 | int i; | 2432 | int i; |
1137 | 2434 | int width, height; | 2433 | int width, height; |
1138 | 2435 | int output_x, output_y, output_width, output_height; | 2434 | int output_x, output_y, output_width, output_height; |
1140 | 2436 | GnomeRROutputInfo **outputs; | 2435 | GsdRROutputInfo **outputs; |
1141 | 2437 | 2436 | ||
1142 | 2438 | width = height = 0; | 2437 | width = height = 0; |
1143 | 2439 | 2438 | ||
1145 | 2440 | outputs = gnome_rr_config_get_outputs (config); | 2439 | outputs = gsd_rr_config_get_outputs (config); |
1146 | 2441 | for (i = 0; outputs[i] != NULL; i++) | 2440 | for (i = 0; outputs[i] != NULL; i++) |
1147 | 2442 | { | 2441 | { |
1149 | 2443 | if (gnome_rr_output_info_is_active (outputs[i])) | 2442 | if (gsd_rr_output_info_is_active (outputs[i])) |
1150 | 2444 | { | 2443 | { |
1152 | 2445 | gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); | 2444 | gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); |
1153 | 2446 | width = MAX (width, output_x + output_width); | 2445 | width = MAX (width, output_x + output_width); |
1154 | 2447 | height = MAX (height, output_y + output_height); | 2446 | height = MAX (height, output_y + output_height); |
1155 | 2448 | } | 2447 | } |
1156 | @@ -2461,7 +2460,7 @@ | |||
1157 | 2461 | 2460 | ||
1158 | 2462 | compute_virtual_size_for_configuration (self->priv->current_configuration, &req_width, &req_height); | 2461 | compute_virtual_size_for_configuration (self->priv->current_configuration, &req_width, &req_height); |
1159 | 2463 | 2462 | ||
1161 | 2464 | gnome_rr_screen_get_ranges (self->priv->screen, &min_width, &max_width, &min_height, &max_height); | 2463 | gsd_rr_screen_get_ranges (self->priv->screen, &min_width, &max_width, &min_height, &max_height); |
1162 | 2465 | 2464 | ||
1163 | 2466 | #if 0 | 2465 | #if 0 |
1164 | 2467 | g_debug ("X Server supports:"); | 2466 | g_debug ("X Server supports:"); |
1165 | @@ -2516,24 +2515,24 @@ | |||
1166 | 2516 | static void | 2515 | static void |
1167 | 2517 | ensure_current_configuration_is_saved (void) | 2516 | ensure_current_configuration_is_saved (void) |
1168 | 2518 | { | 2517 | { |
1171 | 2519 | GnomeRRScreen *rr_screen; | 2518 | GsdRRScreen *rr_screen; |
1172 | 2520 | GnomeRRConfig *rr_config; | 2519 | GsdRRConfig *rr_config; |
1173 | 2521 | 2520 | ||
1175 | 2522 | /* Normally, gnome_rr_config_save() creates a backup file based on the | 2521 | /* Normally, gsd_rr_config_save() creates a backup file based on the |
1176 | 2523 | * old monitors.xml. However, if *that* file didn't exist, there is | 2522 | * old monitors.xml. However, if *that* file didn't exist, there is |
1177 | 2524 | * nothing from which to create a backup. So, here we'll save the | 2523 | * nothing from which to create a backup. So, here we'll save the |
1178 | 2525 | * current/unchanged configuration and then let our caller call | 2524 | * current/unchanged configuration and then let our caller call |
1180 | 2526 | * gnome_rr_config_save() again with the new/changed configuration, so | 2525 | * gsd_rr_config_save() again with the new/changed configuration, so |
1181 | 2527 | * that there *will* be a backup file in the end. | 2526 | * that there *will* be a backup file in the end. |
1182 | 2528 | */ | 2527 | */ |
1183 | 2529 | 2528 | ||
1185 | 2530 | rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */ | 2529 | rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), NULL); /* NULL-GError */ |
1186 | 2531 | if (!rr_screen) | 2530 | if (!rr_screen) |
1187 | 2532 | return; | 2531 | return; |
1188 | 2533 | 2532 | ||
1192 | 2534 | rr_config = gnome_rr_config_new_current (rr_screen, NULL); | 2533 | rr_config = gsd_rr_config_new_current (rr_screen, NULL); |
1193 | 2535 | gnome_rr_config_ensure_primary (rr_config); | 2534 | gsd_rr_config_ensure_primary (rr_config); |
1194 | 2536 | gnome_rr_config_save (rr_config, NULL); /* NULL-GError */ | 2535 | gsd_rr_config_save (rr_config, NULL); /* NULL-GError */ |
1195 | 2537 | 2536 | ||
1196 | 2538 | g_object_unref (rr_config); | 2537 | g_object_unref (rr_config); |
1197 | 2539 | g_object_unref (rr_screen); | 2538 | g_object_unref (rr_screen); |
1198 | @@ -2566,8 +2565,8 @@ | |||
1199 | 2566 | { | 2565 | { |
1200 | 2567 | GError *error; | 2566 | GError *error; |
1201 | 2568 | 2567 | ||
1204 | 2569 | gnome_rr_config_sanitize (self->priv->current_configuration); | 2568 | gsd_rr_config_sanitize (self->priv->current_configuration); |
1205 | 2570 | gnome_rr_config_ensure_primary (self->priv->current_configuration); | 2569 | gsd_rr_config_ensure_primary (self->priv->current_configuration); |
1206 | 2571 | 2570 | ||
1207 | 2572 | check_required_virtual_size (self); | 2571 | check_required_virtual_size (self); |
1208 | 2573 | 2572 | ||
1209 | @@ -2576,7 +2575,7 @@ | |||
1210 | 2576 | ensure_current_configuration_is_saved (); | 2575 | ensure_current_configuration_is_saved (); |
1211 | 2577 | 2576 | ||
1212 | 2578 | error = NULL; | 2577 | error = NULL; |
1214 | 2579 | if (!gnome_rr_config_save (self->priv->current_configuration, &error)) | 2578 | if (!gsd_rr_config_save (self->priv->current_configuration, &error)) |
1215 | 2580 | { | 2579 | { |
1216 | 2581 | error_message (self, _("Could not save the monitor configuration"), error->message); | 2580 | error_message (self, _("Could not save the monitor configuration"), error->message); |
1217 | 2582 | g_error_free (error); | 2581 | g_error_free (error); |
1218 | @@ -2609,7 +2608,7 @@ | |||
1219 | 2609 | #if 0 | 2608 | #if 0 |
1220 | 2610 | /* Returns whether the graphics driver doesn't advertise RANDR 1.2 features, and just 1.0 */ | 2609 | /* Returns whether the graphics driver doesn't advertise RANDR 1.2 features, and just 1.0 */ |
1221 | 2611 | static gboolean | 2610 | static gboolean |
1223 | 2612 | driver_is_randr_10 (GnomeRRConfig *config) | 2611 | driver_is_randr_10 (GsdRRConfig *config) |
1224 | 2613 | { | 2612 | { |
1225 | 2614 | /* In the Xorg code, see xserver/randr/rrinfo.c:RRScanOldConfig(). It gets | 2613 | /* In the Xorg code, see xserver/randr/rrinfo.c:RRScanOldConfig(). It gets |
1226 | 2615 | * called when the graphics driver doesn't support RANDR 1.2 yet, just 1.0. | 2614 | * called when the graphics driver doesn't support RANDR 1.2 yet, just 1.0. |
1227 | @@ -2622,10 +2621,10 @@ | |||
1228 | 2622 | * | 2621 | * |
1229 | 2623 | * FIXME: however, we don't even check for XRRQueryVersion() returning 1.2, neither | 2622 | * FIXME: however, we don't even check for XRRQueryVersion() returning 1.2, neither |
1230 | 2624 | * here nor in gnome-desktop/libgnomedesktop*.c. Do we need to check for that, | 2623 | * here nor in gnome-desktop/libgnomedesktop*.c. Do we need to check for that, |
1232 | 2625 | * or is gnome_rr_screen_new()'s return value sufficient? | 2624 | * or is gsd_rr_screen_new()'s return value sufficient? |
1233 | 2626 | */ | 2625 | */ |
1234 | 2627 | 2626 | ||
1236 | 2628 | return (count_all_outputs (config) == 1 && strcmp (gnome_rr_output_info_get_name (gnome_rr_config_get_outputs (config)[0]), "default") == 0); | 2627 | return (count_all_outputs (config) == 1 && strcmp (gsd_rr_output_info_get_name (gsd_rr_config_get_outputs (config)[0]), "default") == 0); |
1237 | 2629 | } | 2628 | } |
1238 | 2630 | #endif | 2629 | #endif |
1239 | 2631 | 2630 | ||
1240 | @@ -2636,7 +2635,7 @@ | |||
1241 | 2636 | GError *error; | 2635 | GError *error; |
1242 | 2637 | 2636 | ||
1243 | 2638 | error = NULL; | 2637 | error = NULL; |
1245 | 2639 | if (!gnome_rr_screen_refresh (self->priv->screen, &error)) { | 2638 | if (!gsd_rr_screen_refresh (self->priv->screen, &error)) { |
1246 | 2640 | if (error) { | 2639 | if (error) { |
1247 | 2641 | error_message (self, _("Could not detect displays"), error->message); | 2640 | error_message (self, _("Could not detect displays"), error->message); |
1248 | 2642 | g_error_free (error); | 2641 | g_error_free (error); |
1249 | @@ -2644,27 +2643,27 @@ | |||
1250 | 2644 | } | 2643 | } |
1251 | 2645 | } | 2644 | } |
1252 | 2646 | 2645 | ||
1255 | 2647 | static GnomeRROutputInfo * | 2646 | static GsdRROutputInfo * |
1256 | 2648 | get_nearest_output (GnomeRRConfig *configuration, int x, int y) | 2647 | get_nearest_output (GsdRRConfig *configuration, int x, int y) |
1257 | 2649 | { | 2648 | { |
1258 | 2650 | int i; | 2649 | int i; |
1259 | 2651 | int nearest_index; | 2650 | int nearest_index; |
1260 | 2652 | int nearest_dist; | 2651 | int nearest_dist; |
1262 | 2653 | GnomeRROutputInfo **outputs; | 2652 | GsdRROutputInfo **outputs; |
1263 | 2654 | 2653 | ||
1264 | 2655 | nearest_index = -1; | 2654 | nearest_index = -1; |
1265 | 2656 | nearest_dist = G_MAXINT; | 2655 | nearest_dist = G_MAXINT; |
1266 | 2657 | 2656 | ||
1268 | 2658 | outputs = gnome_rr_config_get_outputs (configuration); | 2657 | outputs = gsd_rr_config_get_outputs (configuration); |
1269 | 2659 | for (i = 0; outputs[i] != NULL; i++) | 2658 | for (i = 0; outputs[i] != NULL; i++) |
1270 | 2660 | { | 2659 | { |
1271 | 2661 | int dist_x, dist_y; | 2660 | int dist_x, dist_y; |
1272 | 2662 | int output_x, output_y, output_width, output_height; | 2661 | int output_x, output_y, output_width, output_height; |
1273 | 2663 | 2662 | ||
1275 | 2664 | if (!(gnome_rr_output_info_is_connected (outputs[i]) && gnome_rr_output_info_is_active (outputs[i]))) | 2663 | if (!(gsd_rr_output_info_is_connected (outputs[i]) && gsd_rr_output_info_is_active (outputs[i]))) |
1276 | 2665 | continue; | 2664 | continue; |
1277 | 2666 | 2665 | ||
1279 | 2667 | gnome_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); | 2666 | gsd_rr_output_info_get_geometry (outputs[i], &output_x, &output_y, &output_width, &output_height); |
1280 | 2668 | 2667 | ||
1281 | 2669 | if (x < output_x) | 2668 | if (x < output_x) |
1282 | 2670 | dist_x = output_x - x; | 2669 | dist_x = output_x - x; |
1283 | @@ -2696,14 +2695,14 @@ | |||
1284 | 2696 | /* Gets the output that contains the largest intersection with the window. | 2695 | /* Gets the output that contains the largest intersection with the window. |
1285 | 2697 | * Logic stolen from gdk_screen_get_monitor_at_window(). | 2696 | * Logic stolen from gdk_screen_get_monitor_at_window(). |
1286 | 2698 | */ | 2697 | */ |
1289 | 2699 | static GnomeRROutputInfo * | 2698 | static GsdRROutputInfo * |
1290 | 2700 | get_output_for_window (GnomeRRConfig *configuration, GdkWindow *window) | 2699 | get_output_for_window (GsdRRConfig *configuration, GdkWindow *window) |
1291 | 2701 | { | 2700 | { |
1292 | 2702 | GdkRectangle win_rect; | 2701 | GdkRectangle win_rect; |
1293 | 2703 | int i; | 2702 | int i; |
1294 | 2704 | int largest_area; | 2703 | int largest_area; |
1295 | 2705 | int largest_index; | 2704 | int largest_index; |
1297 | 2706 | GnomeRROutputInfo **outputs; | 2705 | GsdRROutputInfo **outputs; |
1298 | 2707 | 2706 | ||
1299 | 2708 | gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height); | 2707 | gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height); |
1300 | 2709 | gdk_window_get_origin (window, &win_rect.x, &win_rect.y); | 2708 | gdk_window_get_origin (window, &win_rect.x, &win_rect.y); |
1301 | @@ -2711,14 +2710,14 @@ | |||
1302 | 2711 | largest_area = 0; | 2710 | largest_area = 0; |
1303 | 2712 | largest_index = -1; | 2711 | largest_index = -1; |
1304 | 2713 | 2712 | ||
1306 | 2714 | outputs = gnome_rr_config_get_outputs (configuration); | 2713 | outputs = gsd_rr_config_get_outputs (configuration); |
1307 | 2715 | for (i = 0; outputs[i] != NULL; i++) | 2714 | for (i = 0; outputs[i] != NULL; i++) |
1308 | 2716 | { | 2715 | { |
1309 | 2717 | GdkRectangle output_rect, intersection; | 2716 | GdkRectangle output_rect, intersection; |
1310 | 2718 | 2717 | ||
1312 | 2719 | gnome_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height); | 2718 | gsd_rr_output_info_get_geometry (outputs[i], &output_rect.x, &output_rect.y, &output_rect.width, &output_rect.height); |
1313 | 2720 | 2719 | ||
1315 | 2721 | if (gnome_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection)) | 2720 | if (gsd_rr_output_info_is_connected (outputs[i]) && gdk_rectangle_intersect (&win_rect, &output_rect, &intersection)) |
1316 | 2722 | { | 2721 | { |
1317 | 2723 | int area; | 2722 | int area; |
1318 | 2724 | 2723 | ||
1319 | @@ -2831,7 +2830,7 @@ | |||
1320 | 2831 | } | 2830 | } |
1321 | 2832 | 2831 | ||
1322 | 2833 | static GdkPixbuf* | 2832 | static GdkPixbuf* |
1324 | 2834 | get_monitor_pixbuf (CcDisplayPanel *self, GnomeRROutputInfo *output) | 2833 | get_monitor_pixbuf (CcDisplayPanel *self, GsdRROutputInfo *output) |
1325 | 2835 | { | 2834 | { |
1326 | 2836 | GdkRGBA color; | 2835 | GdkRGBA color; |
1327 | 2837 | cairo_surface_t *cairo_surface; | 2836 | cairo_surface_t *cairo_surface; |
1328 | @@ -2880,19 +2879,19 @@ | |||
1329 | 2880 | { | 2879 | { |
1330 | 2881 | char *monitor_name; | 2880 | char *monitor_name; |
1331 | 2882 | GdkPixbuf *monitor_pixbuf; | 2881 | GdkPixbuf *monitor_pixbuf; |
1333 | 2883 | GnomeRROutputInfo *output = list->data; | 2882 | GsdRROutputInfo *output = list->data; |
1334 | 2884 | 2883 | ||
1336 | 2885 | if (!gnome_rr_output_info_is_active (output)) | 2884 | if (!gsd_rr_output_info_is_active (output)) |
1337 | 2886 | continue; | 2885 | continue; |
1338 | 2887 | 2886 | ||
1339 | 2888 | gtk_list_store_append (liststore, &iter); | 2887 | gtk_list_store_append (liststore, &iter); |
1341 | 2889 | monitor_name = g_strdup (gnome_rr_output_info_get_display_name (output)); | 2888 | monitor_name = g_strdup (gsd_rr_output_info_get_display_name (output)); |
1342 | 2890 | monitor_pixbuf = get_monitor_pixbuf (self, output); | 2889 | monitor_pixbuf = get_monitor_pixbuf (self, output); |
1343 | 2891 | 2890 | ||
1344 | 2892 | gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1); | 2891 | gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1); |
1345 | 2893 | 2892 | ||
1346 | 2894 | /* select it if primary and only one launcher */ | 2893 | /* select it if primary and only one launcher */ |
1348 | 2895 | if (gnome_rr_output_info_get_primary (output) && (!launcher_on_all_monitors)) | 2894 | if (gsd_rr_output_info_get_primary (output) && (!launcher_on_all_monitors)) |
1349 | 2896 | index_of_primary_screen = i; | 2895 | index_of_primary_screen = i; |
1350 | 2897 | i++; | 2896 | i++; |
1351 | 2898 | 2897 | ||
1352 | @@ -2930,19 +2929,19 @@ | |||
1353 | 2930 | { | 2929 | { |
1354 | 2931 | gchar *monitor_name; | 2930 | gchar *monitor_name; |
1355 | 2932 | GdkPixbuf *monitor_pixbuf; | 2931 | GdkPixbuf *monitor_pixbuf; |
1357 | 2933 | GnomeRROutputInfo *output = list->data; | 2932 | GsdRROutputInfo *output = list->data; |
1358 | 2934 | 2933 | ||
1360 | 2935 | if (!gnome_rr_output_info_is_active (output)) | 2934 | if (!gsd_rr_output_info_is_active (output)) |
1361 | 2936 | continue; | 2935 | continue; |
1362 | 2937 | 2936 | ||
1363 | 2938 | gtk_list_store_append (liststore, &iter); | 2937 | gtk_list_store_append (liststore, &iter); |
1365 | 2939 | monitor_name = g_strdup (gnome_rr_output_info_get_display_name (output)); | 2938 | monitor_name = g_strdup (gsd_rr_output_info_get_display_name (output)); |
1366 | 2940 | monitor_pixbuf = get_monitor_pixbuf (self, output); | 2939 | monitor_pixbuf = get_monitor_pixbuf (self, output); |
1367 | 2941 | 2940 | ||
1368 | 2942 | gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1); | 2941 | gtk_list_store_set (liststore, &iter, 0, monitor_pixbuf, 1, monitor_name, -1); |
1369 | 2943 | 2942 | ||
1370 | 2944 | /* select it if primary and only one launcher */ | 2943 | /* select it if primary and only one launcher */ |
1372 | 2945 | if (g_strcmp0 (gnome_rr_output_info_get_name (output), target_monitor) == 0) | 2944 | if (g_strcmp0 (gsd_rr_output_info_get_name (output), target_monitor) == 0) |
1373 | 2946 | target_monitor_idx = i; | 2945 | target_monitor_idx = i; |
1374 | 2947 | i++; | 2946 | i++; |
1375 | 2948 | 2947 | ||
1376 | @@ -3011,15 +3010,15 @@ | |||
1377 | 3011 | if (!on_all_monitors) { | 3010 | if (!on_all_monitors) { |
1378 | 3012 | value = 1; | 3011 | value = 1; |
1379 | 3013 | // set the primary output if needed | 3012 | // set the primary output if needed |
1381 | 3014 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 3013 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
1382 | 3015 | 3014 | ||
1383 | 3016 | for (i = 0; outputs[i] != NULL; ++i) | 3015 | for (i = 0; outputs[i] != NULL; ++i) |
1384 | 3017 | { | 3016 | { |
1387 | 3018 | GnomeRROutputInfo *output = outputs[i]; | 3017 | GsdRROutputInfo *output = outputs[i]; |
1388 | 3019 | if (!gnome_rr_output_info_is_active (output)) | 3018 | if (!gsd_rr_output_info_is_active (output)) |
1389 | 3020 | continue; | 3019 | continue; |
1390 | 3021 | 3020 | ||
1392 | 3022 | if ((active == index_on_combo) && !gnome_rr_output_info_get_primary (output)) | 3021 | if ((active == index_on_combo) && !gsd_rr_output_info_get_primary (output)) |
1393 | 3023 | { | 3022 | { |
1394 | 3024 | set_primary_output (self, output); | 3023 | set_primary_output (self, output); |
1395 | 3025 | break; | 3024 | break; |
1396 | @@ -3055,17 +3054,17 @@ | |||
1397 | 3055 | if (active < 0) | 3054 | if (active < 0) |
1398 | 3056 | return; | 3055 | return; |
1399 | 3057 | 3056 | ||
1401 | 3058 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (self->priv->current_configuration); | 3057 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (self->priv->current_configuration); |
1402 | 3059 | 3058 | ||
1403 | 3060 | for (i = 0; outputs[i] != NULL; ++i) | 3059 | for (i = 0; outputs[i] != NULL; ++i) |
1404 | 3061 | { | 3060 | { |
1407 | 3062 | GnomeRROutputInfo *output = outputs[i]; | 3061 | GsdRROutputInfo *output = outputs[i]; |
1408 | 3063 | if (!gnome_rr_output_info_is_active (output)) | 3062 | if (!gsd_rr_output_info_is_active (output)) |
1409 | 3064 | continue; | 3063 | continue; |
1410 | 3065 | 3064 | ||
1411 | 3066 | if (active == index_on_combo) | 3065 | if (active == index_on_combo) |
1412 | 3067 | { | 3066 | { |
1414 | 3068 | scale_monitor = g_strdup (gnome_rr_output_info_get_name (output)); | 3067 | scale_monitor = g_strdup (gsd_rr_output_info_get_name (output)); |
1415 | 3069 | break; | 3068 | break; |
1416 | 3070 | } | 3069 | } |
1417 | 3071 | index_on_combo++; | 3070 | index_on_combo++; |
1418 | @@ -3179,7 +3178,7 @@ | |||
1419 | 3179 | return obj; | 3178 | return obj; |
1420 | 3180 | } | 3179 | } |
1421 | 3181 | 3180 | ||
1423 | 3182 | self->priv->screen = gnome_rr_screen_new (gdk_screen_get_default (), &error); | 3181 | self->priv->screen = gsd_rr_screen_new (gdk_screen_get_default (), &error); |
1424 | 3183 | g_signal_connect (self->priv->screen, "changed", G_CALLBACK (on_screen_changed), self); | 3182 | g_signal_connect (self->priv->screen, "changed", G_CALLBACK (on_screen_changed), self); |
1425 | 3184 | if (!self->priv->screen) | 3183 | if (!self->priv->screen) |
1426 | 3185 | { | 3184 | { |
1427 | 3186 | 3185 | ||
1428 | === modified file 'panels/display/cc-rr-labeler.c' | |||
1429 | --- panels/display/cc-rr-labeler.c 2013-11-28 05:57:59 +0000 | |||
1430 | +++ panels/display/cc-rr-labeler.c 2014-08-29 10:31:11 +0000 | |||
1431 | @@ -38,7 +38,7 @@ | |||
1432 | 38 | #include "cc-rr-labeler.h" | 38 | #include "cc-rr-labeler.h" |
1433 | 39 | 39 | ||
1434 | 40 | struct _CcRRLabelerPrivate { | 40 | struct _CcRRLabelerPrivate { |
1436 | 41 | GnomeRRConfig *config; | 41 | GsdRRConfig *config; |
1437 | 42 | 42 | ||
1438 | 43 | int num_outputs; | 43 | int num_outputs; |
1439 | 44 | 44 | ||
1440 | @@ -106,7 +106,7 @@ | |||
1441 | 106 | 106 | ||
1442 | 107 | switch (property_id) { | 107 | switch (property_id) { |
1443 | 108 | case PROP_CONFIG: | 108 | case PROP_CONFIG: |
1445 | 109 | self->priv->config = GNOME_RR_CONFIG (g_value_dup_object (value)); | 109 | self->priv->config = GSD_RR_CONFIG (g_value_dup_object (value)); |
1446 | 110 | return; | 110 | return; |
1447 | 111 | default: | 111 | default: |
1448 | 112 | G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, param_spec); | 112 | G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, param_spec); |
1449 | @@ -139,7 +139,7 @@ | |||
1450 | 139 | g_object_class_install_property (object_class, PROP_CONFIG, g_param_spec_object ("config", | 139 | g_object_class_install_property (object_class, PROP_CONFIG, g_param_spec_object ("config", |
1451 | 140 | "Configuration", | 140 | "Configuration", |
1452 | 141 | "RandR configuration to label", | 141 | "RandR configuration to label", |
1454 | 142 | GNOME_TYPE_RR_CONFIG, | 142 | GSD_TYPE_RR_CONFIG, |
1455 | 143 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | | 143 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | |
1456 | 144 | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); | 144 | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); |
1457 | 145 | } | 145 | } |
1458 | @@ -170,10 +170,10 @@ | |||
1459 | 170 | } | 170 | } |
1460 | 171 | 171 | ||
1461 | 172 | static int | 172 | static int |
1463 | 173 | count_outputs (GnomeRRConfig *config) | 173 | count_outputs (GsdRRConfig *config) |
1464 | 174 | { | 174 | { |
1465 | 175 | int i; | 175 | int i; |
1467 | 176 | GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (config); | 176 | GsdRROutputInfo **outputs = gsd_rr_config_get_outputs (config); |
1468 | 177 | 177 | ||
1469 | 178 | for (i = 0; outputs[i] != NULL; i++) | 178 | for (i = 0; outputs[i] != NULL; i++) |
1470 | 179 | ; | 179 | ; |
1471 | @@ -402,7 +402,7 @@ | |||
1472 | 402 | } | 402 | } |
1473 | 403 | 403 | ||
1474 | 404 | static GtkWidget * | 404 | static GtkWidget * |
1476 | 405 | create_label_window (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba) | 405 | create_label_window (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba) |
1477 | 406 | { | 406 | { |
1478 | 407 | GtkWidget *window; | 407 | GtkWidget *window; |
1479 | 408 | GtkWidget *widget; | 408 | GtkWidget *widget; |
1480 | @@ -438,7 +438,7 @@ | |||
1481 | 438 | g_signal_connect (window, "composited-changed", | 438 | g_signal_connect (window, "composited-changed", |
1482 | 439 | G_CALLBACK (label_window_composited_changed_cb), labeler); | 439 | G_CALLBACK (label_window_composited_changed_cb), labeler); |
1483 | 440 | 440 | ||
1485 | 441 | if (gnome_rr_config_get_clone (labeler->priv->config)) { | 441 | if (gsd_rr_config_get_clone (labeler->priv->config)) { |
1486 | 442 | /* Keep this string in sync with gnome-control-center/capplets/display/xrandr-capplet.c:get_display_name() */ | 442 | /* Keep this string in sync with gnome-control-center/capplets/display/xrandr-capplet.c:get_display_name() */ |
1487 | 443 | 443 | ||
1488 | 444 | /* Translators: this is the feature where what you see on your | 444 | /* Translators: this is the feature where what you see on your |
1489 | @@ -448,7 +448,7 @@ | |||
1490 | 448 | */ | 448 | */ |
1491 | 449 | display_name = _("Mirrored Displays"); | 449 | display_name = _("Mirrored Displays"); |
1492 | 450 | } else | 450 | } else |
1494 | 451 | display_name = gnome_rr_output_info_get_display_name (output); | 451 | display_name = gsd_rr_output_info_get_display_name (output); |
1495 | 452 | 452 | ||
1496 | 453 | str = g_strdup_printf ("<b>%s</b>", display_name); | 453 | str = g_strdup_printf ("<b>%s</b>", display_name); |
1497 | 454 | widget = gtk_label_new (NULL); | 454 | widget = gtk_label_new (NULL); |
1498 | @@ -466,7 +466,7 @@ | |||
1499 | 466 | gtk_container_add (GTK_CONTAINER (window), widget); | 466 | gtk_container_add (GTK_CONTAINER (window), widget); |
1500 | 467 | 467 | ||
1501 | 468 | /* Should we center this at the top edge of the monitor, instead of using the upper-left corner? */ | 468 | /* Should we center this at the top edge of the monitor, instead of using the upper-left corner? */ |
1503 | 469 | gnome_rr_output_info_get_geometry (output, &x, &y, NULL, NULL); | 469 | gsd_rr_output_info_get_geometry (output, &x, &y, NULL, NULL); |
1504 | 470 | position_window (labeler, window, x, y); | 470 | position_window (labeler, window, x, y); |
1505 | 471 | 471 | ||
1506 | 472 | gtk_widget_show_all (window); | 472 | gtk_widget_show_all (window); |
1507 | @@ -496,9 +496,9 @@ | |||
1508 | 496 | * Returns: A new #CcRRLabeler | 496 | * Returns: A new #CcRRLabeler |
1509 | 497 | */ | 497 | */ |
1510 | 498 | CcRRLabeler * | 498 | CcRRLabeler * |
1512 | 499 | cc_rr_labeler_new (GnomeRRConfig *config) | 499 | cc_rr_labeler_new (GsdRRConfig *config) |
1513 | 500 | { | 500 | { |
1515 | 501 | g_return_val_if_fail (GNOME_IS_RR_CONFIG (config), NULL); | 501 | g_return_val_if_fail (GSD_IS_RR_CONFIG (config), NULL); |
1516 | 502 | 502 | ||
1517 | 503 | return g_object_new (GNOME_TYPE_RR_LABELER, "config", config, NULL); | 503 | return g_object_new (GNOME_TYPE_RR_LABELER, "config", config, NULL); |
1518 | 504 | } | 504 | } |
1519 | @@ -514,7 +514,7 @@ | |||
1520 | 514 | { | 514 | { |
1521 | 515 | int i; | 515 | int i; |
1522 | 516 | gboolean created_window_for_clone; | 516 | gboolean created_window_for_clone; |
1524 | 517 | GnomeRROutputInfo **outputs; | 517 | GsdRROutputInfo **outputs; |
1525 | 518 | 518 | ||
1526 | 519 | g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); | 519 | g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); |
1527 | 520 | 520 | ||
1528 | @@ -525,13 +525,13 @@ | |||
1529 | 525 | 525 | ||
1530 | 526 | created_window_for_clone = FALSE; | 526 | created_window_for_clone = FALSE; |
1531 | 527 | 527 | ||
1533 | 528 | outputs = gnome_rr_config_get_outputs (labeler->priv->config); | 528 | outputs = gsd_rr_config_get_outputs (labeler->priv->config); |
1534 | 529 | 529 | ||
1535 | 530 | for (i = 0; i < labeler->priv->num_outputs; i++) { | 530 | for (i = 0; i < labeler->priv->num_outputs; i++) { |
1537 | 531 | if (!created_window_for_clone && gnome_rr_output_info_is_active (outputs[i])) { | 531 | if (!created_window_for_clone && gsd_rr_output_info_is_active (outputs[i])) { |
1538 | 532 | labeler->priv->windows[i] = create_label_window (labeler, outputs[i], labeler->priv->palette + i); | 532 | labeler->priv->windows[i] = create_label_window (labeler, outputs[i], labeler->priv->palette + i); |
1539 | 533 | 533 | ||
1541 | 534 | if (gnome_rr_config_get_clone (labeler->priv->config)) | 534 | if (gsd_rr_config_get_clone (labeler->priv->config)) |
1542 | 535 | created_window_for_clone = TRUE; | 535 | created_window_for_clone = TRUE; |
1543 | 536 | } else | 536 | } else |
1544 | 537 | labeler->priv->windows[i] = NULL; | 537 | labeler->priv->windows[i] = NULL; |
1545 | @@ -575,16 +575,16 @@ | |||
1546 | 575 | * Get the color used for the label on a given output (monitor). | 575 | * Get the color used for the label on a given output (monitor). |
1547 | 576 | */ | 576 | */ |
1548 | 577 | void | 577 | void |
1550 | 578 | cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out) | 578 | cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba_out) |
1551 | 579 | { | 579 | { |
1552 | 580 | int i; | 580 | int i; |
1554 | 581 | GnomeRROutputInfo **outputs; | 581 | GsdRROutputInfo **outputs; |
1555 | 582 | 582 | ||
1556 | 583 | g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); | 583 | g_return_if_fail (GNOME_IS_RR_LABELER (labeler)); |
1558 | 584 | g_return_if_fail (GNOME_IS_RR_OUTPUT_INFO (output)); | 584 | g_return_if_fail (GSD_IS_RR_OUTPUT_INFO (output)); |
1559 | 585 | g_return_if_fail (rgba_out != NULL); | 585 | g_return_if_fail (rgba_out != NULL); |
1560 | 586 | 586 | ||
1562 | 587 | outputs = gnome_rr_config_get_outputs (labeler->priv->config); | 587 | outputs = gsd_rr_config_get_outputs (labeler->priv->config); |
1563 | 588 | 588 | ||
1564 | 589 | for (i = 0; i < labeler->priv->num_outputs; i++) | 589 | for (i = 0; i < labeler->priv->num_outputs; i++) |
1565 | 590 | if (outputs[i] == output) { | 590 | if (outputs[i] == output) { |
1566 | 591 | 591 | ||
1567 | === modified file 'panels/display/cc-rr-labeler.h' | |||
1568 | --- panels/display/cc-rr-labeler.h 2013-11-28 05:57:59 +0000 | |||
1569 | +++ panels/display/cc-rr-labeler.h 2014-08-29 10:31:11 +0000 | |||
1570 | @@ -26,8 +26,7 @@ | |||
1571 | 26 | #ifndef CC_RR_LABELER_H | 26 | #ifndef CC_RR_LABELER_H |
1572 | 27 | #define CC_RR_LABELER_H | 27 | #define CC_RR_LABELER_H |
1573 | 28 | 28 | ||
1576 | 29 | #define GNOME_DESKTOP_USE_UNSTABLE_API | 29 | #include <libunity-settings-daemon/gsd-rr-config.h> |
1575 | 30 | #include <libgnome-desktop/gnome-rr-config.h> | ||
1577 | 31 | 30 | ||
1578 | 32 | #define GNOME_TYPE_RR_LABELER (cc_rr_labeler_get_type ()) | 31 | #define GNOME_TYPE_RR_LABELER (cc_rr_labeler_get_type ()) |
1579 | 33 | #define CC_RR_LABELER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_LABELER, CcRRLabeler)) | 32 | #define CC_RR_LABELER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_LABELER, CcRRLabeler)) |
1580 | @@ -53,12 +52,12 @@ | |||
1581 | 53 | 52 | ||
1582 | 54 | GType cc_rr_labeler_get_type (void); | 53 | GType cc_rr_labeler_get_type (void); |
1583 | 55 | 54 | ||
1585 | 56 | CcRRLabeler *cc_rr_labeler_new (GnomeRRConfig *config); | 55 | CcRRLabeler *cc_rr_labeler_new (GsdRRConfig *config); |
1586 | 57 | 56 | ||
1587 | 58 | void cc_rr_labeler_show (CcRRLabeler *labeler); | 57 | void cc_rr_labeler_show (CcRRLabeler *labeler); |
1588 | 59 | 58 | ||
1589 | 60 | void cc_rr_labeler_hide (CcRRLabeler *labeler); | 59 | void cc_rr_labeler_hide (CcRRLabeler *labeler); |
1590 | 61 | 60 | ||
1592 | 62 | void cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GnomeRROutputInfo *output, GdkRGBA *rgba_out); | 61 | void cc_rr_labeler_get_rgba_for_output (CcRRLabeler *labeler, GsdRROutputInfo *output, GdkRGBA *rgba_out); |
1593 | 63 | 62 | ||
1594 | 64 | #endif | 63 | #endif |
1595 | 65 | 64 | ||
1596 | === modified file 'panels/wacom/cc-wacom-mapping-panel.c' | |||
1597 | --- panels/wacom/cc-wacom-mapping-panel.c 2012-08-21 16:00:22 +0000 | |||
1598 | +++ panels/wacom/cc-wacom-mapping-panel.c 2014-08-29 10:31:11 +0000 | |||
1599 | @@ -23,9 +23,8 @@ | |||
1600 | 23 | 23 | ||
1601 | 24 | #include <gtk/gtk.h> | 24 | #include <gtk/gtk.h> |
1602 | 25 | #include <glib/gi18n.h> | 25 | #include <glib/gi18n.h> |
1606 | 26 | #define GNOME_DESKTOP_USE_UNSTABLE_API | 26 | #include <libunity-settings-daemon/gsd-rr.h> |
1607 | 27 | #include <libgnome-desktop/gnome-rr.h> | 27 | #include <libunity-settings-daemon/gsd-rr-config.h> |
1605 | 28 | #include <libgnome-desktop/gnome-rr-config.h> | ||
1608 | 29 | 28 | ||
1609 | 30 | #include <string.h> | 29 | #include <string.h> |
1610 | 31 | 30 | ||
1611 | @@ -57,17 +56,17 @@ | |||
1612 | 57 | static void checkbutton_toggled_cb (GtkWidget *widget, CcWacomMappingPanel *self); | 56 | static void checkbutton_toggled_cb (GtkWidget *widget, CcWacomMappingPanel *self); |
1613 | 58 | static void aspectswitch_toggled_cb (GtkWidget *widget, GParamSpec *pspec, CcWacomMappingPanel *self); | 57 | static void aspectswitch_toggled_cb (GtkWidget *widget, GParamSpec *pspec, CcWacomMappingPanel *self); |
1614 | 59 | 58 | ||
1616 | 60 | static GnomeRROutputInfo** | 59 | static GsdRROutputInfo** |
1617 | 61 | get_rr_outputs (void) | 60 | get_rr_outputs (void) |
1618 | 62 | { | 61 | { |
1619 | 63 | GError *error = NULL; | 62 | GError *error = NULL; |
1622 | 64 | GnomeRRScreen *rr_screen; | 63 | GsdRRScreen *rr_screen; |
1623 | 65 | GnomeRRConfig *rr_config; | 64 | GsdRRConfig *rr_config; |
1624 | 66 | 65 | ||
1625 | 67 | /* TODO: Check the value of 'error' */ | 66 | /* TODO: Check the value of 'error' */ |
1629 | 68 | rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error); | 67 | rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error); |
1630 | 69 | rr_config = gnome_rr_config_new_current (rr_screen, &error); | 68 | rr_config = gsd_rr_config_new_current (rr_screen, &error); |
1631 | 70 | return gnome_rr_config_get_outputs (rr_config); | 69 | return gsd_rr_config_get_outputs (rr_config); |
1632 | 71 | } | 70 | } |
1633 | 72 | 71 | ||
1634 | 73 | static void | 72 | static void |
1635 | @@ -91,7 +90,7 @@ | |||
1636 | 91 | update_monitor_chooser (CcWacomMappingPanel *self) | 90 | update_monitor_chooser (CcWacomMappingPanel *self) |
1637 | 92 | { | 91 | { |
1638 | 93 | GtkListStore *store; | 92 | GtkListStore *store; |
1640 | 94 | GnomeRROutputInfo **outputs; | 93 | GsdRROutputInfo **outputs; |
1641 | 95 | GdkRectangle geom; | 94 | GdkRectangle geom; |
1642 | 96 | GSettings *settings; | 95 | GSettings *settings; |
1643 | 97 | gint monitor; | 96 | gint monitor; |
1644 | @@ -130,19 +129,19 @@ | |||
1645 | 130 | goto bail; | 129 | goto bail; |
1646 | 131 | 130 | ||
1647 | 132 | for (i = 0; outputs[i] != NULL; i++) { | 131 | for (i = 0; outputs[i] != NULL; i++) { |
1649 | 133 | GnomeRROutputInfo *output = outputs[i]; | 132 | GsdRROutputInfo *output = outputs[i]; |
1650 | 134 | 133 | ||
1652 | 135 | if (gnome_rr_output_info_is_active (output)) { | 134 | if (gsd_rr_output_info_is_active (output)) { |
1653 | 136 | GtkTreeIter iter; | 135 | GtkTreeIter iter; |
1654 | 137 | gchar *name, *disp_name, *text; | 136 | gchar *name, *disp_name, *text; |
1655 | 138 | int x, y, w, h; | 137 | int x, y, w, h; |
1656 | 139 | int mon_at_point; | 138 | int mon_at_point; |
1657 | 140 | 139 | ||
1660 | 141 | name = gnome_rr_output_info_get_name (output); | 140 | name = gsd_rr_output_info_get_name (output); |
1661 | 142 | disp_name = gnome_rr_output_info_get_display_name (output); | 141 | disp_name = gsd_rr_output_info_get_display_name (output); |
1662 | 143 | text = g_strdup_printf ("%s (%s)", name, disp_name); | 142 | text = g_strdup_printf ("%s (%s)", name, disp_name); |
1663 | 144 | 143 | ||
1665 | 145 | gnome_rr_output_info_get_geometry (output, &x, &y, &w, &h); | 144 | gsd_rr_output_info_get_geometry (output, &x, &y, &w, &h); |
1666 | 146 | mon_at_point = gdk_screen_get_monitor_at_point (gdk_screen_get_default (), x, y); | 145 | mon_at_point = gdk_screen_get_monitor_at_point (gdk_screen_get_default (), x, y); |
1667 | 147 | gtk_list_store_append (store, &iter); | 146 | gtk_list_store_append (store, &iter); |
1668 | 148 | gtk_list_store_set (store, &iter, MONITOR_NAME_COLUMN, text, MONITOR_NUM_COLUMN, mon_at_point, -1); | 147 | gtk_list_store_set (store, &iter, MONITOR_NAME_COLUMN, text, MONITOR_NUM_COLUMN, mon_at_point, -1); |
1669 | 149 | 148 | ||
1670 | === modified file 'panels/wacom/gsd-wacom-device.c' | |||
1671 | --- panels/wacom/gsd-wacom-device.c 2014-02-19 02:24:52 +0000 | |||
1672 | +++ panels/wacom/gsd-wacom-device.c 2014-08-29 10:31:11 +0000 | |||
1673 | @@ -27,8 +27,7 @@ | |||
1674 | 27 | #include <gdk/gdk.h> | 27 | #include <gdk/gdk.h> |
1675 | 28 | #include <gdk/gdkx.h> | 28 | #include <gdk/gdkx.h> |
1676 | 29 | #include <X11/Xatom.h> | 29 | #include <X11/Xatom.h> |
1679 | 30 | #define GNOME_DESKTOP_USE_UNSTABLE_API | 30 | #include <libunity-settings-daemon/gsd-rr.h> |
1678 | 31 | #include <libgnome-desktop/gnome-rr.h> | ||
1680 | 32 | 31 | ||
1681 | 33 | #include <libwacom/libwacom.h> | 32 | #include <libwacom/libwacom.h> |
1682 | 34 | #include <X11/extensions/XInput.h> | 33 | #include <X11/extensions/XInput.h> |
1683 | @@ -48,14 +47,14 @@ | |||
1684 | 48 | #define WACOM_BUTTON_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.tablet-button" | 47 | #define WACOM_BUTTON_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.tablet-button" |
1685 | 49 | 48 | ||
1686 | 50 | static struct { | 49 | static struct { |
1688 | 51 | GnomeRRRotation rotation; | 50 | GsdRRRotation rotation; |
1689 | 52 | GsdWacomRotation rotation_wacom; | 51 | GsdWacomRotation rotation_wacom; |
1690 | 53 | const gchar *rotation_string; | 52 | const gchar *rotation_string; |
1691 | 54 | } rotation_table[] = { | 53 | } rotation_table[] = { |
1696 | 55 | { GNOME_RR_ROTATION_0, GSD_WACOM_ROTATION_NONE, "none" }, | 54 | { GSD_RR_ROTATION_0, GSD_WACOM_ROTATION_NONE, "none" }, |
1697 | 56 | { GNOME_RR_ROTATION_90, GSD_WACOM_ROTATION_CCW, "ccw" }, | 55 | { GSD_RR_ROTATION_90, GSD_WACOM_ROTATION_CCW, "ccw" }, |
1698 | 57 | { GNOME_RR_ROTATION_180, GSD_WACOM_ROTATION_HALF, "half" }, | 56 | { GSD_RR_ROTATION_180, GSD_WACOM_ROTATION_HALF, "half" }, |
1699 | 58 | { GNOME_RR_ROTATION_270, GSD_WACOM_ROTATION_CW, "cw" } | 57 | { GSD_RR_ROTATION_270, GSD_WACOM_ROTATION_CW, "cw" } |
1700 | 59 | }; | 58 | }; |
1701 | 60 | 59 | ||
1702 | 61 | static WacomDeviceDatabase *db = NULL; | 60 | static WacomDeviceDatabase *db = NULL; |
1703 | @@ -511,14 +510,14 @@ | |||
1704 | 511 | 510 | ||
1705 | 512 | /* Finds an output which matches the given EDID information. Any NULL | 511 | /* Finds an output which matches the given EDID information. Any NULL |
1706 | 513 | * parameter will be interpreted to match any value. */ | 512 | * parameter will be interpreted to match any value. */ |
1709 | 514 | static GnomeRROutput * | 513 | static GsdRROutput * |
1710 | 515 | find_output_by_edid (GnomeRRScreen *rr_screen, const gchar *vendor, const gchar *product, const gchar *serial) | 514 | find_output_by_edid (GsdRRScreen *rr_screen, const gchar *vendor, const gchar *product, const gchar *serial) |
1711 | 516 | { | 515 | { |
1714 | 517 | GnomeRROutput **rr_outputs; | 516 | GsdRROutput **rr_outputs; |
1715 | 518 | GnomeRROutput *retval = NULL; | 517 | GsdRROutput *retval = NULL; |
1716 | 519 | guint i; | 518 | guint i; |
1717 | 520 | 519 | ||
1719 | 521 | rr_outputs = gnome_rr_screen_list_outputs (rr_screen); | 520 | rr_outputs = gsd_rr_screen_list_outputs (rr_screen); |
1720 | 522 | 521 | ||
1721 | 523 | for (i = 0; rr_outputs[i] != NULL; i++) { | 522 | for (i = 0; rr_outputs[i] != NULL; i++) { |
1722 | 524 | gchar *o_vendor_s; | 523 | gchar *o_vendor_s; |
1723 | @@ -528,10 +527,10 @@ | |||
1724 | 528 | int o_serial; | 527 | int o_serial; |
1725 | 529 | gboolean match; | 528 | gboolean match; |
1726 | 530 | 529 | ||
1728 | 531 | if (!gnome_rr_output_is_connected (rr_outputs[i])) | 530 | if (!gsd_rr_output_is_connected (rr_outputs[i])) |
1729 | 532 | continue; | 531 | continue; |
1730 | 533 | 532 | ||
1732 | 534 | if (!gnome_rr_output_get_ids_from_edid (rr_outputs[i], | 533 | if (!gsd_rr_output_get_ids_from_edid (rr_outputs[i], |
1733 | 535 | &o_vendor_s, | 534 | &o_vendor_s, |
1734 | 536 | &o_product, | 535 | &o_product, |
1735 | 537 | &o_serial)) | 536 | &o_serial)) |
1736 | @@ -564,19 +563,19 @@ | |||
1737 | 564 | return retval; | 563 | return retval; |
1738 | 565 | } | 564 | } |
1739 | 566 | 565 | ||
1742 | 567 | static GnomeRROutput* | 566 | static GsdRROutput* |
1743 | 568 | find_builtin_output (GnomeRRScreen *rr_screen) | 567 | find_builtin_output (GsdRRScreen *rr_screen) |
1744 | 569 | { | 568 | { |
1747 | 570 | GnomeRROutput **rr_outputs; | 569 | GsdRROutput **rr_outputs; |
1748 | 571 | GnomeRROutput *retval = NULL; | 570 | GsdRROutput *retval = NULL; |
1749 | 572 | guint i; | 571 | guint i; |
1750 | 573 | 572 | ||
1752 | 574 | rr_outputs = gnome_rr_screen_list_outputs (rr_screen); | 573 | rr_outputs = gsd_rr_screen_list_outputs (rr_screen); |
1753 | 575 | for (i = 0; rr_outputs[i] != NULL; i++) { | 574 | for (i = 0; rr_outputs[i] != NULL; i++) { |
1755 | 576 | if (!gnome_rr_output_is_connected (rr_outputs[i])) | 575 | if (!gsd_rr_output_is_connected (rr_outputs[i])) |
1756 | 577 | continue; | 576 | continue; |
1757 | 578 | 577 | ||
1759 | 579 | if (gnome_rr_output_is_laptop(rr_outputs[i])) { | 578 | if (gsd_rr_output_is_laptop(rr_outputs[i])) { |
1760 | 580 | retval = rr_outputs[i]; | 579 | retval = rr_outputs[i]; |
1761 | 581 | break; | 580 | break; |
1762 | 582 | } | 581 | } |
1763 | @@ -588,10 +587,10 @@ | |||
1764 | 588 | return retval; | 587 | return retval; |
1765 | 589 | } | 588 | } |
1766 | 590 | 589 | ||
1769 | 591 | static GnomeRROutput * | 590 | static GsdRROutput * |
1770 | 592 | find_output_by_heuristic (GnomeRRScreen *rr_screen, GsdWacomDevice *device) | 591 | find_output_by_heuristic (GsdRRScreen *rr_screen, GsdWacomDevice *device) |
1771 | 593 | { | 592 | { |
1773 | 594 | GnomeRROutput *rr_output; | 593 | GsdRROutput *rr_output; |
1774 | 595 | 594 | ||
1775 | 596 | /* TODO: This heuristic will fail for non-Wacom display | 595 | /* TODO: This heuristic will fail for non-Wacom display |
1776 | 597 | * tablets and may give the wrong result if multiple Wacom | 596 | * tablets and may give the wrong result if multiple Wacom |
1777 | @@ -605,14 +604,14 @@ | |||
1778 | 605 | return rr_output; | 604 | return rr_output; |
1779 | 606 | } | 605 | } |
1780 | 607 | 606 | ||
1783 | 608 | static GnomeRROutput * | 607 | static GsdRROutput * |
1784 | 609 | find_output_by_display (GnomeRRScreen *rr_screen, GsdWacomDevice *device) | 608 | find_output_by_display (GsdRRScreen *rr_screen, GsdWacomDevice *device) |
1785 | 610 | { | 609 | { |
1786 | 611 | gsize n; | 610 | gsize n; |
1787 | 612 | GSettings *tablet; | 611 | GSettings *tablet; |
1788 | 613 | GVariant *display; | 612 | GVariant *display; |
1789 | 614 | const gchar **edid; | 613 | const gchar **edid; |
1791 | 615 | GnomeRROutput *ret; | 614 | GsdRROutput *ret; |
1792 | 616 | 615 | ||
1793 | 617 | if (device == NULL) | 616 | if (device == NULL) |
1794 | 618 | return NULL; | 617 | return NULL; |
1795 | @@ -640,32 +639,32 @@ | |||
1796 | 640 | } | 639 | } |
1797 | 641 | 640 | ||
1798 | 642 | static gboolean | 641 | static gboolean |
1800 | 643 | is_on (GnomeRROutput *output) | 642 | is_on (GsdRROutput *output) |
1801 | 644 | { | 643 | { |
1803 | 645 | GnomeRRCrtc *crtc; | 644 | GsdRRCrtc *crtc; |
1804 | 646 | 645 | ||
1806 | 647 | crtc = gnome_rr_output_get_crtc (output); | 646 | crtc = gsd_rr_output_get_crtc (output); |
1807 | 648 | if (!crtc) | 647 | if (!crtc) |
1808 | 649 | return FALSE; | 648 | return FALSE; |
1810 | 650 | return gnome_rr_crtc_get_current_mode (crtc) != NULL; | 649 | return gsd_rr_crtc_get_current_mode (crtc) != NULL; |
1811 | 651 | } | 650 | } |
1812 | 652 | 651 | ||
1815 | 653 | static GnomeRROutput * | 652 | static GsdRROutput * |
1816 | 654 | find_output_by_monitor (GnomeRRScreen *rr_screen, | 653 | find_output_by_monitor (GsdRRScreen *rr_screen, |
1817 | 655 | GdkScreen *screen, | 654 | GdkScreen *screen, |
1818 | 656 | int monitor) | 655 | int monitor) |
1819 | 657 | { | 656 | { |
1822 | 658 | GnomeRROutput **rr_outputs; | 657 | GsdRROutput **rr_outputs; |
1823 | 659 | GnomeRROutput *ret; | 658 | GsdRROutput *ret; |
1824 | 660 | guint i; | 659 | guint i; |
1825 | 661 | 660 | ||
1826 | 662 | ret = NULL; | 661 | ret = NULL; |
1827 | 663 | 662 | ||
1829 | 664 | rr_outputs = gnome_rr_screen_list_outputs (rr_screen); | 663 | rr_outputs = gsd_rr_screen_list_outputs (rr_screen); |
1830 | 665 | 664 | ||
1831 | 666 | for (i = 0; rr_outputs[i] != NULL; i++) { | 665 | for (i = 0; rr_outputs[i] != NULL; i++) { |
1834 | 667 | GnomeRROutput *rr_output; | 666 | GsdRROutput *rr_output; |
1835 | 668 | GnomeRRCrtc *crtc; | 667 | GsdRRCrtc *crtc; |
1836 | 669 | int x, y; | 668 | int x, y; |
1837 | 670 | 669 | ||
1838 | 671 | rr_output = rr_outputs[i]; | 670 | rr_output = rr_outputs[i]; |
1839 | @@ -673,11 +672,11 @@ | |||
1840 | 673 | if (!is_on (rr_output)) | 672 | if (!is_on (rr_output)) |
1841 | 674 | continue; | 673 | continue; |
1842 | 675 | 674 | ||
1844 | 676 | crtc = gnome_rr_output_get_crtc (rr_output); | 675 | crtc = gsd_rr_output_get_crtc (rr_output); |
1845 | 677 | if (!crtc) | 676 | if (!crtc) |
1846 | 678 | continue; | 677 | continue; |
1847 | 679 | 678 | ||
1849 | 680 | gnome_rr_crtc_get_position (crtc, &x, &y); | 679 | gsd_rr_crtc_get_position (crtc, &x, &y); |
1850 | 681 | 680 | ||
1851 | 682 | if (monitor == gdk_screen_get_monitor_at_point (screen, x, y)) { | 681 | if (monitor == gdk_screen_get_monitor_at_point (screen, x, y)) { |
1852 | 683 | ret = rr_output; | 682 | ret = rr_output; |
1853 | @@ -693,7 +692,7 @@ | |||
1854 | 693 | 692 | ||
1855 | 694 | static void | 693 | static void |
1856 | 695 | set_display_by_output (GsdWacomDevice *device, | 694 | set_display_by_output (GsdWacomDevice *device, |
1858 | 696 | GnomeRROutput *rr_output) | 695 | GsdRROutput *rr_output) |
1859 | 697 | { | 696 | { |
1860 | 698 | GSettings *tablet; | 697 | GSettings *tablet; |
1861 | 699 | GVariant *c_array; | 698 | GVariant *c_array; |
1862 | @@ -712,7 +711,7 @@ | |||
1863 | 712 | } | 711 | } |
1864 | 713 | 712 | ||
1865 | 714 | if (rr_output == NULL || | 713 | if (rr_output == NULL || |
1867 | 715 | !gnome_rr_output_get_ids_from_edid (rr_output, | 714 | !gsd_rr_output_get_ids_from_edid (rr_output, |
1868 | 716 | &o_vendor_s, | 715 | &o_vendor_s, |
1869 | 717 | &o_product, | 716 | &o_product, |
1870 | 718 | &o_serial)) { | 717 | &o_serial)) { |
1871 | @@ -736,7 +735,7 @@ | |||
1872 | 736 | } | 735 | } |
1873 | 737 | 736 | ||
1874 | 738 | static GsdWacomRotation | 737 | static GsdWacomRotation |
1876 | 739 | get_rotation_wacom (GnomeRRRotation rotation) | 738 | get_rotation_wacom (GsdRRRotation rotation) |
1877 | 740 | { | 739 | { |
1878 | 741 | guint i; | 740 | guint i; |
1879 | 742 | 741 | ||
1880 | @@ -752,14 +751,14 @@ | |||
1881 | 752 | int monitor) | 751 | int monitor) |
1882 | 753 | { | 752 | { |
1883 | 754 | GError *error = NULL; | 753 | GError *error = NULL; |
1886 | 755 | GnomeRRScreen *rr_screen; | 754 | GsdRRScreen *rr_screen; |
1887 | 756 | GnomeRROutput *output = NULL; | 755 | GsdRROutput *output = NULL; |
1888 | 757 | 756 | ||
1889 | 758 | g_return_if_fail (GSD_IS_WACOM_DEVICE (device)); | 757 | g_return_if_fail (GSD_IS_WACOM_DEVICE (device)); |
1890 | 759 | 758 | ||
1892 | 760 | rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error); | 759 | rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error); |
1893 | 761 | if (rr_screen == NULL) { | 760 | if (rr_screen == NULL) { |
1895 | 762 | g_warning ("Failed to create GnomeRRScreen: %s", error->message); | 761 | g_warning ("Failed to create GsdRRScreen: %s", error->message); |
1896 | 763 | g_error_free (error); | 762 | g_error_free (error); |
1897 | 764 | return; | 763 | return; |
1898 | 765 | } | 764 | } |
1899 | @@ -771,11 +770,11 @@ | |||
1900 | 771 | g_object_unref (rr_screen); | 770 | g_object_unref (rr_screen); |
1901 | 772 | } | 771 | } |
1902 | 773 | 772 | ||
1905 | 774 | static GnomeRROutput * | 773 | static GsdRROutput * |
1906 | 775 | find_output (GnomeRRScreen *rr_screen, | 774 | find_output (GsdRRScreen *rr_screen, |
1907 | 776 | GsdWacomDevice *device) | 775 | GsdWacomDevice *device) |
1908 | 777 | { | 776 | { |
1910 | 778 | GnomeRROutput *rr_output; | 777 | GsdRROutput *rr_output; |
1911 | 779 | rr_output = find_output_by_display (rr_screen, device); | 778 | rr_output = find_output_by_display (rr_screen, device); |
1912 | 780 | 779 | ||
1913 | 781 | if (rr_output == NULL) { | 780 | if (rr_output == NULL) { |
1914 | @@ -823,17 +822,17 @@ | |||
1915 | 823 | gsd_wacom_device_get_display_monitor (GsdWacomDevice *device) | 822 | gsd_wacom_device_get_display_monitor (GsdWacomDevice *device) |
1916 | 824 | { | 823 | { |
1917 | 825 | GError *error = NULL; | 824 | GError *error = NULL; |
1922 | 826 | GnomeRRScreen *rr_screen; | 825 | GsdRRScreen *rr_screen; |
1923 | 827 | GnomeRROutput *rr_output; | 826 | GsdRROutput *rr_output; |
1924 | 828 | GnomeRRMode *mode; | 827 | GsdRRMode *mode; |
1925 | 829 | GnomeRRCrtc *crtc; | 828 | GsdRRCrtc *crtc; |
1926 | 830 | gint area[4]; | 829 | gint area[4]; |
1927 | 831 | 830 | ||
1928 | 832 | g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), GSD_WACOM_SET_ALL_MONITORS); | 831 | g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), GSD_WACOM_SET_ALL_MONITORS); |
1929 | 833 | 832 | ||
1931 | 834 | rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error); | 833 | rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error); |
1932 | 835 | if (rr_screen == NULL) { | 834 | if (rr_screen == NULL) { |
1934 | 836 | g_warning ("Failed to create GnomeRRScreen: %s", error->message); | 835 | g_warning ("Failed to create GsdRRScreen: %s", error->message); |
1935 | 837 | g_error_free (error); | 836 | g_error_free (error); |
1936 | 838 | return GSD_WACOM_SET_ALL_MONITORS; | 837 | return GSD_WACOM_SET_ALL_MONITORS; |
1937 | 839 | } | 838 | } |
1938 | @@ -850,12 +849,12 @@ | |||
1939 | 850 | return GSD_WACOM_SET_ALL_MONITORS; | 849 | return GSD_WACOM_SET_ALL_MONITORS; |
1940 | 851 | } | 850 | } |
1941 | 852 | 851 | ||
1944 | 853 | crtc = gnome_rr_output_get_crtc (rr_output); | 852 | crtc = gsd_rr_output_get_crtc (rr_output); |
1945 | 854 | gnome_rr_crtc_get_position (crtc, &area[0], &area[1]); | 853 | gsd_rr_crtc_get_position (crtc, &area[0], &area[1]); |
1946 | 855 | 854 | ||
1950 | 856 | mode = gnome_rr_crtc_get_current_mode (crtc); | 855 | mode = gsd_rr_crtc_get_current_mode (crtc); |
1951 | 857 | area[2] = gnome_rr_mode_get_width (mode); | 856 | area[2] = gsd_rr_mode_get_width (mode); |
1952 | 858 | area[3] = gnome_rr_mode_get_height (mode); | 857 | area[3] = gsd_rr_mode_get_height (mode); |
1953 | 859 | 858 | ||
1954 | 860 | g_object_unref (rr_screen); | 859 | g_object_unref (rr_screen); |
1955 | 861 | 860 | ||
1956 | @@ -904,22 +903,22 @@ | |||
1957 | 904 | gsd_wacom_device_get_display_rotation (GsdWacomDevice *device) | 903 | gsd_wacom_device_get_display_rotation (GsdWacomDevice *device) |
1958 | 905 | { | 904 | { |
1959 | 906 | GError *error = NULL; | 905 | GError *error = NULL; |
1963 | 907 | GnomeRRScreen *rr_screen; | 906 | GsdRRScreen *rr_screen; |
1964 | 908 | GnomeRROutput *rr_output; | 907 | GsdRROutput *rr_output; |
1965 | 909 | GnomeRRRotation rotation = GNOME_RR_ROTATION_0; | 908 | GsdRRRotation rotation = GSD_RR_ROTATION_0; |
1966 | 910 | 909 | ||
1968 | 911 | rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error); | 910 | rr_screen = gsd_rr_screen_new (gdk_screen_get_default (), &error); |
1969 | 912 | if (rr_screen == NULL) { | 911 | if (rr_screen == NULL) { |
1971 | 913 | g_warning ("Failed to create GnomeRRScreen: %s", error->message); | 912 | g_warning ("Failed to create GsdRRScreen: %s", error->message); |
1972 | 914 | g_error_free (error); | 913 | g_error_free (error); |
1973 | 915 | return GSD_WACOM_ROTATION_NONE; | 914 | return GSD_WACOM_ROTATION_NONE; |
1974 | 916 | } | 915 | } |
1975 | 917 | 916 | ||
1976 | 918 | rr_output = find_output (rr_screen, device); | 917 | rr_output = find_output (rr_screen, device); |
1977 | 919 | if (rr_output) { | 918 | if (rr_output) { |
1979 | 920 | GnomeRRCrtc *crtc = gnome_rr_output_get_crtc (rr_output); | 919 | GsdRRCrtc *crtc = gsd_rr_output_get_crtc (rr_output); |
1980 | 921 | if (crtc) | 920 | if (crtc) |
1982 | 922 | rotation = gnome_rr_crtc_get_current_rotation (crtc); | 921 | rotation = gsd_rr_crtc_get_current_rotation (crtc); |
1983 | 923 | } | 922 | } |
1984 | 924 | g_object_unref (rr_screen); | 923 | g_object_unref (rr_screen); |
1985 | 925 | 924 |
FAILED: Continuous integration, rev:12785 jenkins. qa.ubuntu. com/job/ unity-control- center- ci/107/ jenkins. qa.ubuntu. com/job/ unity-control- center- utopic- amd64-ci/ 9/console jenkins. qa.ubuntu. com/job/ unity-control- center- utopic- armhf-ci/ 9/console jenkins. qa.ubuntu. com/job/ unity-control- center- utopic- i386-ci/ 9/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- control- center- ci/107/ rebuild
http://