[PATCH 2/2] calibrator: allow user to specify preferred output to use

U. Artie Eoff ullysses.a.eoff at intel.com
Fri Nov 22 09:13:16 PST 2013


From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>

Add --output=<ID> command line option to weston-calibrator so
user can control which output the calibrator shows up on.
Before, when using a multi-display setup it was impossible to
calibrate a "non-primary" touch output display device.

The user can obtain the available output ids with the weston-info
client application.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=69780

Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
 clients/calibrator.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/clients/calibrator.c b/clients/calibrator.c
index 783cdec..666e6ef 100644
--- a/clients/calibrator.c
+++ b/clients/calibrator.c
@@ -57,6 +57,8 @@ struct calibrator {
 	struct widget *widget;
 };
 
+static int preferred_output_id = 0;
+
 /*
  * Calibration algorithm:
  *
@@ -235,7 +237,8 @@ calibrator_create(struct display *display)
 	widget_set_touch_down_handler(calibrator->widget, touch_handler);
 	widget_set_redraw_handler(calibrator->widget, redraw_handler);
 
-	window_set_fullscreen(calibrator->window, 1);
+	window_set_fullscreen_with_preferred_output(calibrator->window, 1,
+						    preferred_output_id);
 
 	return calibrator;
 }
@@ -248,6 +251,9 @@ calibrator_destroy(struct calibrator *calibrator)
 	free(calibrator);
 }
 
+static const struct weston_option calibrator_options[] = {
+	{ WESTON_OPTION_INTEGER, "output", 'o', &preferred_output_id },
+};
 
 int
 main(int argc, char *argv[])
@@ -255,6 +261,9 @@ main(int argc, char *argv[])
 	struct display *display;
 	struct calibrator *calibrator;
 
+	parse_options(calibrator_options,
+		      ARRAY_LENGTH(calibrator_options), &argc, argv);
+
 	display = display_create(&argc, argv);
 
 	if (display == NULL) {
-- 
1.8.3.1



More information about the wayland-devel mailing list