[Xfce4-commits] [apps/xfce4-taskmanager] 03/03: Fix window settings (size, pane height, sort column/direction) not properly saved when exiting the window (bug #10670)
noreply at xfce.org
noreply at xfce.org
Tue Dec 23 21:48:56 CET 2014
This is an automated email from the git hooks/post-receive script.
landry pushed a commit to branch master
in repository apps/xfce4-taskmanager.
commit 007c2c6c9ea74bbf206bd0bf005e57404b9e9053
Author: Landry Breuil <landry at xfce.org>
Date: Tue Dec 23 21:46:54 2014 +0100
Fix window settings (size, pane height, sort column/direction) not properly saved when exiting the window (bug #10670)
Move the code setting the properties on window->settings to the delete-event handler,
at that stage we're sure the window still exists, and that the property setting
will actually trigger a config file write.
---
src/process-window.c | 37 +++++++++++++++++--------------------
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/src/process-window.c b/src/process-window.c
index 743cf70..86f84db 100644
--- a/src/process-window.c
+++ b/src/process-window.c
@@ -225,26 +225,6 @@ xtm_process_window_finalize (GObject *object)
{
XtmProcessWindow *window = XTM_PROCESS_WINDOW (object);
- if (GTK_IS_WINDOW (window->window))
- {
- gint width, height, handle_position;
- guint sort_column_id;
- GtkSortType sort_type;
-
- gtk_window_get_size (GTK_WINDOW (window->window), &width, &height);
- xtm_process_tree_view_get_sort_column_id (XTM_PROCESS_TREE_VIEW (window->treeview), (gint*)&sort_column_id, &sort_type);
-
- handle_position = gtk_paned_get_position (GTK_PANED (window->vpaned));
-
- g_object_set (window->settings,
- "window-width", width,
- "window-height", height,
- "sort-column-id", sort_column_id,
- "sort-type", sort_type,
- "handle-position", handle_position,
- NULL);
- }
-
if (GTK_IS_TREE_VIEW (window->treeview))
gtk_widget_destroy (window->treeview);
@@ -275,6 +255,23 @@ static gboolean
emit_delete_event_signal (XtmProcessWindow *window, GdkEvent *event)
{
gboolean ret;
+ gint width, height, handle_position;
+ guint sort_column_id;
+ GtkSortType sort_type;
+
+ gtk_window_get_size (GTK_WINDOW (window->window), &width, &height);
+ xtm_process_tree_view_get_sort_column_id (XTM_PROCESS_TREE_VIEW (window->treeview), (gint*)&sort_column_id, &sort_type);
+
+ handle_position = gtk_paned_get_position (GTK_PANED (window->vpaned));
+
+ g_object_set (window->settings,
+ "window-width", width,
+ "window-height", height,
+ "sort-column-id", sort_column_id,
+ "sort-type", sort_type,
+ "handle-position", handle_position,
+ NULL);
+
g_signal_emit_by_name (window, "delete-event", event, &ret, G_TYPE_BOOLEAN);
return ret;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list