1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 06:38:05 +01:00
Commit Graph

1048 Commits

Author SHA1 Message Date
Carlos R. Mafra
ee28b0257a 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>
2008-05-02 20:23:00 -03:00
Carlos R. Mafra
722c82c8ab 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>
2008-05-02 20:01:50 -03:00
dan
ecd5217633 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.
2006-04-27 02:48:18 +00:00
dan
577b3ee949 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
2006-04-26 20:28:24 +00:00
dan
bc4de88d8b 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.
2006-04-25 23:52:43 +00:00
dan
90c0e656f1 replaced windowmaker.org with windowmaker.info everywhere 2006-04-25 19:35:14 +00:00
dan
085e9d6254 - 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>)
2006-01-22 20:33:19 +00:00
dan
bacf8229b0 - 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>)
2006-01-22 18:19:09 +00:00
dan
054f954390 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
2006-01-22 15:53:44 +00:00
dan
c0317ddae5 eliminated gcc-4 compilation warnings 2005-08-22 23:58:19 +00:00
dan
d26f18505a Fixed WPrefs.app to find its icons when not installed under GNUstep paths 2005-07-17 19:16:46 +00:00
dan
f3a960d9d8 updated german translations 2005-07-05 19:41:06 +00:00
dan
eca635cb5d - 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
2005-07-03 00:49:06 +00:00
kojima
3301b57d4b applied patch to use more gnustepish paths for some internal data files 2005-03-11 01:56:06 +00:00
dan
9f89695c48 fixed bug with infinite loop in some circumstances in fitText() in WINGs 2004-11-06 20:20:05 +00:00
dan
e9e1186f1d attempt to fix compilation on solaris with openwin 2004-10-30 06:39:27 +00:00
dan
558615a853 Changed the order some header files are loaded, as it seems to cause havoc
on some platforms
2004-10-30 05:46:37 +00:00
dan
ca61675597 added preliminary X Input Methods support 2004-10-28 04:17:18 +00:00
kojima
ac87ca5596 updated japanese translations (Takeo Hashimoto <HashimotoTakeo@mac.com>) 2004-10-26 20:03:06 +00:00
kojima
5f3c54af13 fixed several po files 2004-10-26 03:44:08 +00:00
dan
d8862b0bdf fixed some bugs 2004-10-26 03:40:44 +00:00
kojima
bbd1e5dada fixed some bugs 2004-10-26 03:03:02 +00:00
dan
b89f3e6df5 fixed animation speed issues with 2.6.x linux kernels 2004-10-25 22:15:57 +00:00
kojima
f274afdd1d added themable, pixmap background switch panel 2004-10-25 00:07:51 +00:00
dan
67a9ea74a3 - Fixed wrong call to XChangeProperty() when setting _NET_WM_ICON
- Changed the WPrefs icons with Largo's version
- Replaced Apps with Application in the docs
2004-10-24 03:20:29 +00:00
kojima
7401a1329f free 2004-10-23 21:09:56 +00:00
kojima
df1228f387 added some netwm support in WINGs 2004-10-23 21:07:13 +00:00
dan
193a63511d - Fixed all // comments
- Final cleanups
2004-10-23 03:30:03 +00:00
dan
51c2edf868 Cleaned up some documentation 2004-10-23 02:26:13 +00:00
kojima
620a280d64 code review 2004-10-22 23:39:11 +00:00
dan
4bda625076 - Simplified font conversion a bit, as fontconfig does the job of getting
the closest match for us
- Removed wsetfont. No longer needed.
2004-10-22 23:19:37 +00:00
dan
d08691d5a5 - Changed fallback font to 'sans serif:pixelsize=12'
- Fixed convertfonts to account for $LANG
- Fixed convertfonts logic a bit and no longer output slant and weight if
  they are the default ones (medium and roman)
- Applied Pascal's fix for GNUstep menus (modified to also include submenus)
  Still this is not the proper fix, as it can't differentiate between
  submenus and other windows at the floating window level. Correct fix needs
  some extra hints to be set by GNUstep on menus.
2004-10-22 22:27:11 +00:00
dan
08e811aae7 - If fonts are specified as xlfd, convert to fc names before creating them.
This was we internally only deal with fc names and properties. It will
  incur a small performance hit as the font needs to be parsed/unparsed,
  but this is only for backward-compatibility to support old xlfd names.
  People are encouraged to swtich to fontconfig names.
- WINGs no longer adds sans as a fallback for internal fonts. It is
  automatically done by fontconfig (if it can't find the requested font
  it will use the closest match which is the default font: sans-serif)
