diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2008-02-12 21:28:55 -0800 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2008-02-12 21:28:55 -0800 |
commit | 9cec52adf6e908620eeb819927b7395734e47f09 (patch) | |
tree | b44fae751b5b6b4e4d21ed8f4dd54effbb2aa378 /src/nvidia-settings.c | |
parent | 03dfb75016524ca18b3cf5cc71a60163150983d7 (diff) |
1.0-87561.0-8756
Diffstat (limited to 'src/nvidia-settings.c')
-rw-r--r-- | src/nvidia-settings.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/nvidia-settings.c b/src/nvidia-settings.c index f0f9dd3..79e6f75 100644 --- a/src/nvidia-settings.c +++ b/src/nvidia-settings.c @@ -39,8 +39,9 @@ int main(int argc, char **argv) ConfigProperties conf; ParsedAttribute *p; CtrlHandles *h; + NvCtrlAttributeHandle **handles; Options *op; - int ret; + int ret, i, num_handles; /* * initialize the ui @@ -89,16 +90,34 @@ int main(int argc, char **argv) return 1; } + /* + * pull the screens' handles out of the CtrlHandles so that we can + * pass them to the gui + */ + + num_handles = h->targets[X_SCREEN_TARGET].n; + + if (num_handles) { + handles = malloc(num_handles * sizeof(NvCtrlAttributeHandle *)); + + for (i = 0; i < num_handles; i++) { + handles[i] = h->targets[X_SCREEN_TARGET].t[i].h; + } + } else { + handles = NULL; + } + /* pass control to the gui */ - ctk_main(h->h, h->num_screens, p, &conf); - + ctk_main(handles, num_handles, p, &conf); + /* write the configuration file */ nv_write_config_file(op->config, h, p, &conf); /* cleanup */ + if (handles) free(handles); nv_free_ctrl_handles(h); nv_parsed_attribute_free(p); |