[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/wlr-randr][upstream] New upstream version 0.2.0

Henry-Nicolas Tourneur (@hntourne) gitlab at salsa.debian.org
Wed Aug 25 17:10:27 BST 2021



Henry-Nicolas Tourneur pushed to branch upstream at Debian On Mobile / wlr-randr


Commits:
468b8861 by Henry-Nicolas Tourneur at 2021-08-25T16:02:19+00:00
New upstream version 0.2.0
- - - - -


2 changed files:

- main.c
- meson.build


Changes:

=====================================
main.c
=====================================
@@ -2,6 +2,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
+#include <math.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -373,6 +374,7 @@ static const struct option long_options[] = {
 	{"on", no_argument, 0, 0},
 	{"off", no_argument, 0, 0},
 	{"mode", required_argument, 0, 0},
+	{"preferred", no_argument, 0, 0},
 	{"custom-mode", required_argument, 0, 0},
 	{"pos", required_argument, 0, 0},
 	{"transform", required_argument, 0, 0},
@@ -429,7 +431,7 @@ static bool parse_mode(const char *value, int *width, int *height,
 				return false;
 			}
 
-			*refresh = refresh_hz * 1000; // Hz → mHz
+			*refresh = round(refresh_hz * 1000); // Hz → mHz
 		}
 	}
 
@@ -485,6 +487,25 @@ static bool parse_output_arg(struct randr_head *head,
 			return false;
 		}
 
+		head->mode = mode;
+		head->custom_mode.width = 0;
+		head->custom_mode.height = 0;
+		head->custom_mode.refresh = 0;
+	} else if (strcmp(name, "preferred") == 0) {
+		bool found = false;
+		struct randr_mode *mode;
+		wl_list_for_each(mode, &head->modes, link) {
+			if (mode->preferred) {
+				found = true;
+				break;
+			}
+		}
+
+		if (!found) {
+			fprintf(stderr, "no preferred mode found\n");
+			return false;
+		}
+
 		head->mode = mode;
 		head->custom_mode.width = 0;
 		head->custom_mode.height = 0;
@@ -558,6 +579,7 @@ static const char usage[] =
 	"  --on\n"
 	"  --off\n"
 	"  --mode|--custom-mode <width>x<height>[@<refresh>Hz]\n"
+	"  --preferred\n"
 	"  --pos <x>,<y>\n"
 	"  --transform normal|90|180|270|flipped|flipped-90|flipped-180|flipped-270\n"
 	"  --scale <factor>\n";


=====================================
meson.build
=====================================
@@ -1,14 +1,10 @@
 project(
-	'wlr-randr',
-	'c',
-	version: '0.1.0',
-	license: 'MIT',
-	meson_version: '>=0.47.0',
-	default_options: [
-		'c_std=c99',
-		'warning_level=3',
-		'werror=true',
-	],
+  'wlr-randr',
+  'c',
+version : '0.2.0',
+license : 'MIT',
+meson_version : '>=0.47.0',
+default_options : ['c_std=c99', 'warning_level=3', 'werror=true']
 )
 
 cc = meson.get_compiler('c')
@@ -36,11 +32,13 @@ add_project_arguments(cc.get_supported_arguments([
 
 wayland_client = dependency('wayland-client')
 
+math = cc.find_library('m', required: false)
+
 subdir('protocol')
 
 wlr_randr_exe = executable(
 	meson.project_name(),
 	files(['main.c']),
-	dependencies: [wayland_client, client_protos],
+	dependencies: [wayland_client, client_protos, math],
 	install: true,
 )



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/wlr-randr/-/commit/468b886102d5f2f0fc9ac656d18750fb6e32e00d

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/wlr-randr/-/commit/468b886102d5f2f0fc9ac656d18750fb6e32e00d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20210825/cc28f48e/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list