- Added code to honor the AntialiasesText global option
- Fixed style names for WMCopyFontWithStyle()
- Added fonts in style files where they were missing. Also changed some
  fonts to better defaults.
2004-10-22 00:21:51 +00:00
dan
59d2a5cbe5 - Use Applications instead of Apps for the application's path 2004-10-19 03:50:41 +00:00
dan
737328566f Tell gettext that we want to have the messages in the UTF-8 encoding, to
avoid the extra conversion that gettext would otherwise perform (from the
message encoding which is UTF-8 to the current locale encoding).
2004-10-17 07:17:03 +00:00
dan
6cfad0b10f - Removed obsoleted options from WMGLOBAL and from the WINGs internal
structures (no longer needed with xft)
- Fixed default system font names (converted from xlfd to fontconfig names)
- A bit of code cleanups related to xft
- Replaced harcoded xlfd font names in wmaker and WPrefs with fontconfig
  names.
2004-10-17 06:27:51 +00:00
kojima
7929d55f3f set charset to utf-8 2004-10-17 05:05:57 +00:00
kojima
1f12617065 converted menu and po files to utf-8 2004-10-17 04:32:25 +00:00
dan
0c09179f01 - Removed support for legacy systems: OpenLook, KDE-2.x, Gnome-1.x
- Removed #define and #ifdef XFT constructs, as XFT is on all the time
2004-10-14 23:05:20 +00:00
kojima
2b51c21ee5 use macros for property names 2004-10-13 23:48:58 +00:00
kojima
3ed1d3e25c added Font Configuration
updated some outdated default config files
2004-10-13 23:39:29 +00:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +00:00
kojima
d211420261 moved -fno-strict-aliasing flag to configure, so it only adds that for gcc
s/__asm__/asm/ (we don't care about being ansi for the asm code)
2004-10-12 02:13:15 +00:00
dan
9aca0d5f6e - Check whether libXft is at least version 2.1.2 else refuse to compile.
- Fixed bug in icon chooser dialog that could cause a segmentation fault
  in some cases (Pascal Hofstee <caelian@gmail.com>)
- Fixed crash in asm code in wrlib, with new versions of gcc.
- Fixed bug in the x86_PseudoColor_32_to_8() function which incorrectly
  used the r, g, b fields in the conversion.
- Fixed x86 ASM code in wrlib to work on 64 bit architectures.
- Fixed the focus flicker seen with some apps (notably gtk2)
  (Alexey Spiridonov <snarkmaster@gmail.com>)
- Fixed all crashing bugs that were generated by wmaker starting with the
  WMState file missing.
- Added NetWM support (a modified version of the patch originaly written
  by Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied patch to enhance the Virtual Desktop behaviour, and to integrate
  it with the NetWM code (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied a few xinerama and placement fixes (Peter Zijlstra
    <a.p.zijlstra@chello.nl>)
- Fixed memory leak in dock code.
- Fixed and enhanced the text wrapping in WINGs.
- Fixed the layout of some elements in WPrefs.app
- Added workaround for aplications that don't set the required hints on the
  client leader window, but they set them on normal windows (observer with
  KDE 3.3.0 mainly). This will allow these apps to get an appicon again.
  (they should be fixed still)
- Added workaround for applications that do not set a command with
  XSetCommand(), but instead they set the _NET_WM_PID property. This works
  with operating systems that offer a /proc interface similar to what linux
  has. (This also is to fix problems with KDE 3.3.0 apps, but not only them).
- Fixed bug with autostart and exit scripts not being executed if user
  GNUstep path was different from ~/GNUstep (when setting GNUSTEP_USER_ROOT)
- Added utf8 support in WINGs (removed old X core font code)
- Added utility to convert old font names to new font names in style files
2004-10-12 01:34:32 +00:00
kojima
95897acc30 added a quick&dirty standalone colorpicker utility 2004-08-24 19:27:45 +00:00
dan
474c4caf94 reverted the last test commit (duh) 2004-07-16 18:50:58 +00:00
dan
109bb540ec another test for cvs notifications 2004-07-16 18:18:36 +00:00
dan
b8193865f6 Added forgotten dragcommon.c to the cvs tree 2004-04-07 10:15:52 +00:00
dan
e7d0c5d9e9 - Added xdnd v3 support in WINGs (Sylvain Reynal <sreynal@nerim.net>)
- CVS should compile again
2004-04-07 02:50:52 +00:00
dan
791bb6a444 replaced CPPFLAGS with AM_CPPFLAGS in some Makefile.am's to avoid overwriting the user's CPPFLAGS environment variable 2004-02-25 21:26:49 +00:00