Fixed restoration of the panel divider position.
[psensor.git] / src / ui.c
index c503800..1ce84ea 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -398,20 +398,6 @@ void ui_window_create(struct ui_psensor *ui)
        log_debug("ui_window_create() ends");
 }
 
-void ui_window_update(struct ui_psensor *ui)
-{
-       struct config *cfg;
-
-       log_debug("ui_window_update()");
-
-       cfg = ui->config;
-
-       if (cfg->window_restore_enabled)
-               gtk_paned_set_position(GTK_PANED(w_sensor_box),
-                                      cfg->window_divider_pos);
-
-}
-
 void ui_window_show(struct ui_psensor *ui)
 {
        struct config *cfg;
@@ -419,12 +405,13 @@ void ui_window_show(struct ui_psensor *ui)
        log_debug("ui_window_show()");
 
        cfg = ui->config;
-       if (cfg->window_restore_enabled)
+       if (cfg->window_restore_enabled) {
+               gtk_paned_set_position(GTK_PANED(w_sensor_box),
+                                      cfg->window_divider_pos);
                gtk_window_move(GTK_WINDOW(ui->main_window),
                                cfg->window_x,
                                cfg->window_y);
-
-       ui_window_update(ui);
+       }
 
        gtk_window_present(GTK_WINDOW(ui->main_window));
 }