wmaker-crm.git
14 years agoChange to the linux kernel coding style
Carlos R. Mafra [Wed, 19 Aug 2009 22:59:40 +0000 (20 00:59 +0200)]
Change to the linux kernel coding style

    for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)

14 years agoMake drawIconProc() static
Carlos R. Mafra [Wed, 19 Aug 2009 15:50:01 +0000 (19 17:50 +0200)]
Make drawIconProc() static

It is used only inside src/dialog.c

14 years agoClean up case switching in handleKeyPress()
Carlos R. Mafra [Wed, 19 Aug 2009 20:03:43 +0000 (19 22:03 +0200)]
Clean up case switching in handleKeyPress()

GCC has an extension to deal with ranges within case statements.
Let's use it to make the code more readable and ~5% smaller,

[mafra@Pilar:wmaker.git]$ size src/event.o.*
   text    data     bss     dec     hex filename
  13087       0    1056   14143    373f src/event.o.new
  13711       0    1056   14767    39af src/event.o.old

14 years agoRemove unsigned type from 'mask'
Carlos R. Mafra [Tue, 18 Aug 2009 14:28:43 +0000 (18 16:28 +0200)]
Remove unsigned type from 'mask'

    gcc-4.3.2 warns:

    defaults.c: In function 'getModMask':
    defaults.c:2586: warning: comparison of unsigned expression < 0 is always false

    The line in question is

        if (mask < 0)

    and 'mask' is the return of wXModifierFromKey() which is an 'int' and can
    indeed return a negative value (see src/xmodifier.c), so let 'mask' be
    an 'int' too.

14 years agoSanitize calling sites of wDefaultsCheckDomains()
Carlos R. Mafra [Tue, 18 Aug 2009 13:14:00 +0000 (18 15:14 +0200)]
Sanitize calling sites of wDefaultsCheckDomains()

There is no point in having parameter in wDefaultsCheckDomains() and
not using it, so let's simply remove the parameter altogether and
avoid silly-looking things like

    wDefaultsCheckDomains("bla");

14 years agoMake loop variable be unsigned int
Carlos R. Mafra [Tue, 18 Aug 2009 13:03:43 +0000 (18 15:03 +0200)]
Make loop variable be unsigned int

gcc was complaining in a few places things like:

defaults.c:890: warning: comparison between signed and unsigned

so let's just make the loop counting variables be unsigned, as
the never get negative anyway.

I also spotted other two variables which can be unsigned too.

14 years agoFix variable shadowing
Carlos R. Mafra [Tue, 18 Aug 2009 12:54:15 +0000 (18 14:54 +0200)]
Fix variable shadowing

gcc-4.3.2 warns:
defaults.c:3136: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:309: warning: shadowed declaration is here

and in a few other places too. Fix this by renaming 'index' to 'widx'.

14 years agoWMCreateFont: Add missing wfree()'s
Carlos R. Mafra [Tue, 18 Aug 2009 02:33:39 +0000 (18 04:33 +0200)]
WMCreateFont: Add missing wfree()'s

