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

wmaker: Created a global structure to regroup all global variables

Having all the global variables at the same place will provide
better visibility on the code; grouping them in a structure
reduces the risk for name clash; it also offer the possibility
to organise them.

Another BIG benefit is that, when reading the code, an access to
a global variable will now be clearly visible, and distinguished
from a local variable use.
This commit is contained in:
Christophe CURIS
2013-09-29 17:09:55 +02:00
committed by Carlos R. Mafra
parent 70c6494c46
commit 3892f3220a
2 changed files with 23 additions and 12 deletions

View File

@@ -64,6 +64,7 @@
#endif
/****** Global Variables ******/
struct wmaker_global_variables w_global;
/* general info */
@@ -145,8 +146,6 @@ int wXkbEventBase;
#endif
/* special flags */
wprog_state WProgramSigState = 0;
wprog_state WProgramState = WSTATE_NORMAL;
char WDelayedActionSet = 0;
/* notifications */
@@ -596,6 +595,10 @@ int main(int argc, char **argv)
int i_am_the_monitor, i, len;
char *str, *alt;
memset(&w_global, 0, sizeof(w_global));
w_global.program.state = WSTATE_NORMAL;
w_global.program.signal_state = WSTATE_NORMAL;
/* setup common stuff for the monitor and wmaker itself */
WMInitializeApplication("WindowMaker", &argc, argv);