1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00
Commit Graph

103 Commits

Author SHA1 Message Date
Christophe CURIS
74cd836e48 wmaker: Replaced local 'extern' definition of wPreferences by proper header usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-30 15:10:09 +01:00
Christophe CURIS
9b5db31d95 wmaker: Added 'const' attribute to most global functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
6dda67bc51 wmaker: Added attribute 'noreturn' to appropriate functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-09 18:46:56 +01:00
Rodolfo García Peñas (kix)
5455a585dc funcs.h removed
The file funcs.h is removed. A new file osdep.h is created to hold
the definition for all osdep_*c files.

The files .c has been adjusted to include the right header files,
removing funcs.h, including osdep.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
20a695f70f New header file monitor.h
The file monitor.h includes the function prototypes for monitor.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
157209a035 New header file event.h
The file event.h includes the function prototypes for event.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
68cdba0e29 New header file startup.h
The file startup.h includes the function prototypes for startup.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Christophe CURIS
d517d5cac0 wmaker: Cleaned dangerous function prototype usage
- remove extern declaration in source file, use header instead

- add inclusion of header defining the functions of the file to
get the compiler to cross-check them

- marked static the functions that should not be visible ouside
their file
2013-05-12 01:01:20 +01:00
Christophe CURIS
a3281b1e89 src/main.c: Moved local prototype for global function to header 'funcs.h'
It is a bad idea to declare the prototype of an external function
in a file as it won't allow the compiler to cross-check it.
2013-05-12 01:01:19 +01:00
Daniel Déchelotte
e14e6b3da8 Add drawers to wmaker!
Drawers are horizontal docks, and they can themselves only live in the dock

To use them, right click on the dock or a docked appicon and select "Add
a drawer". Then move appicons into the drawer (drag them with the
mouse). You may change the icon of the drawer. By default, drawers
auto-expand and -collapse, and auto-raise/lower. This can be customized
in the same way as for the clip.

Set DisableDrawers to YES in G/D/WindowMaker if you do not want to see
the menu entry to add a drawer.

Just discovered this bug: the auto-attract icon functionality will not
work (to be precise, it crashes WM!) if the clip is disabled
(NoClip=YES). Will fix shortly, of course.
2013-04-12 02:14:10 +01:00
Rodolfo García Peñas (kix)
68208a01a0 New shutdown.h file
The new shutdown.h file includes the shutdown modes and the functions
to shutdown Window Maker.

The function definitios were moved from funcs.h and the struct WShutdownMode
from WindowMaker.h.

Now, externs are not needed, only include shutdown.h
2013-01-12 14:37:31 +00:00
Rodolfo García Peñas (kix)
b71f2c30fd Removed XRANDR externs
This patch moves the XRANDR variable definitions to screen.h, because
xrandr is related to screen behavior. Then, the definition externs
can be removed.

This patch also changes (in event.c) the ConfigureNotify event processing
to avoid call the "if" block if XRANDR is not enabled. I chose the option of
move the if into the HAVE_XRANDR block instead of include the
ConfigureNotify case inside of the HAVE_XRANDR block (proposed by
BALATON Zoltan) to avoid call the default option if not needed.
2013-01-12 13:10:29 +00:00
Rodolfo García Peñas (kix)
4111f336d0 create_stdcmap is never used
The create_stdcmap variable is never set, so can be removed.

This patch don't update the translation .po files!
2012-11-18 23:40:12 +01:00
Christophe CURIS
139f912e61 Remove dependency to CPP: removed stuff related to CPP calls
Now that the built-in parser has support for all the feature of CPP
being used by WindowMaker's default menu, we can remove the stuff
related to calling CPP:
 - code for preparing and running CPP;
 - compile-time option to de-activate the call to CPP;
 - command-line option
2012-07-14 20:22:21 +02:00
Rodolfo García Peñas (kix)
6bdc1318c1 Moving header functions to main.h
The functions of main.c should be included in main.h, not in funcs.h.
This patch adds the main.h file and moves the function prototypes to
this file.