I removed (forgot) them when in commit ee28b0257ab5 ("Avoid returning
font=NULL in WMCreateFont()"). Add them back.

14 years agohandleKeyPress: Fix shadowing of global 'index' variable
Carlos R. Mafra [Mon, 17 Aug 2009 22:56:09 +0000 (18 00:56 +0200)]
handleKeyPress: Fix shadowing of global 'index' variable

GCC warns:

event.c: In function 'handleDestroyNotify':
event.c:676: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:309: warning: shadowed declaration is here
event.c: In function 'handleKeyPress':
event.c:1435: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:309: warning: shadowed declaration is here

So let's rename "index" to "widx".

Note that there is a more serious shadowing in this same function,

event.c:1686: warning: declaration of 'wwin' shadows a previous local

but this is more complicated to solve.

14 years agoinotifyHandleEvents: Reduce buffer size to avoid huge memory consumption
Carlos R. Mafra [Mon, 17 Aug 2009 22:30:17 +0000 (18 00:30 +0200)]
inotifyHandleEvents: Reduce buffer size to avoid huge memory consumption

inotifyHandleEvents() was allocating a buffer of size

 (sizeof(struct inotify_event) + FILENAME_MAX)*1024

where FILENAME_MAX is #defined to be 4096 in stdio_lim.h, therefore
it was more than 4 MB!

Reduce it by using 16 instead of FILENAME_MAX and 512 instead of 1024.

Now valgrind does not complain about things like

Invalid write of size 8
 at 0x42002F: inotifyHandleEvents (event.c:323)
 by 0x7FF00020F: ???
 Address 0x7febfc148 is on thread 1's stack

I also made some small coding style changes.

14 years agoreal_main: Use setenv() instead of putenv() in remaining places
Carlos R. Mafra [Mon, 17 Aug 2009 20:42:38 +0000 (17 22:42 +0200)]
real_main: Use setenv() instead of putenv() in remaining places

It simplifies the code a bit.

14 years agoreal_main: Use setenv() instead of putenv()
Carlos R. Mafra [Mon, 17 Aug 2009 20:03:28 +0000 (17 22:03 +0200)]
real_main: Use setenv() instead of putenv()

When investigating possible memory leaks with 'valgrind' I noticed
this leak report:

 602 bytes in 13 blocks are definitely lost in loss record 77 of 128
    at 0x4C2362E: malloc (vg_replace_malloc.c:207)
    by 0x4576ED: wmalloc (memory.c:88)
    by 0x45B4F7: wstrconcat (string.c:214)
    by 0x426FC2: main (main.c:608)

which happens here,

    str = wstrconcat("WMAKER_BIN_NAME=", argv[0]);
    putenv(str);

There is a comment further below (in another context)

/* return of wstrconcat should not be free-ed! read putenv man page */

so this leak report is probably a false positive anyway. However,
https://www.securecoding.cert.org/confluence/display/seccode/POS34-C.+Do+not+call+putenv%28%29+with+a+pointer+to+an+automatic+variable+as+the+argument
has some nice discussion about putenv() and after reading it I decided to
use setenv() instead, making 'valgrind' happy along the way. It also
makes the code a bit simpler, avoiding a call to wstrconcat().

I also changed the name of another variable called 'str' to 'pos', just
in case.

14 years agoFix improper use of function sentinel
Carlos R. Mafra [Mon, 17 Aug 2009 16:13:58 +0000 (17 18:13 +0200)]
Fix improper use of function sentinel

This patch addresses this warning of gcc:

wfontpanel.c: In function 'listFamilies':
wfontpanel.c:588: warning: missing sentinel in function call

Fix it by using the 'NULL' pointer instead of 0 (zero) as the
sentinel.

For more information, see
http://www.linuxonly.nl/docs/2/2_GCC_4_warnings_about_sentinels.html
in particular,

   "On most systems, there is no difference between 0 and (char *)0.
    On 64 bit systems, however, the integer 0 is 32 bits and the
    pointer 0 is 64 bits. The compiler does not know whether it is
    an integer or a pointer, and defaults for the integer. This will
    not clear the upper 32 bits and the function will not stop
    scanning its parameters."

Note that here in my 64-bit Mandriva I don't need to cast (char *)NULL.

14 years agoWPrefs: Remove unused function updateThemeList()
Carlos R. Mafra [Mon, 17 Aug 2009 15:44:00 +0000 (17 17:44 +0200)]
WPrefs: Remove unused function updateThemeList()

14 years agoRemove unused variables
Carlos R. Mafra [Mon, 17 Aug 2009 15:35:48 +0000 (17 17:35 +0200)]
Remove unused variables

GCC -Wall complains about them.

14 years agoMake compilation even less verbose
Carlos R. Mafra [Mon, 17 Aug 2009 14:49:22 +0000 (17 16:49 +0200)]
Make compilation even less verbose

Add "-s" flag to MAKEFLAGS if --disable-verbose-compile
is enabled.

14 years agoRemove prototype of unused function StartLogShell
Carlos R. Mafra [Sun, 16 Aug 2009 09:14:40 +0000 (16 11:14 +0200)]
Remove prototype of unused function StartLogShell

14 years agoFix buffer overflow in SendHelperMessage()
Tamas TEVESZ [Wed, 24 Dec 2008 13:10:33 +0000 (24 14:10 +0100)]
Fix buffer overflow in SendHelperMessage()

The following fixes a buffer overflow in SendHelperMessage() which i
started seeing recently on x64.

14 years agoRemove unused StartLogShell function.
John H. Robinson, IV [Sat, 13 Dec 2008 22:44:59 +0000 (13 14:44 -0800)]
Remove unused StartLogShell function.

Based upon a patch by Tobias Stoeckmann

Small code size reduction,

   text    data     bss     dec     hex filename
 620412   19144    8544  648100   9e3a4 src/.libs/wmaker
 621347   19152    8544  649043   9e753 src/.libs/wmaker.old

14 years agoCheck for argc==0 when calling wtokensplit()
Tobias Stoeckmann [Sat, 15 Aug 2009 22:16:58 +0000 (16 00:16 +0200)]
Check for argc==0 when calling wtokensplit()

The WINGs-function wtokensplit does not set argv to NULL if no string has been
split - instead argc is set to 0.

You can only observe this issue if you compile Window Maker without any
optimization:

compile Window Maker with CFLAGS=""
run Window Maker and save a session
change session-file and replace a 'command xyz' line with 'command " "'
restart Window Maker
watch "Fatal error"-message

Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/
Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
14 years agoxinerama switchpanel corruption fix
Iain Patterson [Sat, 15 Aug 2009 22:04:39 +0000 (16 00:04 +0200)]
xinerama switchpanel corruption fix

This is a small patch to fix an issue with the switchpanel and a large number
of windows which happens only on a Xinerama setup.

When the number of open windows is so large that displaying all of them would
cause the switchpanel to be too wide for the screen, the panel is supposed to
shrink and scroll to accomodate them all.

In Window Maker 0.92.0 this works for single head displays but not for
Xinerama. The panel extends to the next head and gets garbled. This patch fixes
the issue by correctly constraining the panel to the head with the cursor.

Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
14 years agoFix mixing pixels when maximizing borderless windows
David Benbennick [Sat, 15 Aug 2009 18:02:35 +0000 (15 20:02 +0200)]
Fix mixing pixels when maximizing borderless windows

A minor bug has been bothering me for a long time. When you maximize a
borderless window in Window Maker, the window ends up too narrow and too short
by two pixels.

Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
14 years agoFix workspace limit segfault
Samir SAADA [Sun, 19 Apr 2009 21:23:46 +0000 (19 23:23 +0200)]
Fix workspace limit segfault

wmaker keeps the names of all workspaces together in
the string 'buf' with fixed length of 1024, therefore
allowing buffer overflows if the number of workspaces
is big enough.

For the default names "Workspace X" (from 1 to 9)
and "Workspace XX" (from 10 to 99) etc, the approximate
number of workspaces necessary to make the buffer
overflow occur is 80, because

(11*9) + (71*12) + 80 = 1031

The fix is to set the size of 'buf' as
the maximum number of workspaces times their maximum
name length.

The problem was reported by John H. Robinson in the wmaker-dev
list ( http://lists.windowmaker.info/dev/msg00214.html ):

 "http://www.youtube.com/watch?v=fkNJZvKwmhE

  Michael reported a problem with Window Maker where it crashes with a
  SIGSGV when trying to create an 82nd workspace.

  /usr/local/WindowMaker-0.92.1pre/bin/wmaker warning: Window Maker exited
  due to a crash (signal 11) and will be restarted.

  I was able to reproduce it by making 81 workspaces, then creating an 82nd."

[ crmafra: Wrote the changelog ]

14 years agoavoid integer overflow
Tamas TEVESZ [Sat, 27 Dec 2008 16:45:38 +0000 (27 17:45 +0100)]
avoid integer overflow

Actually, the whole thing is so chock full of signed vs unsigned
mixups and the assumption of all the world is 32-bit that i'm not sure
anymore that correcting them one by one is a good idea.

what would probably work best is that if someone deeply familiar with
the code (*looks in dan's general direction*) cleaned the data types
up, then legions of grunts like myself could start cleaning the rest
with relative confidence...

14 years agoSync comment with reality
Tamas TEVESZ [Fri, 26 Dec 2008 07:35:14 +0000 (26 08:35 +0100)]
Sync comment with reality

Or rather, remove possibility for comment to diverge from reality

14 years agoFix menu positioning bug
Samir SAADA [Fri, 29 May 2009 18:39:41 +0000 (29 20:39 +0200)]
Fix menu positioning bug

Here I tried to prevent the menu of windows to be displayed in the
other side of the screen if the window is half present in the screen
horizontally (ie x < 0)

a worse problem with menu is that it disappears when
the window is half present in the window vertically
ie y < 0, that makes it not usable.

14 years agoTrivial cleanup
Carlos R. Mafra [Sat, 8 Aug 2009 21:37:27 +0000 (8 23:37 +0200)]
Trivial cleanup

15 years agoFix gcc warnings
Carlos R. Mafra [Mon, 10 Nov 2008 00:35:57 +0000 (10 01:35 +0100)]
Fix gcc warnings

This patch fixes the following warnings (with gcc 4.2.3)

    defaults.c:980: warning: unused variable 'replace'
    main.c:504: warning: 'watchPath' may be used uninitialized in this function
    main.c:504: note: 'watchPath' was declared here
    startup.c:616: warning: implicit declaration of function 'XrmUniqueQuark'

15 years agoCompilation: Add a few spaces in the output
Carlos R. Mafra [Sun, 9 Nov 2008 23:14:07 +0000 (10 00:14 +0100)]
Compilation: Add a few spaces in the output

It is even better to have the messages displayed a few spaces
off from the left screen border.

The inspiration comes from the Git compilation output.

15 years agoFix buffer overflows in shortcut and workspace name handling
Carlos R. Mafra [Sun, 9 Nov 2008 19:18:05 +0000 (9 20:18 +0100)]
Fix buffer overflows in shortcut and workspace name handling

The handling of user defined shortcuts was not checking the length
of the shortcut before copying it to a fixed-length temporary buffer,

char buf[128];

     strcpy(buf, shortcutDefinition);

and strcpy() is well known for not checking if overflows will occur.

In particular, wmaker was crashing here if a big 'shortcut' was defined
either through WPrefs or by directly editing the configuration files.

This is now avoided by using strncpy() instead.

And this patch also fixes a similar buffer overflow for big workspace
names too.

Furthermore, use MAX_SHORTCUT_LENGTH instead of raw number and define
it to be 32 instead of 128.

15 years agowmaker: Fix compiler warnings about pointer <--> integer conversion
Carlos R. Mafra [Thu, 6 Nov 2008 00:37:44 +0000 (6 01:37 +0100)]
wmaker: Fix compiler warnings about pointer <--> integer conversion

There may be issues with running applications in 64-bit mode when
they were written with tacit assumptions about 32-bit platforms.
For example,

    * Assuming that a pointer can be cast back and forth to an integer

The reason is that the size of the integer and pointer may be different.
See the description of "[PATCH] Warn when casting a pointer (constant)
to an integer of different size." in the gcc mailing list

http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html

where it was also suggested the use of casts to uintptr_t. This is
what this patch does.

As a result the following warnings are fixed, leaving us with an
almost warning-free compilation in 64-bit platforms:

defaults.c:1446: warning: cast to pointer from integer of different size
defaults.c:1457: warning: cast to pointer from integer of different size
defaults.c:1471: warning: cast to pointer from integer of different size
defaults.c:1486: warning: cast to pointer from integer of different size
icon.c:67: warning: cast from pointer to integer of different size
menu.c:112: warning: cast from pointer to integer of different size
switchmenu.c:452: warning: cast from pointer to integer of different size
window.c:140: warning: cast from pointer to integer of different size
window.c:2217: warning: cast to pointer from integer of different size
workspace.c:135: warning: cast to pointer from integer of different size
workspace.c:214: warning: cast to pointer from integer of different size
workspace.c:634: warning: cast to pointer from integer of different size
workspace.c:1330: warning: cast to pointer from integer of different size
workspace.c:1514: warning: cast to pointer from integer of different size
wfilepanel.c:135: warning: cast from pointer to integer of different size
wfilepanel.c:171: warning: cast from pointer to integer of different size
wfontpanel.c:499: warning: cast to pointer from integer of different size
wfontpanel.c:500: warning: cast to pointer from integer of different size
wfontpanel.c:505: warning: cast to pointer from integer of different size
wfontpanel.c:506: warning: cast to pointer from integer of different size
wfontpanel.c:776: warning: cast from pointer to integer of different size
wfontpanel.c:777: warning: cast from pointer to integer of different size
wfontpanel.c:877: warning: cast from pointer to integer of different size
wfontpanel.c:878: warning: cast from pointer to integer of different size
wpanel.c:363: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:90: warning: cast to pointer from integer of different size
puzzle.c:138: warning: cast from pointer to integer of different size
puzzle.c:225: warning: cast to pointer from integer of different size
wtableview.c:1031: warning: cast to pointer from integer of different size
wtableview.c:1067: warning: cast to pointer from integer of different size
wtableview.c:1069: warning: cast to pointer from integer of different size
wtableview.c:1074: warning: cast to pointer from integer of different size
wtabledelegates.c:234: warning: cast from pointer to integer of different size
wtabledelegates.c:250: warning: cast from pointer to integer of different size
wtabledelegates.c:265: warning: cast from pointer to integer of different size
wtabledelegates.c:287: warning: cast to pointer from integer of different size
wtabledelegates.c:351: warning: cast from pointer to integer of different size
wtabledelegates.c:372: warning: cast from pointer to integer of different size
wtabledelegates.c:393: warning: cast from pointer to integer of different size
wtabledelegates.c:410: warning: cast to pointer from integer of different size
test.c:44: warning: cast from pointer to integer of different size
test.c:47: warning: cast to pointer from integer of different size
test.c:55: warning: cast from pointer to integer of different size
test.c:58: warning: cast from pointer to integer of different size

15 years agoautomake: Fix warnings about underquoted calls to AC_DEFUN
Carlos R. Mafra [Wed, 5 Nov 2008 17:17:55 +0000 (5 18:17 +0100)]
automake: Fix warnings about underquoted calls to AC_DEFUN

This patch fixes warnings from automake versions >=1.8 about
underquoted calls to AC_DEFUN.

I followed the recommended modifications of
http://sources.redhat.com/automake/automake.html#Extending-aclocal

15 years agoMakefile: Beautify compilation messages
Carlos R. Mafra [Wed, 5 Nov 2008 01:09:10 +0000 (5 02:09 +0100)]
Makefile: Beautify compilation messages

This patch adds the --disable-verbose-compile switch to the
configure script.

When this option is used it reduces the verbosity of compilation
messages to the essential. However compiler warnings are not affected
and thus gain visibility by not standing in the middle of a storm
of other messages.

In summary, the compilation messages are reduced to a stream of

CC array.o
CC bagtree.o
CC configuration.o
CC connection.o
CC data.o
[...]

instead of a mind-boggling flux of

gcc -DHAVE_CONFIG_H -I. -I../src -I../WINGs/WINGs -I../wrlib -I../src
-I/usr/include/freetype2   -I/usr/local/include
-DLOCALEDIR=\"/usr/local/lib/loca\"/usr/local/share/WINGs\"
-DDEBUG  -fno-strict-aliasing -g -O2 -c array.c
gcc -DHAVE_CONFIG_H -I. -I../src -I../WINGs/WINGs
-I../wrlib -I../src -I/usr/include/freetype2   -I/usr/local/include
-DLOCALEDIR=\"/usr/local/lib/loca\"/usr/local/share/WINGs\"
-DDEBUG  -fno-strict-aliasing -g -O2 -c bagtree.c
[...]

15 years agoUse inotify to check for changes to the defaults database. Workaround for
Rodney Padgett [Sat, 9 Aug 2008 10:39:24 +0000 (9 11:39 +0100)]
Use inotify to check for changes to the defaults database. Workaround for

event handler timer.

After upgrading my kernel recently I noticed that dnotify has been
depreciated, so I decided to try and implement the new inotify code in
Window Maker instead.

During testing, I also found that one of the timers which was removed
(the one causing the most wake-ups), calling delayedAction, was
responsible for handling signals. Basically with this timer removed,
signals were only handled after an X event occurs.

After looking at the delayedAction function, I couldn't see the purpose of it.
It certainly wouldn't cause any delay as it was called by the timer every
500ms, so there is no time correlation with when a signal was received.
Also, it appeared to count the signals and call DispatchEvent for each
one, but it appears DispatchEvent would just handle the most recent signal
and take action on that. The signals handled by delayedAction are the
various exit and reset signals, so only one need to be handled. I
therefore have commented out delayedAction (it wasn't called by any other
procedure) and added a call to DispatchEvent imediately after the signal
is registered, in handleExitSig.

I'm not sure what problems this may cause with dead children - these are
only cleaned up after an Xevent now that the timer is removed- but I
haven't observed any problems since a few months ago.

15 years agoFix periodic focus bug
Pedro Gimeno [Mon, 19 May 2008 20:52:00 +0000 (19 17:52 -0300)]
Fix periodic focus bug

Pedro Gimeno explains:

"As you most likely already know, every X Window event comes with a
timestamp. You can see it using e.g. xev.

I don't know if this is Debian-specific and I'm no X Window expert, but
the fact is that in my machine this timestamp, according to my
/usr/include/X11/X.h, is a 32-bit unsigned integer and it holds the
event time in milliseconds according to my tests.

This timestamp appears to be in milliseconds from the start of the Unix
epoch, modulo 2^32. The problem is that 32 bits are too little for this
purpose: 2^32 milliseconds are exactly 49 days, 17 hours, 2 minutes and
47.296 seconds.

Now, the WindowMaker code rejects any focus event whose timestamp is
less than the last one seen, using code similar to this:

 if (timestamp < LastTimeStamp) return;
 LastTimeStamp = timestamp;

This is a disaster when timestamp wraps around because of the 32-bit
limit. Say LastTimeStamp equals 2^32-1 and a focus event comes two
milliseconds after. Its timestamp will equal 1 because of the
wraparound. Obviously, 1 < 2^32-1 so the event will be rejected even if
it comes from the future (relative to LastTimeStamp) and not from the
past. Focus events are no longer accepted because nothing can be greater
than 2^32-1 (unless you click on that exact millisecond, 49 days after).

If you look in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314
you'll see two people confirming the periodicity and predictability of
the bug. Arnaud Giersch was who noted that the period was 2^32
milliseconds (and not 2^31 as I thought it could be because of a signed
int involved) and who noted the coincidence with the Unix epoch.

My fix works by subtracting one timestamp from the other (an operation
which is done modulo 2^32) and rejecting the focus event only if the new
timestamp is within 1 minute (60000 milliseconds) in the past. Given the
periodicity of the timestamp, actually after 49.7 days there will be
another minute in the future during which focus events will not be
accepted; again after 99.4 days, etc., but thanks to the subtraction,
they will now be relative to the *last* focus change and not to the Unix
epoch.

The patch could be simplified to get rid of the compareTimes function.
It's written like that because it comes from the previous patch (which
you can see in the same bug report).

So the date comparison line could end up looking like this:

   if (scr->flags.ignore_focus_events || LastFocusChange - timestamp <
60000)

so you can get rid of the compareTimes function. However please respect
the other change of 'int' to 'Time'.

As for why you aren't experiencing this problem, perhaps the event
timestamp does not come from the Unix epoch in your X Window system, but
rather starts counting when you start it or your computer, I don't know.
Or maybe your X Window server's timestamps are 64 bits wide instead of
32 bits, which I don't think because I doubt the X11 protocol specifies
a 64-bit record for the transmission of the timestamp. In either case,
the output of xev will probably help understanding the cause.

Or maybe even it's a click-to-focus only bug and you're not using that
mode. I haven't checked who calls wSetFocusTo.

Note that I can reproduce it just by manipulating the system clock,
which seems to be tied to the event timestamps."

For more information see:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314

Reported-by: Joey Hess <joeyh@debian.org>
Signed-off-by: Pedro Gimeno <parigalo@formauri.es>
16 years agoWorkaround for Composite problems when default depth is not 24.
Paulo Cesar Pereira de Andrade [Sat, 3 May 2008 22:30:42 +0000 (3 19:30 -0300)]
Workaround for Composite problems when default depth is not 24.

  This is really a workaround patch, the proper fix would be to have
WindowMaker know about Composite, and take advantage of it's features.

16 years agoWINGs/wfont.c: Avoid returning font=NULL in WMCreateFont()
Carlos R. Mafra [Fri, 2 May 2008 23:23:00 +0000 (2 20:23 -0300)]
WINGs/wfont.c: Avoid returning font=NULL in WMCreateFont()

WPrefs tries to use the fonts listed in the WMCreateFont() call (from WPrefs.c),

font = WMCreateFont(scr, "Lucida Sans,URW Gothic L,Times New Roman,serif"
                         ":bold:pixelsize=26:antialias=true");

and 'font' is later used without accounting the possibility of it being NULL in

WMSetLabelFont(WPrefs.nameL, font);
WMReleaseFont(font);

In particular, WMReleaseFont(font) will kill WPrefs ungracefully with the
following message if font=NULL

WPrefs: wfont.c:193: WMReleaseFont: Assertion `font!=((void *)0)' failed.
Aborted

That happens because the return value of WMCreateFont() can be NULL, so this
patch makes WMCreateFont() never return NULL. If the font creation fails for
some reason (see below), we try to use the emergency DEFAULT_FONT and print
debugging information telling what's going on. If the use of DEFAULT_FONT
also fails, then we terminate WPrefs with exit(1) and let the user know
why exactly if failed.

This bug happened because the font "Lucida Sans" (the first possibility
in the initial call to WMCreateFont()) "exists" in my system as a stale
symbolic link to a location which no longer exists after an upgrade from
java from 1.5.0.14 to 1.5.0.15

    /etc/alternatives/LucidaSansDemiBold.ttf ->
    /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/fonts/LucidaSansDemiBold.ttf

So the call to XftFontOpenName(display, scrPtr->screen, fname) with
"Lucida Sans" being the first possibility for Xft to try out ended up in 'font'
being NULL because, as far as the Xft library was concerned, "Lucida Sans"
produced a positive match (due to it existing as a symbolic link) but in the end
a NULL result was produced due to the missing symbolic link destination. This later
exposed the bug of WMCreateFont() returning font=NULL and WPrefs.c not checking
whether font=NULL before using it. Bang!

If "Lucida Sans" was the _second_ entry to try and the first one had suceeded,
this bug would not have surfaced.

This solves https://qa.mandriva.com/show_bug.cgi?id=39677

Signed-off-by: Carlos R. Mafra <crmafra@ift.unesp.br>
16 years agowmaker: Reduce wakeups to zero
Carlos R. Mafra [Fri, 2 May 2008 23:01:50 +0000 (2 20:01 -0300)]
wmaker: Reduce wakeups to zero

This patch removes wmaker from PowerTop's shame list, where
it appeared with ~3-4 wakeups/second.

It adds the linux kernel's dnotify mechanism (adapted from
the example in Documentation/dnotify.txt in the kernel source),
to detect when a configuration file in ~/GNUStep/Defaults has
changed to load it again on-the-fly. For me it usually means that
modifications to ~/GNUStep/Defaults/WMRootMenu via the 'genmenu'
script are automatically detected and loaded.

The use of dnotify makes the ancient behaviour of polling unecessary
and cuts down the wakeups count.

Other 'apparently' useless timers are also deleted and it's been almost
one year now that I use this patched exclusively without problems, so
I am pretty sure that it doesn't hurt to remove them.

The end result of all this is that wmaker generates 0 (zero) wakeups
when idle in a Linux system.

Signed-off-by: Carlos R. Mafra <crmafra@ift.unesp.br>
16 years agoAdd .gitignore to git repository
Carlos R. Mafra [Fri, 2 May 2008 04:01:24 +0000 (2 01:01 -0300)]
Add .gitignore to git repository

18 years agoFixed segfault when unhiding an application in certain conditions (seenwmaker-0.92.0+
dan [Thu, 27 Apr 2006 19:16:58 +0000 (27 19:16 +0000)]
Fixed segfault when unhiding an application in certain conditions (seen
with KDE applications with transient windows)

18 years agoupdated todo with ideas for post 1.0
dan [Thu, 27 Apr 2006 02:57:57 +0000 (27 02:57 +0000)]
updated todo with ideas for post 1.0

18 years agoEnhanced the cursor positioning/selecting text using the mouse in a textfield.
dan [Thu, 27 Apr 2006 02:48:18 +0000 (27 02:48 +0000)]
Enhanced the cursor positioning/selecting text using the mouse in a textfield.

This also fixed an endless loop that could be entered by the previous code
in certain situations, after the patch to fix navigation/selection in a
textfiled with UTF8 chars was applied.

18 years agoRemoved WINGs' dependency on rgb.txt (from X11).
dan [Wed, 26 Apr 2006 20:28:24 +0000 (26 20:28 +0000)]
Removed WINGs' dependency on rgb.txt (from X11).

This fixes issues with locating the file which is being stored on different
locations depending on the X server release/version

18 years agoApplied patches from Stanislav Maslovski <stanislav.maslovski@gmail.com> to
dan [Tue, 25 Apr 2006 23:52:43 +0000 (25 23:52 +0000)]
Applied patches from Stanislav Maslovski <stanislav.maslovski@gmail.com> to
fix the 2 problems mentioend below:

- Fixed buggy handling of UTF8 characters in textfields in WINGs.
- Fixed segfault in WPrefs when some font description is missing from the
  configuration file.

18 years agomore fixes for missing linking flags in some cases
dan [Tue, 25 Apr 2006 20:01:51 +0000 (25 20:01 +0000)]
more fixes for missing linking flags in some cases

18 years agoreplaced windowmaker.org with windowmaker.info everywhere
dan [Tue, 25 Apr 2006 19:35:14 +0000 (25 19:35 +0000)]
replaced windowmaker.org with windowmaker.info everywhere

18 years ago- Improved Info panel display.
dan [Tue, 25 Apr 2006 18:59:24 +0000 (25 18:59 +0000)]
- Improved Info panel display.
- Fixed missing library paths when linking some binaries on certain
  platforms with a recent pkg-config

18 years agoyet another cvs commit notification test
dan [Tue, 25 Apr 2006 18:50:42 +0000 (25 18:50 +0000)]
yet another cvs commit notification test

18 years agoanother cvs commit notification test
dan [Tue, 25 Apr 2006 18:46:14 +0000 (25 18:46 +0000)]
another cvs commit notification test

18 years agocvs commit notification test
dan [Tue, 25 Apr 2006 18:23:19 +0000 (25 18:23 +0000)]
cvs commit notification test

18 years agocvs commit notification test
dan [Tue, 25 Apr 2006 17:58:33 +0000 (25 17:58 +0000)]
cvs commit notification test

18 years agotest cvs commit notifications
dan [Tue, 28 Mar 2006 19:50:04 +0000 (28 19:50 +0000)]
test cvs commit notifications

18 years agotest cvs commit notifications
dan [Mon, 23 Jan 2006 06:47:27 +0000 (23 06:47 +0000)]
test cvs commit notifications

18 years ago- updated the XDND code in WINGs to work with GDK based applications.
dan [Sun, 22 Jan 2006 20:33:19 +0000 (22 20:33 +0000)]
- updated the XDND code in WINGs to work with GDK based applications.
  WINGs based applications should now work with both KDE and GNOME
  applications (Sylvain Reynal <sreynal@nerim.net>)
- better check for the XDND protocol version when interoperating with other
  applications. As it seems xdnd version 3 (which WINGs supports) and newer
  are not backward compatible with xdnd version 1 and 2. This is why WINGs
  applications cannot interoperate with GNUstep applications (which uses
  xdnd version 2). Xdnd version 4 and 5 are backwards compatible with
  version 3 though. (Sylvain Reynal <sreynal@nerim.net>)

18 years agoupdated estonian translation
dan [Sun, 22 Jan 2006 19:20:57 +0000 (22 19:20 +0000)]
updated estonian translation

18 years ago- release colors to avoid issues with the reference count overflowing a
dan [Sun, 22 Jan 2006 18:19:09 +0000 (22 18:19 +0000)]
- release colors to avoid issues with the reference count overflowing a
  small integer and causing unexpected color releases that can crash
  Window Maker (Martin Frydl <martin.frydl@systinet.com>)
- fixed a small memory leak in WINGs/wview.c caused by not releasing the
  background color of a view (Martin Frydl <martin.frydl@systinet.com>)

18 years ago- fixed issue with invisible modal windows from Qt and Gtk applications
dan [Sun, 22 Jan 2006 18:05:00 +0000 (22 18:05 +0000)]
- fixed issue with invisible modal windows from Qt and Gtk applications
  on 64bit platforms (Max Loparyev <max@city.veganet.ru>)
- fixed issue with icon colors on big endian platforms
  (Max Loparyev <max@city.veganet.ru>)

patch based on a previous patch by Vladimir Nadvornik <nadvornik@suse.cz>

18 years agotest
dan [Sun, 22 Jan 2006 16:29:39 +0000 (22 16:29 +0000)]
test

18 years agotest
dan [Sun, 22 Jan 2006 16:03:31 +0000 (22 16:03 +0000)]
test

18 years agoApplied some patches from Balaton Zoltan <balaton@eik.bme.hu>
dan [Sun, 22 Jan 2006 15:53:44 +0000 (22 15:53 +0000)]
Applied some patches from Balaton Zoltan <balaton@eik.bme.hu>

- small fix for compilation in a different directory than the source
- fixed some warnings on 64bit platforms

18 years agoeliminated gcc-4 compilation warnings
dan [Mon, 22 Aug 2005 23:58:19 +0000 (22 23:58 +0000)]
eliminated gcc-4 compilation warnings

18 years ago- fixed gcc-4 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
dan [Mon, 22 Aug 2005 19:07:57 +0000 (22 19:07 +0000)]
- fixed gcc-4 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)
- fixed amd64 compilation issues (Vladimir Nadvornik <nadvornik@suse.cz>)

18 years agoFixed WPrefs.app to find its icons when not installed under GNUstep paths
dan [Sun, 17 Jul 2005 19:16:46 +0000 (17 19:16 +0000)]
Fixed WPrefs.app to find its icons when not installed under GNUstep paths

18 years agoupdated german translations
dan [Tue, 5 Jul 2005 19:41:06 +0000 (5 19:41 +0000)]
updated german translations

18 years agotry to work around some user's IQ level
dan [Tue, 5 Jul 2005 08:44:00 +0000 (5 08:44 +0000)]
try to work around some user's IQ level

18 years agoupdated news file (part 2)
dan [Sun, 3 Jul 2005 18:08:46 +0000 (3 18:08 +0000)]
updated news file (part 2)

18 years agoupdated news file
dan [Sun, 3 Jul 2005 18:01:46 +0000 (3 18:01 +0000)]
updated news file

18 years ago- new algorithm for placing miniwindows after unhiding the application theywmaker-0.92.0
dan [Sun, 3 Jul 2005 17:37:03 +0000 (3 17:37 +0000)]
- new algorithm for placing miniwindows after unhiding the application they
  belong to, that works without auto-arranging the icons, while still avoiding
  multiple icons in the same spot by moving the miniwindows to a new slot if
  their old slot was occupied in the meantime.
- double clicking an appicon will also raise the miniwindows that belong to
  that application to the front (along with the normal windows).

18 years ago- try fixed font for the technical drawing font if helvetica-12 is not
dan [Sun, 3 Jul 2005 00:49:06 +0000 (3 00:49 +0000)]
- try fixed font for the technical drawing font if helvetica-12 is not
  available to avoid crashing (Timo Juhani Lindfors <timo.lindfors@iki.fi>)
- german WINgs po file fix

18 years agoFixed issue with GNUstep applications losing focus when all their windows
dan [Sat, 2 Jul 2005 19:23:41 +0000 (2 19:23 +0000)]
Fixed issue with GNUstep applications losing focus when all their windows
are closed and there remains only their menu (Matt Rice <ratmice@yahoo.com>)

18 years ago- fixed bug with windows shrinking to very small sizes when Unmaximize was
dan [Sun, 15 May 2005 16:45:02 +0000 (15 16:45 +0000)]
- fixed bug with windows shrinking to very small sizes when Unmaximize was
  used on them, after they were closed in a maximized state.
- fixed bug with restoring maximized state from NetWM atoms.

19 years agoremoved obsolete file
dan [Mon, 9 May 2005 00:27:33 +0000 (9 00:27 +0000)]
removed obsolete file

19 years agoImproved hide/unhide animation for applications with multiple windows
dan [Sun, 8 May 2005 00:51:56 +0000 (8 00:51 +0000)]
Improved hide/unhide animation for applications with multiple windows
(only animate the active window hiding/unhiding, which makes Window Maker
faster and more responsive for such applications).

19 years ago- Fixed switch panel default value in defaults.c
dan [Fri, 8 Apr 2005 11:51:06 +0000 (8 11:51 +0000)]
- Fixed switch panel default value in defaults.c
- Fixed WPrefs path in the installed WMState (changed after recent WPrefs
  installation path changes)
- Fixed wmaker.inst (apparently some very noisy individual was unable to get
  right his 10 line patch to rename a path)

19 years agoFixed bug that caused wmaker to crash when kplayer was switched back from
dan [Tue, 22 Mar 2005 23:15:11 +0000 (22 23:15 +0000)]
Fixed bug that caused wmaker to crash when kplayer was switched back from
fullscreen mode to windowed mode.

19 years agofixed issue with window being moved by 1 pixel up and left when the window
dan [Sun, 13 Mar 2005 00:15:13 +0000 (13 00:15 +0000)]
fixed issue with window being moved by 1 pixel up and left when the window
move was initiated by the client

19 years agoAdded code to automatically convert Icon paths in WMWindowAttributes from
dan [Sat, 12 Mar 2005 01:16:04 +0000 (12 01:16 +0000)]
Added code to automatically convert Icon paths in WMWindowAttributes from
the old .AppInfo/... to the new Library/WindowMaker/... on the fly when
Window Maker starts.
This should allow a transparent transition without any need for users to do
anything.

19 years agoChanges (especially the ones that may affect backward compatibility like
dan [Fri, 11 Mar 2005 23:05:43 +0000 (11 23:05 +0000)]
Changes (especially the ones that may affect backward compatibility like
this path change) should go at the top of the NEWS file. None digs 1200
lines in the NEWS to read about some path change.

19 years agoFixed paths, because mr Alex "Big Mouth" Perez was unable to get them right
dan [Fri, 11 Mar 2005 22:57:40 +0000 (11 22:57 +0000)]
Fixed paths, because mr Alex "Big Mouth" Perez was unable to get them right
in the first place in his trivial 10 line patch which only attempted to
replace one path with another.
He must be a big time user of his own patch, to not have noticed where the
paths pointed after his change.

19 years agofixed cvs to compile again
dan [Fri, 11 Mar 2005 21:59:06 +0000 (11 21:59 +0000)]
fixed cvs to compile again

19 years agoeq
kojima [Fri, 11 Mar 2005 21:51:49 +0000 (11 21:51 +0000)]
eq

19 years agoupdated changelog
dan [Fri, 11 Mar 2005 21:40:51 +0000 (11 21:40 +0000)]
updated changelog

19 years agoapplied patch to rename .AppInfo directory
kojima [Fri, 11 Mar 2005 01:58:55 +0000 (11 01:58 +0000)]
applied patch to rename .AppInfo directory

19 years agoapplied patch to use more gnustepish paths for some internal data files
kojima [Fri, 11 Mar 2005 01:56:06 +0000 (11 01:56 +0000)]
applied patch to use more gnustepish paths for some internal data files

19 years ago- Fixed a few typos
dan [Fri, 4 Mar 2005 23:47:09 +0000 (4 23:47 +0000)]
- Fixed a few typos
- Added new italian translation (Marco Colombo <m.colombo@ed.ac.uk>)

19 years ago- Fixed compilation include path issue in wrlib/tests
dan [Wed, 2 Mar 2005 10:59:40 +0000 (2 10:59 +0000)]
- Fixed compilation include path issue in wrlib/tests
- Removed unnecessary included headers (we don't use Xt)

19 years agoFixed crash when removing submenus in WPrefs' menu editor.
dan [Sun, 20 Feb 2005 04:36:57 +0000 (20 04:36 +0000)]
Fixed crash when removing submenus in WPrefs' menu editor.

The submenu widget was free'd twice (once by destroyEditMenuItem() and a
second time by destroyEditMenu())

19 years agoupdated chinese translations
dan [Fri, 21 Jan 2005 04:05:48 +0000 (21 04:05 +0000)]
updated chinese translations

19 years ago- better checks if the icon sizes are valid and there is enough data to
dan [Sat, 8 Jan 2005 22:53:39 +0000 (8 22:53 +0000)]
- better checks if the icon sizes are valid and there is enough data to
  build the image from _NET_WM_ICON
- properly read the icon's pixels from _NET_WM_ICON, so they won't depend
  on machine endianess.

19 years agofix for broken 'make install' introduced by previous commit
dan [Thu, 6 Jan 2005 15:55:46 +0000 (6 15:55 +0000)]
fix for broken 'make install' introduced by previous commit

19 years agofix to allow parallel builds on SMP systems using make -j
dan [Thu, 6 Jan 2005 15:48:42 +0000 (6 15:48 +0000)]
fix to allow parallel builds on SMP systems using make -j

19 years agofixed issue with path assignment
dan [Sun, 14 Nov 2004 00:11:20 +0000 (14 00:11 +0000)]
fixed issue with path assignment

19 years ago- fixed possible crash bug because a variable allocated on stack was
dan [Thu, 11 Nov 2004 14:14:52 +0000 (11 14:14 +0000)]
- fixed possible crash bug because a variable allocated on stack was
  returned by a function
- removed obsolete macro

19 years agofixed bug with infinite loop in some circumstances in fitText() in WINGs
dan [Sat, 6 Nov 2004 20:20:05 +0000 (6 20:20 +0000)]
fixed bug with infinite loop in some circumstances in fitText() in WINGs

19 years agoRemoved --with-appsdir option and replaced it with --with-gnustepdir. Also,
kojima [Mon, 1 Nov 2004 00:50:19 +0000 (1 00:50 +0000)]
Removed --with-appsdir option and replaced it with --with-gnustepdir. Also,
default installation path (for non GNUstep users) is now $(prefix)/bin

19 years agoDetect if gcc is able to compile x86 asm and if it supports passing more
dan [Sun, 31 Oct 2004 05:33:39 +0000 (31 05:33 +0000)]
Detect if gcc is able to compile x86 asm and if it supports passing more
than 10 parameters in inline asm, else disable asm code.
This should enable it to work on any x86 platform (not just linux as before)
given that a recent enough gcc is available (no more need to guess by looking
at $host)

This should also fix the issues of compiling wrlib with gcc-2.95

19 years agobetter text alignment
dan [Sun, 31 Oct 2004 01:47:43 +0000 (31 01:47 +0000)]
better text alignment

19 years agofixed some compilation issues with gcc-2.9x
dan [Sun, 31 Oct 2004 00:57:25 +0000 (31 00:57 +0000)]
fixed some compilation issues with gcc-2.9x

19 years agofixed another spot where compiling on solaris with openwin generated errors
dan [Sat, 30 Oct 2004 07:17:49 +0000 (30 07:17 +0000)]
fixed another spot where compiling on solaris with openwin generated errors

19 years agoattempt to fix compilation on solaris with openwin
dan [Sat, 30 Oct 2004 06:39:27 +0000 (30 06:39 +0000)]
attempt to fix compilation on solaris with openwin