diff -Nru evilwm-1.4.0/bind.c evilwm-1.4.2/bind.c --- evilwm-1.4.0/bind.c 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/bind.c 2022-11-08 18:23:22.000000000 +0000 @@ -97,6 +97,7 @@ { "lower", func_lower, FL_CLIENT }, { "move", func_move, FL_CLIENT }, { "next", func_next, 0 }, + { "raise", func_raise, FL_CLIENT }, { "resize", func_resize, FL_CLIENT }, { "spawn", func_spawn, 0 }, { "vdesk", func_vdesk, FL_SCREEN }, @@ -453,7 +454,7 @@ for (struct list *l = controls; l; l = l->next) { struct bind *bind = l->data; - if (bind->type == KeyPress && key == bind->control.key && (e->state & KEY_STATE_MASK) == bind->state) { + if (bind->type == KeyPress && key == bind->control.key && (e->state & KEY_STATE_MASK & ~numlockmask) == (bind->state & ~numlockmask)) { void *sptr = NULL; if (bind->flags & FL_CLIENT) { sptr = current; @@ -475,7 +476,7 @@ void bind_handle_button(XButtonEvent *e) { for (struct list *l = controls; l; l = l->next) { struct bind *bind = l->data; - if (bind->type == ButtonPress && e->button == bind->control.button && (e->state & BUTTON_STATE_MASK) == bind->state) { + if (bind->type == ButtonPress && e->button == bind->control.button && (e->state & BUTTON_STATE_MASK & ~numlockmask) == (bind->state & ~numlockmask)) { void *sptr = NULL; if (bind->flags & FL_CLIENT) { sptr = find_client(e->window); diff -Nru evilwm-1.4.0/ChangeLog evilwm-1.4.2/ChangeLog --- evilwm-1.4.0/ChangeLog 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/ChangeLog 2022-11-08 18:23:22.000000000 +0000 @@ -1,3 +1,12 @@ +Version 1.4.2, Tue Nov 8 2022 + + * Ignore NumLock correctly when processing events [Kacper Gutowski] + +Version 1.4.1, Wed Nov 2 2022 + + * Add "raise" function to complement "lower" [Juan Pedro Vallejo] + * Allow '=' in option arguments, needed for -bind [Burkhard Kleemeier] + Version 1.4.0, Tue Sep 27 2022 * Send more accurate response to _NET_REQUEST_FRAME_EXTENTS. diff -Nru evilwm-1.4.0/debian/changelog evilwm-1.4.2/debian/changelog --- evilwm-1.4.0/debian/changelog 2022-10-28 15:35:13.000000000 +0000 +++ evilwm-1.4.2/debian/changelog 2022-11-18 20:13:27.000000000 +0000 @@ -1,7 +1,22 @@ +evilwm (1.4.2-1) unstable; urgency=medium + + [ Debian Janitor ] + * Trim trailing whitespace. + * Update renamed lintian tag names in lintian overrides. + * Set field Upstream-Contact in debian/copyright. + * Remove obsolete fields Contact, Name from debian/upstream/metadata (already + present in machine-readable debian/copyright). + + [ Mateusz Łukasik ] + * New upstream release. (Closes: #1023516) + * Update debian/source/lintian-overrides. + + -- Mateusz Łukasik Fri, 18 Nov 2022 21:13:27 +0100 + evilwm (1.4.0-1) unstable; urgency=medium * New upstream release: - + Removed patches included upstream and refreshed rest. + + Removed patches included upstream and refreshed rest. * Bump standards version to 4.6.1 -- Mateusz Łukasik Fri, 28 Oct 2022 17:35:13 +0200 diff -Nru evilwm-1.4.0/debian/copyright evilwm-1.4.2/debian/copyright --- evilwm-1.4.0/debian/copyright 2022-10-09 19:05:46.000000000 +0000 +++ evilwm-1.4.2/debian/copyright 2022-11-14 20:53:38.000000000 +0000 @@ -2,6 +2,7 @@ Upstream-Name: evilwm Source: http://www.6809.org.uk/evilwm/ Copyright: 1999-2015 Ciaran Anscomb +Upstream-Contact: https://www.6809.org.uk/ciaran/ Files: * Copyright: 1999-2015 Ciaran Anscomb diff -Nru evilwm-1.4.0/debian/upstream/metadata evilwm-1.4.2/debian/upstream/metadata --- evilwm-1.4.0/debian/upstream/metadata 2022-10-09 19:05:46.000000000 +0000 +++ evilwm-1.4.2/debian/upstream/metadata 2022-11-14 20:53:38.000000000 +0000 @@ -1,5 +1,3 @@ -Name: evilwm Repository: https://www.6809.org.uk/git/evilwm.git Documentation: https://www.6809.org.uk/evilwm/manual.shtml -Contact: https://www.6809.org.uk/ciaran/ Bug-Submit: https://www.6809.org.uk/ciaran/ diff -Nru evilwm-1.4.0/display.c evilwm-1.4.2/display.c --- evilwm-1.4.0/display.c 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/display.c 2022-11-08 18:23:22.000000000 +0000 @@ -138,6 +138,7 @@ // Find out which modifier is NumLock - for every grab, we need to also // grab the combination where this is set. + numlockmask = 0; XModifierKeymap *modmap = XGetModifierMapping(display.dpy); for (unsigned i = 0; i < 8; i++) { for (unsigned j = 0; j < (unsigned)modmap->max_keypermod; j++) { diff -Nru evilwm-1.4.0/doc/evilwm.html evilwm-1.4.2/doc/evilwm.html --- evilwm-1.4.0/doc/evilwm.html 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/doc/evilwm.html 2022-11-08 18:23:22.000000000 +0000 @@ -70,7 +70,7 @@ -

evilwm

+

evilwm

NAME

@@ -391,6 +391,10 @@
Cycle to the next window. +
raise + +

Raises the current window. +

resize
When bound to a button, resizes a window with the mouse. @@ -440,8 +444,8 @@

Button binds

-bind button1=move,drag
-bind button2=resize,drag
+bind button1=move
+bind button2=resize
 bind button3=lower
 
diff -Nru evilwm-1.4.0/evilwm.1 evilwm-1.4.2/evilwm.1 --- evilwm-1.4.0/evilwm.1 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/evilwm.1 2022-11-08 18:23:22.000000000 +0000 @@ -81,7 +81,7 @@ . pdfinfo /Author Ciaran Anscomb .\} . -.TH "evilwm" "1" "September 2022" "evilwm-1.4" +.TH "evilwm" "1" "October 2022" "evilwm-1.4" .hy 0 .nh .H1 NAME @@ -259,6 +259,10 @@ \f(CBnext\fR Cycle to the next window. .TP +\f(CBraise\fR +.PP +Raises the current window. +.TP \f(CBresize\fR When bound to a button, resizes a window with the mouse. .IP @@ -286,8 +290,8 @@ .H2 Button binds .IP .EX -bind\ button1=move,drag -bind\ button2=resize,drag +bind\ button1=move +bind\ button2=resize bind\ button3=lower .EE .H2 Keyboard binds diff -Nru evilwm-1.4.0/func.c evilwm-1.4.2/func.c --- evilwm-1.4.0/func.c 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/func.c 2022-11-08 18:23:22.000000000 +0000 @@ -76,9 +76,9 @@ } void func_lower(void *sptr, XEvent *e, unsigned flags) { - if (!(flags & FL_CLIENT)) - return; struct client *c = sptr; + if (!(flags & FL_CLIENT) || !c) + return; (void)e; client_lower(c); } @@ -148,6 +148,14 @@ clients_tab_order = list_to_head(clients_tab_order, current); } +void func_raise(void *sptr, XEvent *e, unsigned flags) { + struct client *c = sptr; + if (!(flags & FL_CLIENT) || !c) + return; + (void)e; + client_raise(c); +} + void func_resize(void *sptr, XEvent *e, unsigned flags) { struct client *c = sptr; if (!(flags & FL_CLIENT) || !c) diff -Nru evilwm-1.4.0/func.h evilwm-1.4.2/func.h --- evilwm-1.4.0/func.h 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/func.h 2022-11-08 18:23:22.000000000 +0000 @@ -36,6 +36,7 @@ void func_lower(void *, XEvent *, unsigned); void func_move(void *, XEvent *, unsigned); void func_next(void *, XEvent *, unsigned); +void func_raise(void *, XEvent *, unsigned); void func_resize(void *, XEvent *, unsigned); void func_spawn(void *, XEvent *, unsigned); void func_vdesk(void *, XEvent *, unsigned); diff -Nru evilwm-1.4.0/log.h evilwm-1.4.2/log.h --- evilwm-1.4.0/log.h 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/log.h 2022-11-08 18:23:22.000000000 +0000 @@ -9,8 +9,11 @@ #include -#ifdef XDEBUG +#if defined(DEBUG) || defined(XDEBUG) # include +#endif + +#ifdef XDEBUG # include # include #endif diff -Nru evilwm-1.4.0/main.c evilwm-1.4.2/main.c --- evilwm-1.4.0/main.c 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/main.c 2022-11-08 18:23:22.000000000 +0000 @@ -134,6 +134,18 @@ ); } +static const char *default_options[] = { + "display", + "term " DEF_TERM, + "fn " DEF_FONT, + "fg " DEF_FG, + "bg " DEF_BG, + "bw " xstr(DEF_BW), + "fc " DEF_FC, + "numvdesks 8", +}; +#define NUM_DEFAULT_OPTIONS (sizeof(default_options)/sizeof(default_options[0])) + int main(int argc, char *argv[]) { struct sigaction act; int argn = 1, ret; @@ -150,25 +162,10 @@ wm_exit = 0; while (!wm_exit) { - option = (struct options) { - .bw = DEF_BW, - - .vdesks = 8, - .snap = 0, - .wholescreen = 0, - -#ifdef SOLIDDRAG - .no_solid_drag = 0, -#endif - }; - // Default options - xconfig_set_option(evilwm_options, "display", ""); - xconfig_set_option(evilwm_options, "fn", DEF_FONT); - xconfig_set_option(evilwm_options, "fg", DEF_FG); - xconfig_set_option(evilwm_options, "bg", DEF_BG); - xconfig_set_option(evilwm_options, "fc", DEF_FC); - xconfig_set_option(evilwm_options, "term", DEF_TERM); + option = (struct options){0}; + for (unsigned i = 0; i < NUM_DEFAULT_OPTIONS; i++) + xconfig_parse_line(evilwm_options, default_options[i]); // Read configuration file const char *home = getenv("HOME"); diff -Nru evilwm-1.4.0/Makefile evilwm-1.4.2/Makefile --- evilwm-1.4.0/Makefile 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/Makefile 2022-11-08 18:23:22.000000000 +0000 @@ -112,7 +112,7 @@ ############################################################################ # You shouldn't need to change anything beyond this point -version = 1.4.0 +version = 1.4.2 distdir = evilwm-$(version) # Generally shouldn't be overridden: diff -Nru evilwm-1.4.0/README evilwm-1.4.2/README --- evilwm-1.4.0/README 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/README 2022-11-08 18:23:22.000000000 +0000 @@ -219,6 +219,10 @@ next Cycle to the next window. + raise + + Raises the current window. + resize When bound to a button, resizes a window with the mouse. When bound to a key, if the relative flag is specified, modifies @@ -251,8 +255,8 @@ altmask shift Button binds - bind button1=move,drag - bind button2=resize,drag + bind button1=move + bind button2=resize bind button3=lower Keyboard binds @@ -335,4 +339,4 @@ -evilwm-1.4 September 2022 evilwm(1) +evilwm-1.4 October 2022 evilwm(1) diff -Nru evilwm-1.4.0/xconfig.c evilwm-1.4.2/xconfig.c --- evilwm-1.4.0/xconfig.c 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/xconfig.c 2022-11-08 18:23:22.000000000 +0000 @@ -14,6 +14,7 @@ #include #include "log.h" +#include "xalloc.h" #include "xconfig.h" // Break a space-separated string into an array of strings. @@ -118,7 +119,7 @@ *(unsigned *)option->dest.u = strtoul(arg, NULL, 0); break; case XCONFIG_STRING: - *(char **)option->dest.s = strdup(arg); + *(char **)option->dest.s = xstrdup(arg); break; case XCONFIG_STR_LIST: *(char ***)option->dest.sl = split_string(arg); @@ -134,46 +135,59 @@ } } +void xconfig_parse_line(struct xconfig_option *options, const char *line) { + // skip leading spaces + while (isspace((int)*line)) + line++; + + // end of line or comment? + if (*line == 0 || *line == '#') + return; + + // from here on, work on a copy of the string + char *linedup = xstrdup(line); + + // whitespace separates option from arguments + char *optstr = strtok(linedup, "\t\n\v\f\r "); + if (optstr == NULL) { + goto done; + } + + struct xconfig_option *opt = find_option(options, optstr); + if (opt == NULL) { + LOG_INFO("Ignoring unknown option `%s'\n", optstr); + goto done; + } + + char *arg; + if (opt->type == XCONFIG_STR_LIST) { + // special case: spaces here mean something + arg = strtok(NULL, "\n\v\f\r"); + while (isspace(*arg)) { + arg++; + } + } else { + arg = strtok(NULL, "\t\n\v\f\r "); + } + + set_option(opt, arg ? arg : ""); +done: + free(linedup); + return; +} + // Simple parser: one directive per line, "option argument" enum xconfig_result xconfig_parse_file(struct xconfig_option *options, const char *filename) { char buf[256]; - char *line, *optstr, *arg; + char *line; FILE *cfg; cfg = fopen(filename, "r"); if (cfg == NULL) return XCONFIG_FILE_ERROR; while ((line = fgets(buf, sizeof(buf), cfg))) { - // skip leading spaces - while (isspace((int)*line)) - line++; - - // end of line or comment? - if (*line == 0 || *line == '#') - continue; - - // whitespace and '=' separate option from arguments - optstr = strtok(line, "\t\n\v\f\r ="); - if (optstr == NULL) - continue; - - struct xconfig_option *opt = find_option(options, optstr); - if (opt == NULL) { - LOG_INFO("Ignoring unknown option `%s'\n", optstr); - continue; - } - - if (opt->type == XCONFIG_STR_LIST) { - // special case: spaces here mean something - arg = strtok(NULL, "\n\v\f\r"); - while (isspace(*arg) || *arg == '=') { - arg++; - } - } else { - arg = strtok(NULL, "\t\n\v\f\r ="); - } - set_option(opt, arg); + xconfig_parse_line(options, line); } fclose(cfg); return XCONFIG_OK; @@ -233,13 +247,6 @@ return XCONFIG_OK; } -void xconfig_set_option(struct xconfig_option *options, const char *optstr, const char *arg) { - struct xconfig_option *opt = find_option(options, optstr); - if (opt) { - set_option(opt, arg); - } -} - void xconfig_free(struct xconfig_option *options) { for (int i = 0; options[i].type != XCONFIG_END; i++) { unset_option(&options[i]); diff -Nru evilwm-1.4.0/xconfig.h evilwm-1.4.2/xconfig.h --- evilwm-1.4.0/xconfig.h 2022-09-27 10:11:13.000000000 +0000 +++ evilwm-1.4.2/xconfig.h 2022-11-08 18:23:22.000000000 +0000 @@ -46,14 +46,14 @@ } dest; }; +void xconfig_parse_line(struct xconfig_option *options, const char *line); + enum xconfig_result xconfig_parse_file(struct xconfig_option *options, const char *filename); enum xconfig_result xconfig_parse_cli(struct xconfig_option *options, int argc, char **argv, int *argn); -void xconfig_set_option(struct xconfig_option *options, const char *optstr, const char *arg); - // Free all allocated strings pointed to by options void xconfig_free(struct xconfig_option *options);