The not needed "include funcs.h" are removed.
2012-06-24 12:32:36 +01:00
Rodolfo García Peñas (kix)
761fd37e51 WindowMaker: Clean curly brackets
This patch removes the unneeded curly brackets in multiple files.

It also add some comments in the code. In usermenu.c removes some
variables not used.
2012-04-15 23:15:20 -03:00
Iain Patterson
bca60318ca Compiler diet.
Don't feed the compiler.  RelaunchWindow() is declared to return Bool so
Bool it shall proudly return.
2012-04-11 23:55:58 +01:00
Iain Patterson
0601e0f002 Style consistency.
Approved style is not to write a single-operation for loop in a single line.
2012-04-11 23:55:47 +01:00
Iain Patterson
aaf934eb2f Compiler food.
main.c: In function ‘RelaunchWindow’:
main.c:461:1: warning: control reaches end of non-void function
[-Wreturn-type]

Actually we can't reach the end of the function because the three
possible cases are Exit(-1), return False and return True.  Of course if
Exit() were ever changed the above statement might become incorrect.
Some compiler food silences the warning.
2012-04-04 13:02:58 +01:00
Iain Patterson
8352c9ef60 Allow relaunch with shortcut key.
Use the WindowRelaunchKey shortcut to examine the WM_COMMAND property of
the active application's main window and launch a new instance of the
application using the retrieved command line.
2012-04-04 12:12:12 +01:00
Rodolfo García Peñas (kix)
a2c297e6a7 Remove unused variables 2012-01-28 14:54:07 +00:00
Tamas TEVESZ
f65b99e615 Remove warnings
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
  to be tweaked on a per-implementation basis as problems arise)
2011-03-24 16:19:52 +01:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Tamas TEVESZ
94a0c7b42f Fix some double newlines
Just a couple that woud now print double (or several more) newlines.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Tamas TEVESZ
1f21919809 Remove wsyserrorwithcode, rename wsyserror to werror
wsyserrorwithcode - Not used, no point either.
wsyserror->werror - qualifying "error" with a "type" hardly makes
sense if there are not at least two "type"s. There are not. Safe trip.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Alexey I. Froloff
ca1c29cd98 Menu translation support
When generating menus, lookup translations for menu entries in
specified textdomain.  Often used by linux distributions.

Original-patch-by: Alexey Voinov <voins@altlinux.ru>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-11 15:28:01 +02:00
Carlos R. Mafra
b17077ede0 Avoid more gcc warnings
WUtil.h:212: warning: function declaration isn’t a prototype
WUtil.h:259: warning: function declaration isn’t a prototype
WUtil.h:300: warning: function declaration isn’t a prototype
WINGsP.h:593: warning: function declaration isn’t a prototype
WINGsP.h:599: warning: function declaration isn’t a prototype
WINGs.h:616: warning: function declaration isn’t a prototype

raster.c:295: warning: no previous prototype for ‘calculateCombineArea’
2010-08-29 14:55:14 +02:00
Carlos R. Mafra
c201e1612c Make wmaker XRandR aware
This patch makes wmaker automatically Restart() to take into account
resolution changes done by xrandr.

The motivation to write this patch is that when I start my laptop connected
to an external monitor (VGA1), the resolution in the monitor is initially
wrong (perhaps this is a bug in XOrg or OpenSuse, but anyway), so I always
do this after starting wmaker:

xrandr --output VGA1 --preferred

The resolution in the external monitor gets fixed, but wmaker does not
recognize the change automatically and I have to manually restart it.

So this patch avoids the last step by making wmaker be XRandR-aware.
Wmaker now restarts automatically when it receives a RRChangeScreenNotify
event and I don't have to do the last part of the silly procedure described
above.

