This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project wmaker-crm.git.
The branch, next has been updated via b190ab4b5ea9e3e3c7236f4146a5ff76dd2ac153 (commit) via 86fea0978f0c20a6b3379d40f84a4ed3be134e75 (commit) via 2a4750b049ec198bb3789dff1c93098119d7ba80 (commit) via d606df893eb74e78b0e12346629e2f5e65d67336 (commit) via 06d96ed18fc0bcadd9bb521e929acb2a970548cf (commit) via 6f318e86f36bfa11535c0102225b8c575e61e2c5 (commit) via 855544626f1a8d7174d5798713c2e7e4460d979e (commit) via a4713cbb4d49b1b59eb5282e0c97554a7efe50e2 (commit) from 252bd7359bcc2c686a4c6bb96e8875f302e21dbd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://repo.or.cz/w/wmaker-crm.git/commit/b190ab4b5ea9e3e3c7236f4146a5ff76dd2ac153 commit b190ab4b5ea9e3e3c7236f4146a5ff76dd2ac153 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:22 2014 +0100 WPrefs: fix icon used in the Opaque/Non-opaque Move setting Apparently, some pixels from the close button on the window image were missing from the Non-opaque image, they have been added in the XPM file which was then converted to TIFF with ImageMagick's command: convert -depth 8 -compress lzw xpm/nonopaque.xpm tiff/nonopaque.tiff to have a file similar to what was there before Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/WPrefs.app/tiff/nonopaque.tiff b/WPrefs.app/tiff/nonopaque.tiff index 5d11957a..6cadf983 100644 Binary files a/WPrefs.app/tiff/nonopaque.tiff and b/WPrefs.app/tiff/nonopaque.tiff differ diff --git a/WPrefs.app/xpm/nonopaque.xpm b/WPrefs.app/xpm/nonopaque.xpm index 0ec95b3f..696a0b3a 100644 --- a/WPrefs.app/xpm/nonopaque.xpm +++ b/WPrefs.app/xpm/nonopaque.xpm @@ -117,9 +117,9 @@ static char * image_name[] = { " . O O O O O g i = y u > : = = = = h j q h u 1 O O O O O O < . . ", " . O O . O O 1 : 0 4 q w e = = = k + < h = % l z 1 O O O 5 w . . ", " . O O . O O . x * 8 9 c 7 7 v 7 @ b n m 7 7 7 M 6 . . . . c N . . . X . . . . . ", -" . O O O O O . q 4 b w e = 7 v B V C Z 7 7 7 7 7 7 A . . g S c n . . X . . . O . ", +" . O O O O O . q 4 b w e = 7 v B V C Z 7 7 7 7 7 7 A . . g S c n . . X . O . O . ", " . O O . O O O o z 9 : 7 = 7 v @ C n m 7 7 7 7 7 7 6 . . D 7 F n . . X . . O . . ", -" . O O . O O . O G . i = = 7 H V C Z 7 7 7 7 7 7 m n 8 @ S 7 7 J . . X . . . O . ", +" . O O . O O . O G . i = = 7 H V C Z 7 7 7 7 7 7 m n 8 @ S 7 7 J . . X . O . O . ", " . O O O O O . O p K S 7 7 7 L C n m 7 7 7 7 7 7 Z 8 V D 7 7 7 B n . X . . . . . ", " . O O . O O O O d > P I U Y w + T U U U U U U R E > W U U U U Q ! o o o o o o o ", " . . . . . . . . . n ~ m S @ b n m 7 7 7 7 7 7 Z C V B 7 7 7 7 7 @ . . . . . . . ", http://repo.or.cz/w/wmaker-crm.git/commit/86fea0978f0c20a6b3379d40f84a4ed3be134e75 commit 86fea0978f0c20a6b3379d40f84a4ed3be134e75 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:21 2014 +0100 WPrefs: fix memory leak when storing the list of texture in Appearence panel (Coverity #50112) As pointed by Coverity, the PLStrings created to store the information on the texture leak. This is due to the fact that they are created with a refCount of 1, then the PLArray in which they are placed increments that count, so at list destruction the count would return to 1 instead of 0, meaning the PLStrings won't be freed. This patch release the PLStrings once after adding them to the PLArray so the count will go back to 1, which means they will be properly freed when the PLArray will be released. Took opportunity to remove the call to WMRetainPropList on the titem-prop because it artificially increases the refCount but this is already done when adding to the PLArray. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index c8cbc75e..276933bb 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -2207,11 +2207,16 @@ static void prepareForClose(_Panel * panel) /* store list of textures */ for (i = 8; i < WMGetListNumberOfRows(panel->texLs); i++) { + WMPropList *pl_title, *pl_path; + item = WMGetListItem(panel->texLs, i); titem = (TextureListItem *) item->clientData; - texture = WMCreatePLArray(WMCreatePLString(titem->title), - WMRetainPropList(titem->prop), WMCreatePLString(titem->path), NULL); + pl_title = WMCreatePLString(titem->title); + pl_path = WMCreatePLString(titem->path); + texture = WMCreatePLArray(pl_title, titem->prop, pl_path, NULL); + WMReleasePropList(pl_title); + WMReleasePropList(pl_path); WMAddToPLArray(textureList, texture); } http://repo.or.cz/w/wmaker-crm.git/commit/2a4750b049ec198bb3789dff1c93098119d7ba80 commit 2a4750b049ec198bb3789dff1c93098119d7ba80 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:20 2014 +0100 checkpatch: fix bug in regular expression Recent version of perl seem to report incorrect stuff in regular expression and this seems to be fixed in the kernel reference file, so this patch brings the fix to our (older) version so we won't get that spurious message when running the script. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/checkpatch.pl b/checkpatch.pl index edbfa6b1..86155bdb 100755 --- a/checkpatch.pl +++ b/checkpatch.pl @@ -1911,7 +1911,7 @@ sub process { "please, no space before tabsn" . $herevet) && $fix) { while ($fixed[$linenr - 1] =~ - s/(^+.*) {8,8}+t/$1tt/) {} + s/(^+.*) {8,8}t/$1tt/) {} while ($fixed[$linenr - 1] =~ s/(^+.*) +t/$1t/) {} } http://repo.or.cz/w/wmaker-crm.git/commit/d606df893eb74e78b0e12346629e2f5e65d67336 commit d606df893eb74e78b0e12346629e2f5e65d67336 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:19 2014 +0100 wmaker: replaced macro 'store_modifier' by an inline function, in X Modifier initialisation A macro can be a source of problems, because the compiler has no type on the arguments to make checks. Using an inline function allows to do those checks, meaning clearer error messages, it provides clear info in case of name collision, it is easier to maintain (no need for the hacky '' for multi-lines) and the scope of visibility can be controlled more easily (no need for #undef). The macro store_modifier had to face a slight change because its 2nd parameter is used as a reference, which is now clearly visible in the prototype of the function. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/src/Makefile.am b/src/Makefile.am index 8f1afbfa..78b0a75c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -140,7 +140,7 @@ misc.hack_nf.c: misc.c $(top_srcdir)/script/nested-func-to-macro.sh xmodifier.hack_nf.c: xmodifier.c $(top_srcdir)/script/nested-func-to-macro.sh $(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh $(srcdir)/xmodifier.c -o $(builddir)/xmodifier.hack_nf.c - -f "modwarn" -f "modbarf" -f "check_modifier" + -f "modwarn" -f "modbarf" -f "check_modifier" -f "store_modifier" endif diff --git a/src/xmodifier.c b/src/xmodifier.c index bc525736..2fb246c8 100644 --- a/src/xmodifier.c +++ b/src/xmodifier.c @@ -120,27 +120,6 @@ static void x_reset_modifier_mapping(Display * display) int mode_bit = 0; XModifierKeymap *x_modifier_keymap = XGetModifierMapping(display); -#define store_modifier(name,old) - if (old && old != modifier_index) - wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", - name, code, index_to_name (old), - index_to_name (modifier_index)); - if (modifier_index == ShiftMapIndex) { modbarf (name,"ModShift"); } - else if (modifier_index == LockMapIndex) { modbarf (name,"ModLock"); } - else if (modifier_index == ControlMapIndex) { modbarf (name,"ModControl"); } - else if (sym == XK_Mode_switch) - mode_bit = modifier_index; /* Mode_switch is special, see below... */ - else if (modifier_index == meta_bit && old != meta_bit) { - modwarn (name, meta_bit, "Meta"); - } else if (modifier_index == super_bit && old != super_bit) { - modwarn (name, super_bit, "Super"); - } else if (modifier_index == hyper_bit && old != hyper_bit) { - modwarn (name, hyper_bit, "Hyper"); - } else if (modifier_index == alt_bit && old != alt_bi t) { - modwarn (name, alt_bit, "Alt"); - } else - old = modifier_index; - mkpm = x_modifier_keymap->max_keypermod; for (modifier_index = 0; modifier_index < 8; modifier_index++) for (modifier_key = 0; modifier_key < mkpm; modifier_key++) { @@ -168,6 +147,32 @@ static void x_reset_modifier_mapping(Display * display) modbarf(key_name, index_to_name(modifier_index)); } + inline void store_modifier(const char *key_name, int *old_mod) + { + if (*old_mod && *old_mod != modifier_index) + wwarning("key %s (0x%x) generates both %s and %s, which is nonsensical", + key_name, code, index_to_name(*old_mod), index_to_name(modifier_index)); + if (modifier_index == ShiftMapIndex) { + modbarf(key_name, "ModShift"); + } else if (modifier_index == LockMapIndex) { + modbarf(key_name, "ModLock"); + } else if (modifier_index == ControlMapIndex) { + modbarf(key_name, "ModControl"); + } else if (sym == XK_Mode_switch) { + mode_bit = modifier_index; /* Mode_switch is special, see below... */ + } else if (modifier_index == meta_bit && *old_mod != meta_bit) { + modwarn(key_name, meta_bit, "Meta"); + } else if (modifier_index == super_bit && *old_mod != super_bit) { + modwarn(key_name, super_bit, "Super"); + } else if (modifier_index == hyper_bit && *old_mod != hyper_bit) { + modwarn(key_name, hyper_bit, "Hyper"); + } else if (modifier_index == alt_bit && *old_mod != alt_bit) { + modwarn(key_name, alt_bit, "Alt"); + } else { + *(old_mod) = modifier_index; + } + } + code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key]; sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : NoSymbol); @@ -177,31 +182,31 @@ static void x_reset_modifier_mapping(Display * display) switch (sym) { case XK_Mode_switch: - store_modifier("Mode_switch", mode_bit); + store_modifier("Mode_switch", &mode_bit); break; case XK_Meta_L: - store_modifier("Meta_L", meta_bit); + store_modifier("Meta_L", &meta_bit); break; case XK_Meta_R: - store_modifier("Meta_R", meta_bit); + store_modifier("Meta_R", &meta_bit); break; case XK_Super_L: - store_modifier("Super_L", super_bit); + store_modifier("Super_L", &super_bit); break; case XK_Super_R: - store_modifier("Super_R", super_bit); + store_modifier("Super_R", &super_bit); break; case XK_Hyper_L: - store_modifier("Hyper_L", hyper_bit); + store_modifier("Hyper_L", &hyper_bit); break; case XK_Hyper_R: - store_modifier("Hyper_R", hyper_bit); + store_modifier("Hyper_R", &hyper_bit); break; case XK_Alt_L: - store_modifier("Alt_L", alt_bit); + store_modifier("Alt_L", &alt_bit); break; case XK_Alt_R: - store_modifier("Alt_R", alt_bit); + store_modifier("Alt_R", &alt_bit); break; case XK_Control_L: check_modifier("Control_L", ControlMask); http://repo.or.cz/w/wmaker-crm.git/commit/06d96ed18fc0bcadd9bb521e929acb2a970548cf commit 06d96ed18fc0bcadd9bb521e929acb2a970548cf Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:18 2014 +0100 wmaker: replaced macro by an inline function, in X Modifier initialisation A macro can be a source of problems, because the compiler has no type on the arguments to make checks. Using an inline function allows to do those checks, meaning clearer error messages, it provides clear info in case of name collision, it is easier to maintain (no need for the hacky '' for multi-lines) and the scope of visibility can be controlled more easily (no need for #undef). Took opportunity to change a 0 to the constant NoSymbol which is the name defined by X for this case and another to NULL which is the right way to set a null pointer in C. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/src/Makefile.am b/src/Makefile.am index 76fc18f9..8f1afbfa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,6 @@ wmaker_SOURCES = xinerama.h xinerama.c xmodifier.h - xmodifier.c xutil.c xutil.h wconfig.h @@ -125,9 +124,11 @@ wmaker_SOURCES += osdep_stub.c endif if USE_NESTED_FUNC -wmaker_SOURCES += misc.c +wmaker_SOURCES += misc.c + xmodifier.c else -nodist_wmaker_SOURCES = misc.hack_nf.c +nodist_wmaker_SOURCES = misc.hack_nf.c + xmodifier.hack_nf.c CLEANFILES = $(nodist_wmaker_SOURCES) @@ -135,6 +136,11 @@ misc.hack_nf.c: misc.c $(top_srcdir)/script/nested-func-to-macro.sh $(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh $(srcdir)/misc.c -o $(builddir)/misc.hack_nf.c -f "append_string" -f "append_modifier" + +xmodifier.hack_nf.c: xmodifier.c $(top_srcdir)/script/nested-func-to-macro.sh + $(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh + $(srcdir)/xmodifier.c -o $(builddir)/xmodifier.hack_nf.c + -f "modwarn" -f "modbarf" -f "check_modifier" endif diff --git a/src/xmodifier.c b/src/xmodifier.c index 641a8e35..bc525736 100644 --- a/src/xmodifier.c +++ b/src/xmodifier.c @@ -120,51 +120,61 @@ static void x_reset_modifier_mapping(Display * display) int mode_bit = 0; XModifierKeymap *x_modifier_keymap = XGetModifierMapping(display); -#define modwarn(name,old,other) - wwarning ("%s (0x%x) generates %s, which is generated by %s.", - name, code, index_to_name (old), other) - -#define modbarf(name,other) - wwarning ("%s (0x%x) generates %s, which is nonsensical.", - name, code, other) - -#define check_modifier(name,mask) - if ((1<<modifier_index) != mask) - wwarning ("%s (0x%x) generates %s, which is nonsensical.", - name, code, index_to_name (modifier_index)) - #define store_modifier(name,old) if (old && old != modifier_index) wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.", name, code, index_to_name (old), index_to_name (modifier_index)); - if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); - else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); - else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); + if (modifier_index == ShiftMapIndex) { modbarf (name,"ModShift"); } + else if (modifier_index == LockMapIndex) { modbarf (name,"ModLock"); } + else if (modifier_index == ControlMapIndex) { modbarf (name,"ModControl"); } else if (sym == XK_Mode_switch) mode_bit = modifier_index; /* Mode_switch is special, see below... */ - else if (modifier_index == meta_bit && old != meta_bit) + else if (modifier_index == meta_bit && old != meta_bit) { modwarn (name, meta_bit, "Meta"); - else if (modifier_index == super_bit && old != super_bit) + } else if (modifier_index == super_bit && old != super_bit) { modwarn (name, super_bit, "Super"); - else if (modifier_index == hyper_bit && old != hyper_bit) + } else if (modifier_index == hyper_bit && old != hyper_bit) { modwarn (name, hyper_bit, "Hyper"); - else if (modifier_index == alt_bit && old != alt_bit) + } else if (modifier_index == alt_bit && old != alt_bit) { modwarn (name, alt_bit, "Alt"); - else + } else old = modifier_index; mkpm = x_modifier_keymap->max_keypermod; for (modifier_index = 0; modifier_index < 8; modifier_index++) for (modifier_key = 0; modifier_key < mkpm; modifier_key++) { KeySym last_sym = 0; + for (column = 0; column < 4; column += 2) { - KeyCode code = x_modifier_keymap->modifiermap[modifier_index * mkpm - + modifier_key]; - KeySym sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : 0); + KeyCode code; + KeySym sym; + + inline void modwarn(const char *key_name, int old_mod, const char *other_key) + { + wwarning("key %s (0x%x) generates %s, which is generated by %s", + key_name, code, index_to_name(old_mod), other_key); + } + + inline void modbarf(const char *key_name, const char *other_mod) + { + wwarning("key %s (0x%x) generates %s, which is nonsensical", + key_name, code, other_mod); + } + + inline void check_modifier(const char *key_name, int mask) + { + if ((1 << modifier_index) != mask) + modbarf(key_name, index_to_name(modifier_index)); + } + + code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key]; + sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : NoSymbol); + if (sym == last_sym) continue; last_sym = sym; + switch (sym) { case XK_Mode_switch: store_modifier("Mode_switch", mode_bit); @@ -220,10 +230,6 @@ static void x_reset_modifier_mapping(Display * display) } } } -#undef store_modifier -#undef check_modifier -#undef modwarn -#undef modbarf /* If there was no Meta key, then try using the Alt key instead. If there is both a Meta key and an Alt key, then the Alt key @@ -238,7 +244,8 @@ static void x_reset_modifier_mapping(Display * display) not interpret it as Mode_switch; and interpreting it as both would be totally wrong. */ if (mode_bit) { - const char *warn = 0; + const char *warn = NULL; + if (mode_bit == meta_bit) warn = "Meta", meta_bit = 0; else if (mode_bit == hyper_bit) http://repo.or.cz/w/wmaker-crm.git/commit/6f318e86f36bfa11535c0102225b8c575e61e2c5 commit 6f318e86f36bfa11535c0102225b8c575e61e2c5 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:17 2014 +0100 makefile: make silent rule work also for generated files A few files are generated using custom commands, which so far did not follow the silent rule as the compilation stuff. This patch adds the needed stuff so they will also be silent if the user wants so, leading to a cleaner build process where warning/error messages are more visible. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/WindowMaker/Defaults/Makefile.am b/WindowMaker/Defaults/Makefile.am index 33975eab..344c0bf2 100644 --- a/WindowMaker/Defaults/Makefile.am +++ b/WindowMaker/Defaults/Makefile.am @@ -10,22 +10,18 @@ EXTRA_DIST = WMGLOBAL WMWindowAttributes.in WindowMaker.in WMState.in CLEANFILES = WMWindowAttributes WindowMaker WMState WMRootMenu WMWindowAttributes: $(srcdir)/WMWindowAttributes.in - -rm -f WMWindowAttributes - sed -e "s:#extension#:@ICONEXT@:" - $(srcdir)/WMWindowAttributes.in > WMWindowAttributes + $(AM_V_GEN)sed -e "s:#extension#:@ICONEXT@:" + $(srcdir)/WMWindowAttributes.in > WMWindowAttributes ; chmod 644 WMWindowAttributes WindowMaker: $(srcdir)/WindowMaker.in - -rm -f WindowMaker - sed -e "s:#pkgdatadir#:$(pkgdatadir):" $(srcdir)/WindowMaker.in - > WindowMaker + $(AM_V_GEN)sed -e "s:#pkgdatadir#:$(pkgdatadir):" $(srcdir)/WindowMaker.in + > WindowMaker ; chmod 644 WindowMaker WMState: $(srcdir)/WMState.in - -rm -f WMState - sed -e "s:#wprefs#:$(wpexecbindir)/WPrefs:" $(srcdir)/WMState.in > WMState + $(AM_V_GEN)sed -e "s:#wprefs#:$(wpexecbindir)/WPrefs:" $(srcdir)/WMState.in > WMState ; chmod 644 WMState WMRootMenu: $(srcdir)/../plmenu - -cp -f $(srcdir)/../plmenu WMRootMenu - + $(AM_V_GEN)cp -f $(srcdir)/../plmenu WMRootMenu diff --git a/WindowMaker/IconSets/Makefile.am b/WindowMaker/IconSets/Makefile.am index ec5ca124..ed4317da 100644 --- a/WindowMaker/IconSets/Makefile.am +++ b/WindowMaker/IconSets/Makefile.am @@ -8,10 +8,7 @@ EXTRA_DIST = CLEANFILES = Default.iconset Default.iconset: $(top_builddir)/WindowMaker/Defaults/WMWindowAttributes - -rm -f Default.iconset - echo '{' > Default.iconset - grep Icon $(top_builddir)/WindowMaker/Defaults/WMWindowAttributes >> Default.iconset - echo '}' >> Default.iconset + $(AM_V_GEN)echo '{' > Default.iconset ; + grep Icon $(top_builddir)/WindowMaker/Defaults/WMWindowAttributes >> Default.iconset ; + echo '}' >> Default.iconset ; chmod 644 Default.iconset - - diff --git a/src/Makefile.am b/src/Makefile.am index a7aa1d09..76fc18f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,7 +132,7 @@ nodist_wmaker_SOURCES = misc.hack_nf.c CLEANFILES = $(nodist_wmaker_SOURCES) misc.hack_nf.c: misc.c $(top_srcdir)/script/nested-func-to-macro.sh - $(top_srcdir)/script/nested-func-to-macro.sh + $(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh $(srcdir)/misc.c -o $(builddir)/misc.hack_nf.c -f "append_string" -f "append_modifier" endif diff --git a/util/Makefile.am b/util/Makefile.am index b5c9d042..cf07fd5f 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -80,12 +80,9 @@ wmiv_SOURCES = wmiv.c wmiv.h CLEANFILES = wmaker.inst wmaker.inst: $(srcdir)/wmaker.inst.in ./Makefile - -rm -f wmaker.inst - sed -e "s|#pkgdatadir#|$(pkgdatadir)|" + $(AM_V_GEN)sed -e "s|#pkgdatadir#|$(pkgdatadir)|" -e "s|#sysconfdir#|$(sysconfdir)/WindowMaker|" -e "s|#version#|$(VERSION)|" -e "s|#bindir#|$(bindir)|" - $(srcdir)/wmaker.inst.in >wmaker.inst - + $(srcdir)/wmaker.inst.in >wmaker.inst ; chmod 755 wmaker.inst - http://repo.or.cz/w/wmaker-crm.git/commit/855544626f1a8d7174d5798713c2e7e4460d979e commit 855544626f1a8d7174d5798713c2e7e4460d979e Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:16 2014 +0100 wmaker: remove unnecessary null pointer checks in handle_event of wsmap The function is called only if wsmap is not null, and the function is not modifying its value so it won't become null. Removed the checks to keep the code as simple as possible for maintainability. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/src/wsmap.c b/src/wsmap.c index ee667f9f..bc7a2ff1 100755 --- a/src/wsmap.c +++ b/src/wsmap.c @@ -487,8 +487,6 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) WMMaskEvent(dpy, KeyPressMask | KeyReleaseMask | ExposureMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask, &ev); - if (!wsmap) - break; modifiers = ev.xkey.state & w_global.shortcut.modifiers_mask; switch (ev.type) { @@ -539,8 +537,7 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) XUngrabPointer(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime); - if (wsmap) - workspace_map_destroy(wsmap); + workspace_map_destroy(wsmap); } static WWorkspaceMap *init_workspace_map(WScreen *scr, W_WorkspaceMap *wsmap_array) http://repo.or.cz/w/wmaker-crm.git/commit/a4713cbb4d49b1b59eb5282e0c97554a7efe50e2 commit a4713cbb4d49b1b59eb5282e0c97554a7efe50e2 Author: Christophe CURIS <christophe.cu...@free.fr> Date: Sun Dec 7 17:10:15 2014 +0100 wmaker: moved the variable 'process_workspacemap_event' to the global namespace The definition in the local header was not correct; it works because gcc is tolerant to this kind of errors but other compilers are not. The declaration was creating a local variable in each file that call header, and because it is not static gcc's linker will merge them. Other compilers will at best complain for duplicate symbol, and at worst silently duplicate the variable so it will not work as expected. The variable is now moved to the existing structure meant for global variables, so now the code is really clear about using a global variable instead of a static/local one. Took opportunity to add some missing 'static' attributes to some variables. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> diff --git a/src/WindowMaker.h b/src/WindowMaker.h index ce0a86c9..2d9ed1af 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -522,6 +522,13 @@ extern struct wmaker_global_variables { */ Bool ignore_workspace_change; + /* + * Process WorkspaceMap Event: + * this variable is set when the Workspace Map window is being displayed, + * it is mainly used to avoid re-opening another one at the same time + */ + Bool process_workspacemap_event; + #ifdef HAVE_INOTIFY struct { int fd_event_queue; /* Inotify's queue file descriptor */ diff --git a/src/workspace.c b/src/workspace.c index 165e3011..9a820574 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -476,7 +476,7 @@ void wWorkspaceForceChange(WScreen * scr, int workspace) if (workspace >= MAX_WORKSPACES || workspace < 0) return; - if (!wPreferences.disable_workspace_pager && !process_workspacemap_event) + if (!wPreferences.disable_workspace_pager && !w_global.process_workspacemap_event) wWorkspaceMapUpdate(scr); SendHelperMessage(scr, 'C', workspace + 1, NULL); diff --git a/src/wsmap.c b/src/wsmap.c index 244df94b..ee667f9f 100755 --- a/src/wsmap.c +++ b/src/wsmap.c @@ -46,9 +46,9 @@ static const int mini_workspace_per_line = 5; * will be 0 for workspaces number 0 to 9 * 1 for workspaces number 10 -> 19 */ -int wsmap_bulk_index; -WMPixmap *frame_bg_focused; -WMPixmap *frame_bg_unfocused; +static int wsmap_bulk_index; +static WMPixmap *frame_bg_focused; +static WMPixmap *frame_bg_unfocused; typedef struct { WScreen *scr; @@ -147,7 +147,7 @@ static void selected_workspace_callback(WMWidget *w, void *data) int workspace_id = atoi(WMGetButtonText(click_button)); wWorkspaceChange(wsmap->scr, workspace_id); - process_workspacemap_event = False; + w_global.process_workspacemap_event = False; } } @@ -482,8 +482,8 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, GrabModeAsync, GrabModeAsync, WMWidgetXID(wsmap->win), None, CurrentTime); - process_workspacemap_event = True; - while (process_workspacemap_event) { + w_global.process_workspacemap_event = True; + while (w_global.process_workspacemap_event) { WMMaskEvent(dpy, KeyPressMask | KeyReleaseMask | ExposureMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask, &ev); @@ -496,7 +496,7 @@ static void handle_event(WWorkspaceMap *wsmap, W_WorkspaceMap *wsmap_array) if (ev.xkey.keycode == escKey || (wKeyBindings[WKBD_WORKSPACEMAP].keycode != 0 && wKeyBindings[WKBD_WORKSPACEMAP].keycode == ev.xkey.keycode && wKeyBindings[WKBD_WORKSPACEMAP].modifier == modifiers)) { - process_workspacemap_event = False; + w_global.process_workspacemap_event = False; } else { KeySym ks; int bulk_id; diff --git a/src/wsmap.h b/src/wsmap.h index 2133bd52..27a45cc4 100644 --- a/src/wsmap.h +++ b/src/wsmap.h @@ -20,8 +20,6 @@ #ifndef WSMAP_H #define WSMAP_H -Bool process_workspacemap_event; - void wWorkspaceMapUpdate(WScreen *scr); void StartWorkspaceMap(WScreen *scr); ----------------------------------------------------------------------- Summary of changes: WPrefs.app/Appearance.c | 9 ++- WPrefs.app/tiff/nonopaque.tiff | Bin 1998 -> 2034 bytes WPrefs.app/xpm/nonopaque.xpm | 4 +- WindowMaker/Defaults/Makefile.am | 16 ++--- WindowMaker/IconSets/Makefile.am | 9 +-- checkpatch.pl | 2 +- src/Makefile.am | 14 +++- src/WindowMaker.h | 7 ++ src/workspace.c | 2 +- src/wsmap.c | 19 +++---- src/wsmap.h | 2 - src/xmodifier.c | 114 +++++++++++++++++++++----------------- util/Makefile.am | 7 +-- 13 files changed, 110 insertions(+), 95 deletions(-) repo.or.cz automatic notification. Contact project admin crma...@gmail.com if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive no reply. -- wmaker-crm.git ("The Window Maker window manager") -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.