Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 468386 Details for
Bug 643450
Gnome session saves application positions, but not workspace assignment
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Possible patch to address the issue in metacity
metacity-2.28.0-session-state-file-save.patch (text/plain), 6.11 KB, created by
Olivier Fourdan
on 2010-12-13 14:30:12 UTC
(
hide
)
Description:
Possible patch to address the issue in metacity
Filename:
MIME Type:
Creator:
Olivier Fourdan
Created:
2010-12-13 14:30:12 UTC
Size:
6.11 KB
patch
obsolete
> Allows for --sm-save-file and --sm-client-id to be used simultaneously > > Initially metacity allows for only --sm-client-id or --sm-save-file to be used > and name its save state file after the client-id. > > As the client-id remains the same, the state-file name remains. But the session > manager will remove the old state file by using the discard command, so that > the state file saved by metacity is removed just after by the session > manager, and the state is not restored (thus the position and workspace of > running windows is not restored). > > Other GNOME applications using eggsmclient do not behave like that and use a > different state file each time, so that the new one does not get removed along > with the old state file. > > Olivier Fourdan <ofourdan@redhat.com> > > main.c | 3 -- > session.c | 76 +++++++++++++++++++++++++++++++++++++------------------------- > 2 files changed, 46 insertions(+), 33 deletions(-) > >diff -up metacity-2.28.0/src/core/main.c.state-file metacity-2.28.0/src/core/main.c >--- metacity-2.28.0/src/core/main.c.state-file 2010-12-13 10:04:39.984805266 +0100 >+++ metacity-2.28.0/src/core/main.c 2010-12-13 10:39:20.485656944 +0100 >@@ -520,9 +520,6 @@ main (int argc, char **argv) > if (meta_args.replace_wm) > meta_set_replace_current_wm (TRUE); > >- if (meta_args.save_file && meta_args.client_id) >- meta_fatal ("Can't specify both SM save file and SM client id\n"); >- > meta_main_loop = g_main_loop_new (NULL, FALSE); > > meta_ui_init (&argc, &argv); >diff -up metacity-2.28.0/src/core/session.c.state-file metacity-2.28.0/src/core/session.c >--- metacity-2.28.0/src/core/session.c.state-file 2010-12-13 11:21:28.752657601 +0100 >+++ metacity-2.28.0/src/core/session.c 2010-12-13 13:01:43.060655226 +0100 >@@ -241,7 +241,6 @@ meta_session_init (const char *previous_ > if (previous_save_file) > { > saved_client_id = load_state (previous_save_file); >- previous_client_id = saved_client_id; > } > else if (previous_client_id) > { >@@ -253,6 +252,10 @@ meta_session_init (const char *previous_ > { > saved_client_id = NULL; > } >+ if (!previous_client_id) >+ { >+ previous_client_id = saved_client_id; >+ } > > ice_init (); > >@@ -606,6 +609,10 @@ set_clone_restart_commands (void) > ++i; > restartv[i] = client_id; > ++i; >+ restartv[i] = "--sm-save-file"; >+ ++i; >+ restartv[i] = (char *) full_save_file (); >+ ++i; > restartv[i] = NULL; > > prop1.vals = g_new (SmPropValue, i); >@@ -1065,44 +1072,56 @@ load_state (const char *previous_save_fi > gsize length; > char *session_file; > >- session_file = g_strconcat (g_get_user_config_dir (), >- G_DIR_SEPARATOR_S "metacity" >- G_DIR_SEPARATOR_S "sessions" G_DIR_SEPARATOR_S, >- previous_save_file, >- NULL); >- >+ session_file = (char *) previous_save_file; >+ >+ /* First start with what has been given as file name */ > error = NULL; > if (!g_file_get_contents (session_file, > &text, > &length, > &error)) > { >- char *canonical_session_file = session_file; >+ g_error_free (error); >+ error = NULL; > >- /* Maybe they were doing it the old way, with ~/.metacity */ >- session_file = g_strconcat (g_get_home_dir (), >- G_DIR_SEPARATOR_S ".metacity" >- G_DIR_SEPARATOR_S "sessions" >- G_DIR_SEPARATOR_S, >+ session_file = g_strconcat (g_get_user_config_dir (), >+ G_DIR_SEPARATOR_S "metacity" >+ G_DIR_SEPARATOR_S "sessions" G_DIR_SEPARATOR_S, > previous_save_file, > NULL); >- >+ > if (!g_file_get_contents (session_file, > &text, > &length, >- NULL)) >+ &error)) > { >- /* oh, just give up */ >+ char *canonical_session_file = session_file; > >+ /* Maybe they were doing it the old way, with ~/.metacity */ > g_error_free (error); >- g_free (session_file); >+ session_file = g_strconcat (g_get_home_dir (), >+ G_DIR_SEPARATOR_S ".metacity" >+ G_DIR_SEPARATOR_S "sessions" >+ G_DIR_SEPARATOR_S, >+ previous_save_file, >+ NULL); >+ >+ if (!g_file_get_contents (session_file, >+ &text, >+ &length, >+ NULL)) >+ { >+ /* oh, just give up */ >+ >+ g_error_free (error); >+ g_free (session_file); >+ g_free (canonical_session_file); >+ return NULL; >+ } >+ > g_free (canonical_session_file); >- return NULL; > } >- >- g_free (canonical_session_file); > } >- > meta_topic (META_DEBUG_SM, "Parsing saved session file %s\n", session_file); > g_free (session_file); > session_file = NULL; >@@ -1701,15 +1720,12 @@ regenerate_save_file (void) > { > g_free (full_save_path); > >- if (client_id) >- full_save_path = g_strconcat (g_get_user_config_dir (), >- G_DIR_SEPARATOR_S "metacity" >- G_DIR_SEPARATOR_S "sessions" G_DIR_SEPARATOR_S, >- client_id, >- ".ms", >- NULL); >- else >- full_save_path = NULL; >+ full_save_path = g_strdup_printf ("%s%s-%ld.ms", >+ g_get_user_config_dir (), >+ G_DIR_SEPARATOR_S "metacity" >+ G_DIR_SEPARATOR_S "sessions" >+ G_DIR_SEPARATOR_S "metacity", >+ (long)time (NULL)); > } > > static const char*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 643450
: 468386