I am not sure if restarting wmaker is the most elegant solution, but
it at least solves part of my issue with wmaker + xrandr.
2010-08-22 22:13:45 +02:00
Tamas TEVESZ
c7868fa405 Make inotify optional
This time keeping the ability to fall back to the old polling method.
2010-03-23 21:50:17 +01:00
Carlos R. Mafra
5178465bb6 Remove DEBUG statements, #if 0 etc
...and some other cleanups.
2010-03-20 18:42:56 +01:00
Carlos R. Mafra
e1d5ce7a51 Cleanup includes of wcore.h, defaults.h and pixmap.h
Several files were including others for no reason, and this slows
down the build time (but probably not measurable on a fast machine).
2010-03-17 11:12:53 +01:00
Carlos R. Mafra
024e2f5299 Remove XSMP_ENABLED constructs
The code was never used and the !XSMP_ENABLED code seems to
work well enough for all these years.
2009-12-21 22:40:28 +01:00
Ralf Hoffmann
629b118767 fixed problem with default visual ID for multi-screen setups by using multiple IDs for each screen
Since a single default visual ID cannot be used for multiple screens, thus
Window Maker refused to start. There is now a global function for getting the
default visual ID. The command line argument --visual-id can be a comma
separated list of visual IDs for each screen. A default value is only set for
the first screen.
2009-12-11 16:36:25 +01:00
Martin Dietze
3f6ae395ce Add GLOBAL_DEFAULTS_SUBDIR and fix a syntax error in wmlib/Makefile.am 2009-08-24 11:55:20 +02:00
Daniel Déchelotte
3f7110b120 Fix focus issues with the switch panel and auto-focus
1. Setup two windows in a workspace, one at the center and the
   other at a corner. Move the mouse to the center of the screen, so
   that the focus goes to the center window. Now, with the help of the
   keyboard (with Alt-tab, typically), try and switch the focus to the
   other window. In doing so, the switch panel shows up, gives the
   focus to the other window and then disappears. However, its
   disappearance make it seem to wmaker that the mouse has just
   entered the center window, so wmaker gives the focus to that
   window again.

   2. It is a lit bit more involved. "Raise window when switching
   focus with keyboard" needs to be set. In a given workspace, maximize
   a first window A, then setup "above" window A two windows B and C
   (one in the upper left corner and the other one in the lower right
   corner, for example). Move the mouse so as to give the focus to
   window B. Press the Alt key, hit the key tab once (window A moves
   up to the "top"), then another time (window C is then selected).
   Eventually relase the Alt key: window B is given the focus again.

Correction: it is a matter of ignoring some (EnterNotify) events
when the switch panel is active or has just been used.
2009-08-20 22:07:10 +02:00
Carlos R. Mafra
688a56e8ab 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 :-)
2009-08-20 00:59:40 +02:00
Carlos R. Mafra
be0d694dc2 real_main: Use setenv() instead of putenv() in remaining places
It simplifies the code a bit.
2009-08-17 22:42:38 +02:00
Carlos R. Mafra
6310e40d47 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.
2009-08-17 22:19:58 +02:00
Carlos R. Mafra
09a8911b6f Remove unused variables
GCC -Wall complains about them.
2009-08-17 17:35:48 +02:00
John H. Robinson, IV
38074e7bd5 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
2009-08-16 00:35:54 +02:00
Carlos R. Mafra
0c469de04f 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'
2008-11-10 01:42:50 +01:00
Rodney Padgett
56d8568787 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.
2008-08-09 13:14:39 -05:00
Paulo Cesar Pereira de Andrade
e4800e84d0 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.
2008-05-03 20:02:31 -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
0d9b73cd74 - Fixed issues with crashing dialog not working
- Keep menu and title text at 12px since there is not constrained by width
- Removed some obsoleted options from wconfig.h
- Added a lighter image for the switch panel
2004-10-25 02:23:41 +00:00
kojima
f6682a9ade fixed bugs, re-enabled circulate raise 2004-10-20 03:31:14 +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
kojima
8502709884 fixed cmdline option duplication bug 2004-10-14 19:53:31 +00:00
kojima
3ed1d3e25c added Font Configuration
updated some outdated default config files
2004-10-13 23:39:29 +00:00
kojima
879b00a57b - Removed legacy OFFIX_DND support code
- Fixed the signal handler for crashes (ie, removed it) and made wmaker
  restarting be made automatically by a monitoring process.
- Made NetWM support be enabled by default
- Removed old code to store/restore workspace state (now relies on netwm)
2004-10-13 05:09:08 +00:00