1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
Commit Graph

201 Commits

Author SHA1 Message Date
Carlos R. Mafra
3c323e1e9a 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.
2008-11-09 20:18:05 +01:00
Carlos R. Mafra
06f59b9928 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
2008-11-06 09:07:50 +01: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
33f7b63d11 - 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)
2005-04-08 11:51:06 +00:00
dan
24519b6292 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.
2005-03-12 01:16:04 +00:00
dan
fe381eca77 - Fixed a few typos
- Added new italian translation (Marco Colombo <m.colombo@ed.ac.uk>)
2005-03-04 23:47:09 +00:00
kojima
d63a0b4859 added option to disable switchpanel
fixed some bugs
2004-10-27 02:54:32 +00:00
kojima
087a16400f updated Makefiles files for po dirs 2004-10-26 01:11:15 +00:00
kojima
f274afdd1d added themable, pixmap background switch panel 2004-10-25 00:07:51 +00:00
dan
e3c67d55de - replaced VirtualEdgeThickness option with EnableVirtualDesktop (boolean)
- some code cleanups in the virtual desktop.
2004-10-24 22:45:06 +00:00
dan
8bf6071c48 limit VirtualEdgeThickness values to the 0..10 range 2004-10-24 21:39:56 +00:00
kojima
620a280d64 code review 2004-10-22 23:39:11 +00:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +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
dan
8457611316 fixes to comply to ANSI C 2003-07-16 20:58:49 +00:00
kojima
2cf5931890 fixed silly typo in workspace.c
added system wide menu configuration
2003-06-06 02:51:47 +00:00
dan
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan
dd1ccd2fd6 - enabled the use of SHAPE extension in the color panel. without it the
magnifying glass captured image was shifted and unusable
- removed some comments left in the code for later reviewal
2002-12-01 05:49:13 +00:00
dan
4f80ec9178 - removed unnecessary include of WINGsP.h in some places
- smaller space between rows of text in WMText
2002-11-04 20:29:47 +00:00
dan
7be0a97998 - More cleanups for obsoleted xxx_gc's and xxx_pixel's in WScreen 2002-10-18 04:04:41 +00:00
dan
3bed15d673 - fixes for AA fonts
- fixed the workspace name display problem.
- replaced most of scr->xxx_pixel with scr->xxx_color
- removed some obsoleted GC's in the WScreen structure
2002-10-17 20:26:30 +00:00
dan
a2b404b5b3 - API change in WINGs for WMDraw*String().
WMDrawString() and WMDrawImageString() now take WMColor instead of GC as
  arguments. WMDrawImageString() receives 2 colors (text & background).
  This is to allow easy extension for Xft/Xrender and hide X low level details
- Added alpha channel to WMColor. 2 new functions also:
  WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Removed obsoleted acconfig.h and implemented its functionality using
  AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
  This will definitely enforce the need to use autoconf 2.5x
2002-10-08 08:26:06 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
  have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
2002-01-04 07:32:37 +00:00
dan
96f8ab167f Added "Hide Others" to the window menu 2002-01-04 05:44:20 +00:00
dan
520a6cd0e4 a fix for the definable cursor code 2001-12-21 11:00:45 +00:00
dan
e1ed96951b fixed bug with improper setting of root/titlebar cursor (definable cursors) 2001-12-20 22:31:13 +00:00
dan
41996df786 - Saving a domain file will first strip all entries that are also present in
the global domain as well and are exactly the same. This fixes a bug where
  settings from the global domain file were merged in the user domain file
  and further changes in the global domain file for those merged values was
  ignored making a system admin unable to set global defaults for all users
  using the global domains.
- Fixed bug with not extracting the icon from the client when using
  shared appicons.
- Added WMSubtractPLDictionaries() to WINGs (opposite for merging, it will
  remove all entries from dest if they are present in source and are exactly
  the same. Unique entries in dest and entries with different values from
  those present in source will be preserved).
2001-12-20 22:16:01 +00:00
dan
90c77b1a45 - improved behaviour for the shared appicon thing.
- added a 'Bool recursive' flag to WMMergePLDictionaries() in WINGs
2001-12-17 14:46:31 +00:00
dan
06b48596f5 - made the definable cursors feature available by default (removed the
compile time option)
2001-11-23 05:39:13 +00:00
dan
33cc542e85 - Finished moving to the new proplist handling code in WINGs.
- Also tested the backward compatibility ability of the WINGs proplist code
  which seems to work quite well.

