summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2014-09-30 10:39:08 -0700
committerAaron Plattner <aplattner@nvidia.com>2014-09-30 10:39:08 -0700
commitff600991496c4156cdc4c7b6a8801099da86e704 (patch)
treea1295df8c0862f9141d1512c72b8e68634e0e95f
parentf1f2c20454f136389da9b7501ef4a93734766edd (diff)
340.46340.46
-rw-r--r--doc/version.mk2
-rw-r--r--samples/version.mk2
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig.c62
-rw-r--r--src/gtk+-2.x/ctkdisplaylayout.h2
-rw-r--r--src/libXNVCtrl/version.mk2
-rw-r--r--src/version.mk2
-rw-r--r--version.mk2
7 files changed, 44 insertions, 30 deletions
diff --git a/doc/version.mk b/doc/version.mk
index 742cdd0..08ee0d3 100644
--- a/doc/version.mk
+++ b/doc/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.32
+NVIDIA_VERSION = 340.46
diff --git a/samples/version.mk b/samples/version.mk
index 742cdd0..08ee0d3 100644
--- a/samples/version.mk
+++ b/samples/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.32
+NVIDIA_VERSION = 340.46
diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c
index 1ce5b6e..8b2240f 100644
--- a/src/gtk+-2.x/ctkdisplayconfig.c
+++ b/src/gtk+-2.x/ctkdisplayconfig.c
@@ -3041,7 +3041,7 @@ allocate_selected_mode(char *name,
selected_mode = (nvSelectedModePtr)nvalloc(sizeof(nvSelectedMode));
- selected_mode->label = gtk_menu_item_new_with_label(name);
+ selected_mode->text = g_strdup(name);
selected_mode->modeline = modeline;
selected_mode->isSpecial = isSpecial;
@@ -3075,6 +3075,7 @@ free_selected_modes(nvSelectedModePtr selected_mode)
{
if (selected_mode) {
free_selected_modes(selected_mode->next);
+ g_free(selected_mode->text);
free(selected_mode);
}
}
@@ -3237,20 +3238,26 @@ static void generate_selected_modes(const nvDisplayPtr display)
nvSelectedModePtr selected_mode = NULL;
nvModeLinePtr modeline;
- /* Add the off item */
- selected_mode = allocate_selected_mode("Off",
- NULL /* modeline */,
- TRUE /* isSpecial */,
- NULL /* viewPortIn */,
- NULL /* viewPortOut */);
+ display->num_selected_modes = 0;
+ display->selected_modes = NULL;
- display->num_selected_modes = 1;
- display->selected_modes = selected_mode;
+ /* Add the off item if we have more than one display */
+ if (display->screen->num_displays > 1) {
+ selected_mode = allocate_selected_mode("Off",
+ NULL /* modeline */,
+ TRUE /* isSpecial */,
+ NULL /* viewPortIn */,
+ NULL /* viewPortOut */);
+
+ display->num_selected_modes = 1;
+ display->selected_modes = selected_mode;
+ }
modeline = display->modelines;
while (modeline) {
gchar *name;
Bool isSpecial;
+ Bool mode_added;
if (IS_NVIDIA_DEFAULT_MODE(modeline)) {
name = g_strdup_printf("Auto");
@@ -3267,8 +3274,15 @@ static void generate_selected_modes(const nvDisplayPtr display)
NULL /* viewPortOut */);
g_free(name);
- if (append_unique_selected_mode(display->selected_modes,
- selected_mode)) {
+ if (!display->selected_modes) {
+ display->selected_modes = selected_mode;
+ mode_added = TRUE;
+ } else {
+ mode_added = append_unique_selected_mode(display->selected_modes,
+ selected_mode);
+ }
+
+ if (mode_added) {
display->num_selected_modes++;
if (matches_current_selected_mode(display, selected_mode,
@@ -3401,10 +3415,18 @@ static void setup_display_resolution_dropdown(CtkDisplayConfig *ctk_object)
}
- if (display->cur_mode->modeline) {
- cur_idx = 1; /* Modeline is set, start off as 'nvidia-auto-select' */
+ if (display->cur_mode->modeline && display->screen->num_displays > 1) {
+ /*
+ * Modeline is set and we have more than 1 display, start off as
+ * 'nvidia-auto-select'
+ */
+ cur_idx = 1;
} else {
- cur_idx = 0; /* Modeline not set, start off as 'off'. */
+ /*
+ * Modeline not set, start off as 'off'. If we do not have more than
+ * 1 display, 'auto' will be at index 0.
+ */
+ cur_idx = 0;
}
/* Setup the menu */
@@ -3418,12 +3440,10 @@ static void setup_display_resolution_dropdown(CtkDisplayConfig *ctk_object)
/* Fill dropdown menu */
selected_mode = display->selected_modes;
while (selected_mode) {
- GtkWidget *menu_item = selected_mode->label;
- const gchar *label_text = gtk_label_get_text(
- GTK_LABEL(gtk_bin_get_child(GTK_BIN(selected_mode->label))));
gtk_combo_box_append_text(
- GTK_COMBO_BOX(ctk_object->mnu_display_resolution), label_text);
+ GTK_COMBO_BOX(ctk_object->mnu_display_resolution),
+ selected_mode->text);
ctk_object->resolution_table[ctk_object->resolution_table_len] =
selected_mode;
@@ -3432,12 +3452,6 @@ static void setup_display_resolution_dropdown(CtkDisplayConfig *ctk_object)
cur_idx = ctk_object->resolution_table_len;
}
- if (selected_mode->isSpecial &&
- !selected_mode->modeline &&
- display->screen->num_displays <= 1) {
- gtk_widget_set_sensitive(menu_item, FALSE);
- }
-
ctk_object->resolution_table_len++;
selected_mode = selected_mode->next;
}
diff --git a/src/gtk+-2.x/ctkdisplaylayout.h b/src/gtk+-2.x/ctkdisplaylayout.h
index 34a7b44..f8039d6 100644
--- a/src/gtk+-2.x/ctkdisplaylayout.h
+++ b/src/gtk+-2.x/ctkdisplaylayout.h
@@ -166,7 +166,7 @@ typedef struct nvModeLineRec {
typedef struct nvSelectedModeRec {
struct nvSelectedModeRec *next;
- GtkWidget *label; /* Label shown in dropdown menu */
+ gchar *text; /* Text shown in dropdown menu */
nvModeLinePtr modeline; /* Modeline this mode references */
diff --git a/src/libXNVCtrl/version.mk b/src/libXNVCtrl/version.mk
index 742cdd0..08ee0d3 100644
--- a/src/libXNVCtrl/version.mk
+++ b/src/libXNVCtrl/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.32
+NVIDIA_VERSION = 340.46
diff --git a/src/version.mk b/src/version.mk
index 742cdd0..08ee0d3 100644
--- a/src/version.mk
+++ b/src/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.32
+NVIDIA_VERSION = 340.46
diff --git a/version.mk b/version.mk
index 742cdd0..08ee0d3 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.32
+NVIDIA_VERSION = 340.46