summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Anderson <scott.anderson@collabora.com>2019-05-29 18:27:30 +1200
committerSimon Ser <contact@emersion.fr>2019-06-19 07:44:51 +0000
commit89a105444eac850aa383bc8d4c3d36cd5d926451 (patch)
treeb507c791dc3935827b53e03653cd0c986dea8e26
parent611fe36d24402a82ff0f7520eb31fed1efaab90f (diff)
downloadweston-89a105444eac850aa383bc8d4c3d36cd5d926451.tar.gz
compositor: Fix incorrect use of bool options
WESTON_OPTION_BOOLEAN takes a pointer to an int as an argument, but there were several cases of being passed a pointer to a bool instead. This changes it to use a local int instead, and then write that value to the bool. Signed-off-by: Scott Anderson <scott.anderson@collabora.com> (cherry picked from commit 2edbcbd9cdd30e00556e9618570234ea68d89b11)
-rw-r--r--compositor/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/compositor/main.c b/compositor/main.c
index 47b0c315..4b462e71 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -2329,6 +2329,7 @@ load_drm_backend(struct weston_compositor *c,
int use_shadow;
int ret = 0;
int use_pixman_config_ = 0;
+ int drm_use_current_mode = 0;
int32_t use_pixman_ = 0;
wet->drm_use_current_mode = false;
@@ -2342,11 +2343,12 @@ load_drm_backend(struct weston_compositor *c,
{ WESTON_OPTION_STRING, "seat", 0, &config.seat_id },
{ WESTON_OPTION_INTEGER, "tty", 0, &config.tty },
{ WESTON_OPTION_STRING, "drm-device", 0, &config.specific_device },
- { WESTON_OPTION_BOOLEAN, "current-mode", 0, &wet->drm_use_current_mode },
+ { WESTON_OPTION_BOOLEAN, "current-mode", 0, &drm_use_current_mode },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
+ wet->drm_use_current_mode = drm_use_current_mode;
config.use_pixman = use_pixman_;
section = weston_config_get_section(wc, "core", NULL, NULL);
@@ -2618,6 +2620,8 @@ load_x11_backend(struct weston_compositor *c,
char const *section_name;
int i;
int32_t use_pixman_config_ = 0;
+ int fullscreen = 0;
+ int no_input = 0;
int use_pixman_ = 0;
struct wet_output_config *parsed_options = wet_init_parsed_options(c);
@@ -2633,13 +2637,15 @@ load_x11_backend(struct weston_compositor *c,
{ WESTON_OPTION_INTEGER, "width", 0, &parsed_options->width },
{ WESTON_OPTION_INTEGER, "height", 0, &parsed_options->height },
{ WESTON_OPTION_INTEGER, "scale", 0, &parsed_options->scale },
- { WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &config.fullscreen },
+ { WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &fullscreen },
{ WESTON_OPTION_INTEGER, "output-count", 0, &option_count },
- { WESTON_OPTION_BOOLEAN, "no-input", 0, &config.no_input },
+ { WESTON_OPTION_BOOLEAN, "no-input", 0, &no_input },
{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman_ },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
+ config.fullscreen = fullscreen;
+ config.no_input = no_input;
config.use_pixman = use_pixman_;
config.base.struct_version = WESTON_X11_BACKEND_CONFIG_VERSION;