@@ -1118,6 +1118,7 @@ static void
11181118panel_run_dialog_update_content (PanelRunDialog * dialog ,
11191119 gboolean show_list )
11201120{
1121+
11211122 if (!panel_profile_get_enable_program_list ()) {
11221123 GtkWidget * parent ;
11231124
@@ -1131,8 +1132,9 @@ panel_run_dialog_update_content (PanelRunDialog *dialog,
11311132
11321133 } else {
11331134
1134- /* if the list is closed and the user wants to see it */
1135- if (show_list && !gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
1135+ /* the following two conditions occur, when the user clicks the expander in the dialog
1136+ * if the list is closed and the user wants to see it */
1137+ if (show_list && gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
11361138
11371139 /* open the expander, this shows the list */
11381140 gtk_expander_set_expanded (GTK_EXPANDER (dialog -> list_expander ), TRUE);
@@ -1142,14 +1144,27 @@ panel_run_dialog_update_content (PanelRunDialog *dialog,
11421144 gtk_widget_grab_focus (dialog -> program_list );
11431145
11441146 /* if the list is open and the user wants to close it */
1145- } else if (!show_list && gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
1147+ } else if (!show_list && ! gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
11461148
11471149 /* close the expander, this hides the list */
11481150 gtk_expander_set_expanded (GTK_EXPANDER (dialog -> list_expander ), FALSE);
11491151
11501152 gtk_window_set_resizable (GTK_WINDOW (dialog -> run_dialog ), FALSE);
11511153 gtk_widget_grab_focus (dialog -> combobox );
11521154 }
1155+
1156+ /* the following two conditions occur, when the user changes the expander setting in GSettings */
1157+ if (show_list && !gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
1158+
1159+ /* open the expander, this shows the list */
1160+ gtk_expander_set_expanded (GTK_EXPANDER (dialog -> list_expander ), TRUE);
1161+
1162+ /* if the list is open and the user wants to close it */
1163+ } else if (!show_list && gtk_expander_get_expanded (GTK_EXPANDER (dialog -> list_expander ))) {
1164+
1165+ /* close the expander, this hides the list */
1166+ gtk_expander_set_expanded (GTK_EXPANDER (dialog -> list_expander ), FALSE);
1167+ }
11531168 }
11541169}
11551170
0 commit comments