On Fri, Feb 24, 2012 at 03:58:29PM -0800, Doug Barton wrote:
> On 02/24/2012 15:18, Paul Harris wrote:
> > Have you tried printf( restoring ) ?
> 
> printf isn't defined in that scope. Did you see the bit upthread where I
> used wwarning() to print the values of both variables?

I see a bit upthread where you tried

  wmessage("restarting: %s, norestore: %s\n",
                  wPreferences.flags.restarting, wPreferences.flags.norestore);

I don't see anywhere where you got it to succeed though; the crashing
reported is because you're treating an int as a char *. Try this
instead:

  wmessage("restarting: %d, norestore: %d\n",
                  wPreferences.flags.restarting, wPreferences.flags.norestore);


On Sat, Feb 25, 2012 at 11:09:14PM +0100, Rainer Hurling wrote:
> On 25.02.2012 21:45 (UTC+1), Doug Barton wrote:
> 
> >If that doesn't work the next step would be for you to build it with
> >that line you found in startup.c completely out of the picture. In other
> >words, make the restoration command run unconditionally. If *that*
> >doesn't work there is a deeper problem somewhere.
> 
> Hope I understand right. I commented out line 764 of src/startup.c
> and build and install afterwards. Now I am able the restore saved
> sessions in every constellation. I can start and exit windows and
> docks and, when saving, they come back at the next start.
> 
> So it seems there is definitely something odd with
> wPreferences.flags.restarting or wPreferences.flags.norestore on
> FreeBSD?

Let's try some stuff.

First, in main.c line 547 you should see this line:

  memset(&wPreferences, 0, sizeof(WPreferences));

Just after that, insert my wmessage line above and let's see what you
get.

Also, for good measure, we could insert this too to get a listing of all
the command line args:

  for (i = 1; i < argc; i++) {
      wmessage("Arg %d is %s", i, argv[i]);
  }

Then we can also adjust lines 624-634 to look something like this:

  if (strcmp(argv[i], "--for-real") == 0) {
      wPreferences.flags.restarting = 0;
      wmessage("Got %s, set restarting = %d", argv[i], 
wPreferences.flags.restarting);
  } else if (strcmp(argv[i], "--for-real=") == 0) {
      wPreferences.flags.restarting = 1;
      wmessage("Got %s, set restarting = %d", argv[i], 
wPreferences.flags.restarting);
  } else if (strcmp(argv[i], "--for-real-") == 0) {
      wPreferences.flags.restarting = 2;
      wmessage("Got %s, set restarting = %d", argv[i], 
wPreferences.flags.restarting);
  } else if (strcmp(argv[i], "-no-autolaunch") == 0
         || strcmp(argv[i], "--no-autolaunch") == 0) {
      wPreferences.flags.noautolaunch = 1;
  } else if (strcmp(argv[i], "-dont-restore") == 0 || strcmp(argv[i], 
"--dont-restore") == 0) {
      wPreferences.flags.norestore = 1;
      wmessage("Got %s, set norestore = %d", argv[i], 
wPreferences.flags.norestore);

Let's see what all that tells us.


-- 
To unsubscribe, send mail to [email protected].

Reply via email to