summary refs log tree commit diff
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* cvsimportokan2018-02-061-3/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/heads/master: (28 commits) Use screen's saved view instead of re-querying the server. Slightly expand and expose verbose debugging. add debugging for x events Add a simple debug logging mechanism. Simplification; use asprintf where appropriate now. Use func attributes where appropriate. Fix wins comparison declaration since it's unsigned from XQueryTree(). Generate name_to_func[] in a clean and readable fashion. Shrink tier[] by one after removing matchname in r1.55. If the requested group number is invalid, bail but don't kill cwm. Quick fix: exit after a failed execvp in u_spawn instead; previously we did in u_exec, but the introduction of re-exec'ing the previous invocation of cwm if 'exec_wm' failed missed the 'exec' failing path. Will likely split out as a proper fix. Only exec the fallback when in CWM_EXEC_WM state. Typo, from Julien Steinhauser. Convert menu-exec-wm from an abritrary exec menu, into a config-based menu from which one may configure (wm <name> <path_and_args>) (and choose) specific window managers to replace the running one. 'wm cwm cwm' is included by default. As done for buttonrelease, work specific un-cycling and un-highlighting actions into the keyrelease event, only performing what's actually needed for each; should result in much fewer events against keyreleases. No intended behaviour change. Merge group_toggle_membership_leave into the buttonrelease event and only do border work for a group/ungroup action. add helper function client_show to bring together like actions for unhide/raise Add support for re-exec'ing with SIGHUP; equivalent to the already built-in 'restart' function. Use poll and XNextEvent to replace XNextEvent blocking inside the x11 event handler. zap stray that snuck in ...
| * Simplification; use asprintf where appropriate now.okan2018-02-021-4/+6
| |
| * Convert menu-exec-wm from an abritrary exec menu, into a config-based menu fromokan2017-12-291-1/+12
| | | | | | | | | | | | | | | | which one may configure (wm <name> <path_and_args>) (and choose) specific window managers to replace the running one. 'wm cwm cwm' is included by default. No objections and seems sensible to sthen.
* | cvsimportokan2017-05-091-1/+1
|\| | | | | | | | | | | | | | | | | * refs/heads/master: drop obsolete comment Alter callbacks to take a struct instead of a growing number of arguments; greatly simplifies upcoming work. Ensure clients stay within the viewable bounds on placement, even with empty borders; based on a patch from Vadim Vygonets. Clean up, unify and accurately calculate edge distance with client move/resize actions, so as to not lose windows off the edge. Switch bwidth type; unfortunately X11 is inconsistent.
| * Switch bwidth type; unfortunately X11 is inconsistent.okan2017-04-261-1/+1
| |
* | cvsimportChristian Neukirchen2016-12-161-16/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/heads/master: stray newlines Add search_print_text(), a default callback for mi->print in menu_filter(). While here, normalize the remaining search_print_* argument paramters. Consistent use of menuq_add for ssh menu. Now that dim.{x,y} are available early, use them before requiring a MotionNotify event. Set dim.{x,y} during client_init and update on resize, instead of (re)calculating only when applying hints. 'window-search' is spelled 'menu-window'; the former snuck in during the conversion('menu-window' already existed and was properlly documented); found the hard way by sthen@ while trying to convert. Fold unbinding functions into one for each, key and mouse; plugs a leak when unbinding a mouse button bound to a command. use the correct type Tame the number of 'exec' and 'path' search_match wrappers. No functional change now, though more can likely go later, losing the (paritally complete or incomplete/broken) argument completion bits. Switch ssh menu to search_match_text; like group/window/cmd menus, use only a substring match. The previous matching is only intended for the exec menus. Change 'menu-window' to display all windows; then add 'menu-window-hidden' for the previous behaviour of 'menu-window'. 'menu-window' becomes the default binding; use 'bind-mouse "1" menu-window-hidden' to restore old behaviour for those who prefer. Normalize bind function names, based on a few categories: window, group, menu and pointer. Use an additional check with lstat(2) when d_type is unknown. revert previous; upcoming changes will hopefully deal with these more naturally. Add a wrapper based upon xevent handlers around client move/resize for key and mouse bindings. Define callbacks, then default bindings. Reorganize for upcoming changes. Remove the (8) default bindings for pointer move since they conflict with default bindings for emacs, which wins; the feature remains and can be bound to whatever users wish with cwmrc(5).
| * Normalize bind function names, based on a few categories: window, group, menuokan2016-12-011-16/+35
| | | | | | | | | | | | | | | | and pointer. Replace 'bind' and 'mousebind' options with 'bind-key' and 'bind-mouse', respectively, replace special 'unmap' keyword with 'unbind-key' and 'unbind-mouse', and additionally allow unbinding all with 'all' keyword.
| * Define callbacks, then default bindings.okan2016-11-141-1/+1
| |
* | cvsimportokan2016-10-241-4/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/heads/master: (34 commits) Make it clear these are flags. Remove duplicate check that strsubmatch() already does; while here, fix a comment. Sprinkle __func__ in appropriate error messages. Get rid of 'matchname'; it's too surprising to have the menu change during client search as different potential str matches are cycled through. If there's interest, the only string that doesn't exist in the listing is the window's class - that can be added of course, but it makes the line too long imho. clean up search_match_client(); no behaviour change Refactor callbacks to take a void * so as to not try and generalize into client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's based on context. remove another unused proto Rename 2 kbfunc to match closer to what they do Add an argument to the callbacks to pass the xevent context, button or key press. This allows to remove a few hacks to duplicate functions only for behaviour changes; now differing behaviours are pushed down to the callback. Also will allow for previously unavailable actions to be bind-able down the road. Check the ptr bounds in the new client during cycling, since not all actions do ptrsave, such as restoring client geometry; adapted from a diff by Vadim Vygonets. More accurate to say 'toggle', rather than 'select', for group[n]/nogroup. Add CM-a for 'nogroup' (CM-0 stays for now); update manpage to reflect. Stash wmname into conf. When removing xrandr regions, ensure clients are within the bounds of the screen; adapted from an ancient diff from Sviatoslav Chagaev. Things in this area will likely change, but put this in so it works now and serves as a reminder. Calculate client nameqlen in client_setname(), the only place it's needed/used. Turn CALMWM_NGROUPS define into variable, ngroups. Start simplifying menu code; and in turn, remove a cursor no longer needed. Defaults are split between defines and conf_init(); normalize these, as well as give 'sticky' groups its own variable. For both kb and mouse move, it is possible to grab a client and move it completely off the screen/region; instead, if the pointer is outside of the client bounds, warp the pointer to the closest edge before moving. client_ptrwarp should not deal with unhiding or raising clients (non ptr requests); most callers do this already - deal with the few that do not. client_ptrwarp becomes a simple wrapper (setpos) but it will be expanded. ...
| * Defaults are split between defines and conf_init(); normalize these, asokan2016-10-031-4/+1
| | | | | | | | well as give 'sticky' groups its own variable.
* | cvsimportokan2015-06-091-1/+12
|\|
| * Fix autogroup so name,class doesn't need to be quoted.kspillner2015-05-171-0/+11
| | | | | | | | ok okan@ on an older version of this diff
| * Make window name and window class separate parameters to conf_autogroup.kspillner2015-05-171-1/+1
| | | | | | | | | | | | No functional change, but will be used shortly. ok okan@
* | cvsimportokan2015-03-291-6/+5
|\|
| * simplify error messages; discussed with doug@okan2015-02-141-6/+5
| |
* | cvsimportChristian Neukirchen2015-01-221-7/+12
|\|
| * Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAXokan2015-01-191-1/+1
| | | | | | | | | | | | and HOST_NAME_MAX+1, respectively. ok doug@
| * Catch up with src parse.y changes by jsg@:okan2015-01-171-0/+3
| | | | | | | | | | | | | | | | Don't allow embedded nul characters in strings. Fixes a pfctl crash with an anchor name containing an embedded nul found with the afl fuzzer. pfctl parse.y patch from and ok deraadt@
| * Add gcc format attributes for yyerror(); fix a few yyerror() calls.okan2015-01-161-6/+8
| | | | | | | | Adapted from src parse.y changes by doug@. OK doug@
* | cvsimportokan2014-01-301-5/+1
|\|
| * re-add lost free from previousokan2014-01-301-0/+1
| |
| * Switch ignoreq to winname struct since it's basically the same thing;okan2014-01-301-6/+1
| | | | | | | | removes limit on name matching.
* | cvsimportokan2014-01-291-1/+6
|\|
| * Check command name/path for truncation and provide user feedback duringokan2014-01-291-1/+6
| | | | | | | | | | | | config parse (and use conf_cmd_add to populate defaults); based on a discussion with Tiago Cunha. While this looks ugly, there are likely some other changes here to come.
* | cvsimportokan2014-01-281-63/+7
|\|
| * Check ignore windowname for truncation and provide user feedback duringokan2014-01-281-1/+5
| | | | | | | | config parse; based on a discussion with Tiago Cunha.
| * Move conf_init/clear into main - no behaviour change; from Tiago Cunha.okan2014-01-281-6/+1
| |
| * simplify parse_config using assignment; inspired by a very old diff fromokan2014-01-271-57/+2
| | | | | | | | Tiago Cunha.
* | cvsimportokan2014-01-241-4/+7
|\|
| * more range checkingokan2014-01-241-4/+7
| |
* | cvsimportokan2014-01-211-2/+7
|\|
| * constify and rename some confusing variables around cmdq.okan2014-01-201-1/+1
| |
| * - remove redundant range check for buttons in conf_bind_mouse.okan2014-01-201-1/+6
| | | | | | | | | | | | | | | | | | - make conf_bind_kbd return error on non-matches to match what conf_bind_mouse does. - rename some variables while here for clarity. - constify bind and cmd. from Tiago Cunha.
* | cvsimportokan2013-12-131-1/+6
|\|
| * Add support for XUrgency and matching _NET_WM_STATE_DEMANDS_ATTENTIONokan2013-12-131-1/+6
| | | | | | | | | | | | | | ewmh hint; urgencyborder is configurable. The urgency flag will stick, even while on a client in a non-viewable group, until the client receives focus (where the border is reset). Initial diff from Thomas Adam with some changes/enhancements from me.
* | Revert "use u_char for buffers in yylex"Christian Neukirchen2013-12-061-5/+5
| | | | | | | | | | | | | | This reverts commit 03b19f1487135d8e8a80e0aad5aef447776c7c11. This merely generates pointer signedness warnings for strtonum() and lookup() and problems with the const char * prototype of xstrdup().
* | cvsimportokan2013-12-021-5/+5
|\|
| * Log message:benno2013-11-251-5/+5
| | | | | | | | | | | | use u_char for buffers in yylex, for ctype calls, as done in all other parse.y in the tree found by millert@, ok okan@
* | cvsimportokan2013-07-161-1/+1
|\|
| * max -> nitemsokan2013-07-161-1/+1
| |
* | cvsimportokan2013-07-101-2/+2
|\|
| * clarify kbd vs mouse functionsokan2013-07-081-2/+2
| |
* | cvsimportsthen2013-06-031-3/+3
|\|
| * Unlike other parse.y variants, cwm's allowed 'command xx /path/to/xx' withoutsthen2013-06-031-3/+3
| | | | | | | | | | quotes. Reinstate this support lost in recent sync diff and add a comment to show that it's intentional. ok okan@
* | cvsimportChristian Neukirchen2013-05-291-45/+66
|\|
| * move validation of pointer Button into conf_mousebind so we checkokan2013-05-221-1/+6
| | | | | | | | | | | | | | validity during the parse phase and not bother adding it to the queue, instead of each time a client needs to grab (when it's too late); furthermore, make this a config error, stop parsing and load the default config.
| * sync with src changesokan2013-05-221-30/+33
| |
| * - switch border colors to Xftokan2013-05-191-12/+9
| | | | | | | | | | | | | | | | | | - merge border/menu color structures/functions since they now both use Xft - switch xu_xorcolor to operating on XftColor instead of just XRenderColor (basically adding pixel) - if color name allocation fails, revert back to default (this, along with font validation should occur during config parse, but we don't have screens setup yet - likely to change at some point)
| * negative values for borderwith, moveamount, snapdist and gap areokan2013-05-061-2/+18
| | | | | | | | configuration errors, so warn and load defaults.
* | cvsimportokan2013-04-301-7/+2
|\|