On 24.02.2012 16:24 (UTC+1), Carlos R. Mafra wrote:
On Fri, 24 Feb 2012 at 16:01:08 +0100, Rainer Hurling wrote:
On 24.02.2012 10:58 (UTC+1), Carlos R. Mafra wrote:
On Fri, 24 Feb 2012 at 1:21:58 -0800, Doug Barton wrote:
Use logical negation instead of comparison to 0 for a value that can
be numeric, but is null by default.
This doesn't seem to be right.
'restarting' is not a pointer, it is a 'int'. If checking a int
against zero is not allowed than you'd have many more things to
worry about, no?
So I guess that your patch is not really fixing the issue, even
though it makes things work for you.
Why did you say it is "null" by default? A variable of type
'int' can never be null. I guess it's simply not being set
as it should.
So I'm not applying the patch because I'm not convinced.
I might be mistaken, of course. But right now I don't
think so.
I am afraid your are right. I tried the patch on three boxes running
FreeBSD. On two of them it works and on the third it fails. The
third box is not able to restore any application window.
Ok.
The flag is set only inside src/main.c, I wonder why it is not being
set properly in FreeBSD.
Something (probably stupid) just crossed my mind. Does making the
restarting flag be a normal int (instead of a bit field) in
WindowMaker.h change something? I'd also change the other neighboring
members too to not be bit fields in order to test this. But ignore
me if you want :-)
Because I have only few programming skills I am not sure if I did it right:
--- WindowMaker.h.orig 2012-02-14 20:36:01.000000000 +0100
+++ WindowMaker.h 2012-02-24 17:43:09.000000000 +0100
@@ -428,17 +428,17 @@
int show_clip_title;
struct {
- unsigned int nodock:1; /* don't display the dock */
- unsigned int noclip:1; /* don't display the clip */
- unsigned int nocpp:1; /* don't use cpp */
- unsigned int noupdates:1; /* don't require ~/GNUstep
(-static) */
- unsigned int noautolaunch:1; /* don't autolaunch apps */
- unsigned int norestore:1; /* don't restore session */
- unsigned int create_stdcmap:1; /* create std colormap */
+ unsigned int nodock; /* don't display the dock */
+ unsigned int noclip; /* don't display the clip */
+ unsigned int nocpp; /* don't use cpp */
+ unsigned int noupdates; /* don't require ~/GNUstep
(-static) */
+ unsigned int noautolaunch; /* don't autolaunch apps */
+ unsigned int norestore; /* don't restore session */
+ unsigned int create_stdcmap; /* create std colormap */
#ifndef HAVE_INOTIFY
- unsigned int nopolling:1; /* don't poll the defaults
database for changes */
+ unsigned int nopolling; /* don't poll the defaults database
for changes */
#endif
- unsigned int restarting:2;
+ unsigned int restarting
} flags; /* internal flags */
} WPreferences;
Unfortunately this changes nothing in the behaviour of restoring the
sessions on FreeBSD.
--- src/startup.c.orig 2012-02-14 11:36:01.000000000 -0800
+++ src/startup.c 2012-02-23 15:50:19.000000000 -0800
@@ -761,7 +761,7 @@
wMenuRestoreState(wScreen[j]);
/* If we're not restarting, restore session */
- if (wPreferences.flags.restarting == 0&&
!wPreferences.flags.norestore)
+ if (!wPreferences.flags.restarting&&
!wPreferences.flags.norestore)
wSessionRestoreState(wScreen[j]);
if (!wPreferences.flags.noautolaunch) {
--
To unsubscribe, send mail to [email protected].