Starting with this moment, Window Maker no longer needs libPropList and is
now using the better and much more robust proplist code from WINGs. Also the
WINGs based proplist code is actively maintained while the old libPropList
code is practically dead and flawed by the fact that it borrowed concepts
from the UserDefaults which conflicted with the retain/release mechanism,
making some problems that libPropList had, practically unsolvable without a
complete redesign (which can be found in the more robust WINGs code).
2001-10-04 03:07:34 +00:00
dan
e44cc81a03 definable cursor code updates from Jim Knoble <jmknoble@pobox.com> 2001-09-06 09:42:51 +00:00
kojima
882b9a8e1c - s/sprintf/snprintf
- updated some po's
- fixed crash bug when removing WINDOWS_MENU or WORKSPACE_MENU from rootmenu
- some other stuff i forgot
2001-07-23 20:31:32 +00:00
kojima
d6feaa1c75 added None option to MoveDisplay and ResizeDisplay
fixed window instance enumeration bug
2001-06-06 19:48:31 +00:00
kojima
b444894d88 finished removing focusfollowmouse from wprefs 2001-05-14 15:18:30 +00:00
kojima
205b3f35b9 removed FocusFollowMouse 2001-05-14 14:58:55 +00:00
dan
ab61c599f9 a small update 2001-05-13 23:22:21 +00:00
dan
ddde229665 - fixed speckles (white dots) on dithered images (bug still present on the
PowerPC architecture, because on LinuxPPC char is unsigned by default, not
  signed like on the other platforms).
  Bug fixed by Philip Derrin <philipd@student.unsw.edu.au>
- miscelaneous bug fixes

We would like people with cvs access experimenting the white 'speckles' on
images to test if they still have the problem.
2001-05-10 00:16:28 +00:00
dan
3bde6495a3 - Removed the following 3 options from configuration: SelectWindowsMouseButton,
WindowListMouseButton and ApplicationMenuMouseButton.
- Added 4 options to the configuration file for binding workspace actions to
  mouse buttons: MouseLeftButtonAction, MouseMiddleButtonAction,
  MouseRightButtonAction and MouseWheelAction. They replace the above 3
  removed options, but use a different semantic.
- mouse wheel action is runtime configurable now.

Read details about this in NEWS.
2001-04-27 23:41:17 +00:00
dan
36e46831e0 For libwraster:
---------------

- Added retain/release mechanism to RImage by adding RRetainImage() and
  RReleaseImage(). RDestroyImage() is an alias to RReleaseImage() now, but
  will be removed in a future release because it no longer fits with the
  semantics. Will be kept for a while to allow a smoother transition.
  More about in wrlib/NEWS


For WINGs:
----------

- Small API change:
  1. Renamed WMSetApplicationIconImage(), WMGetApplicationIconImage() and
     WMSetWindowMiniwindowImage() to respectively WMSetApplicationIconPixmap(),
     WMGetApplicationIconPixmap() and WMSetWindowMiniwindowPixmap()
     They operate on a WMPixmap which is practically an X Pixmap with no alpha
     channel information and the new name is more suggestive and also leaves
     room for the new functions added for operating on images with alpha info.
  2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
     operate on an RImage and store alpha information too.
  3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
     alpha set by WMSetApplicationIconImage() and will blend it with a color.
     If color is NULL it will blend using the default panel color (#aeaaae)
  All these changes will allow WINGs to handle images with alpha blending
  correctly in panels and wherever else needed. More about in WINGs/NEWS.
- updated panels to use the newly available RImages if present and fallback
  to old WMPixmaps if not, to properly show alpha blended images.
- replaced some still left malloc's with wmalloc's.


For Window Maker:
-----------------
- Fixed wrong mapping position of the "Docked Applications Panel" for some
  icons.
- Smoother animation for the smiley =)
- Made images with alpha blending be shown correctly in the panels and the
  icon chooser.
- The icon image set to be shown in panels ("Logo.WMPanel") will be
  automatically updated if its entry in WMWindowAttributes changes (without
  a need to restart as until now).


*** Note!!! ***

If you are developing applications with one of libwraster or libWINGs
then you should look to wrlib/NEWS and WINGs/NEWS to see what changed
and how should you update your code.
2001-04-21 07:12:21 +00:00
id
03824d5324 allow to scroll the virtual desktop further than the desktop geometry. 2001-04-18 22:12:20 +00:00
id
829e9d30fe add an option to virtual desktop 2001-04-18 22:08:34 +00:00
dan
9035122c5f - Now when Window Maker calls wmsetbg to set the background, it will pass the
correct switch to it, depending on the value of the DisableDithering option.
- Replaced some functions with macros in WINGs (wmkpoint(), wmksize() and
  wmkrange()). They're less expensive to call this way.
- Fixed a memleak in the info panel.
2001-04-09 23:43:09 +00:00
dan
a20aebdef2 - Made all changes for moving WINGs headers in the WINGs subdirectory.
- Updated get-{wings|wutil}-flags accordingly
2001-01-18 19:21:56 +00:00
id
bb7314ddac remove plugin 2001-01-06 18:59:12 +00:00
id
8fb5a4c7fe remove drawstring plugins 2001-01-06 18:54:15 +00:00
id
8ca4a67a24 changes related to plugin system & drawstring 2000-12-11 03:10:26 +00:00
id
0e34a7ae28 fix solid color when using plugin. 2000-12-09 01:23:18 +00:00
id
756ab2c019 pass texture to plugin so it doesn't have to grab from title bar.
add experiment plugin support to menu entry, performance need to
be improved. I'm thinking of making a compressed expose event geometry.
2000-12-06 16:34:58 +00:00
id
1752587a4a Make draw string plugin more extendable in future. 2000-11-30 15:32:19 +00:00
id
331e85fd85 destroyDrawString 2000-11-30 00:26:59 +00:00