summary refs log tree commit diff
path: root/search.c
Commit message (Collapse)AuthorAgeFilesLines
* cvsimportokan2017-09-061-1/+1
|\ | | | | | | | | * refs/heads/master: Case matters for menu matching on executables; from ben@lloyd.im.
| * Case matters for menu matching on executables; from ben@lloyd.im.okan2017-09-061-1/+1
| |
* | cvsimportokan2017-04-251-7/+10
|\| | | | | | | | | | | | | | | | | | | | | * refs/heads/master: The r1.36 menuq_add() conversion did this one wrong; fix by reverting to the original code which adds to resultentry list, as opposed to the wrong one in menuq_add(). Fixes crash noticed by at least Rickard Gustafsson. Remove 'noresult' (and simplify) as it does nothing and makes the logic around it needless. History doesn't show what this might have been used for in future iterations. search_match_path() isn't supposed to return anything. Move queue init to caller so it's only called once in a few cases. sort Raise the previously focused window, instead of the previous window in the cycle list; seems to match behaviour of other wm's; from Walter Alejandro Iglesias. For {h,v}tile, instead of keeping the master client's {h,v} geometry, expand it to %50 of the area, then fill in the remaining space with the other clients in the same group; from Gerrit Meyerheim.
| * The r1.36 menuq_add() conversion did this one wrong; fix by reverting to theokan2017-04-251-4/+7
| | | | | | | | | | original code which adds to resultentry list, as opposed to the wrong one in menuq_add(). Fixes crash noticed by at least Rickard Gustafsson.
| * search_match_path() isn't supposed to return anything.okan2017-04-241-1/+1
| |
| * Move queue init to caller so it's only called once in a few cases.okan2017-04-241-2/+2
| |
* | cvsimportChristian Neukirchen2016-12-161-21/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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).
| * Add search_print_text(), a default callback for mi->print in menu_filter(). ↵okan2016-12-061-3/+9
| | | | | | | | | | | | While here, normalize the remaining search_print_* argument paramters.
| * Tame the number of 'exec' and 'path' search_match wrappers. No functionalokan2016-12-011-18/+6
| | | | | | | | | | change now, though more can likely go later, losing the (paritally complete or incomplete/broken) argument completion bits.
* | cvsimportokan2016-10-241-33/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. ...
| * Remove duplicate check that strsubmatch() already does; while here, fix aokan2016-10-241-2/+2
| | | | | | | | comment.
| * Sprinkle __func__ in appropriate error messages.okan2016-10-241-1/+1
| |
| * Get rid of 'matchname'; it's too surprising to have the menu change duringokan2016-10-241-11/+3
| | | | | | | | | | | | 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 changeokan2016-10-221-21/+9
| |
| * Refactor callbacks to take a void * so as to not try and generalize intookan2016-10-181-2/+2
| | | | | | | | | | | | | | | | client_ctx in keypress and buttonpress event handlers; pass appropriate *ctx's based on context. While here, limit some globals, replace defines with appropriate variables and fix some naming.
* | cvsimportokan2016-09-141-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/heads/master: Some clients fail to setup hints at all, so initalize for them; fallout from r1.218 switching to malloc - clearly missed this case. Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flag instead of relying on curcc. init label Limit mouse resize to hints within the client; matches kbd resize behaviour. Switch to just malloc since we need initialize most everything anyway. change 'sticky' to 'stick' to toggle client stickiness (seems the default binding worked for everyone for a long time!); conflict with group sticky found by Ali Farzanrad - thanks! Simplify group_holds_only_hidden(); from Vadim Vygonets. Simplify toggling flags; from Vadim Vygonets. Do not draw borders on ignored clients when returning from fullscreen; from Vadim Vygonets. Remove redundant minimum client size adjustment (minw and minh are always positive since r1.214); from Vadim Vygonets.
| * Fix-up a few simple uses of client_current(): check CLIENT_ACTIVE flagokan2016-09-141-2/+2
| | | | | | | | instead of relying on curcc.
* | cvsimportokan2015-08-281-8/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refs/heads/master: (21 commits) Lost fix from r1.112; add comment. Mechanical change: group->gc Add consistent checks against NULL. Move client cycle grab/ungrab into a more relevant place; while here, update comments about why we need to grab/ungrab the keyboard. Re-add lost chunk in group_cycle from r1.113. Further simplify _NET_WM_DESKTOP handling using new group_assign(). oops; remove left over debug print Allowing sending a valid 'nogroup' (0) group_ctx to group_assign() (since we init all groups), though assigning the client's group to NULL for 'sticky'; use this simplification in a few places (others to follow). Split out sticky mode checks and the restoring of a client's group and _NET_WM_DESKTOP from the config-based auto-grouping; no (intentional) behavior changes. Needed for further work in cleaning up this area. Implement _NET_CLIENT_LIST_STACKING (from Thomas Admin), but bottom-to-top order, as per spec (notified Thomas as well). Don't allow freeze operations on fullscreen (consistent with what fullscreen does). Sort _NET_WM_STATE Atoms like the spec. Move CLIENT_STICKY logic from client hide/unhide to group hide/unhide; rationale being that clients should be able to hide/unhide independently of group switching. Add Xkb modifier to ignore mask; from Alexander Polakov. Fix whitespace. Add client freeze extension to _NET_WM_STATE Atom, allowing flag to persist. As usual with new Atoms, requires X restart. _NET_WM_STATE_STICKY implies only sticky at the group/desktop level, not position and size; based on discussion with a few. Instead of special casing the 'term' and 'lock' commands, go back to keeping them hidden; showing them has apparently caused confusion/angst. Leave command list order from .cwmrc alone; remove sort. Bring group and client cycle closer together. ...
| * Mechanical change: group->gcokan2015-08-271-1/+1
| |
| * Instead of special casing the 'term' and 'lock' commands, go back tookan2015-08-211-7/+1
| | | | | | | | keeping them hidden; showing them has apparently caused confusion/angst.
* | cvsimportokan2015-07-121-27/+14
|\|
| * introduce 'groupsearch' for group menu search; matches on either groupokan2015-07-121-0/+10
| | | | | | | | number/shortcut and/or name.
| * styleokan2015-07-011-27/+4
| |
* | cvsimportChristian Neukirchen2015-07-011-10/+18
|\|
| * Introduce a callback for cmd menu printing, special-casing 'lock' andokan2015-06-301-0/+14
| | | | | | | | 'term'.
| * style and spacing nitsokan2015-06-301-8/+2
| |
| * replace assert usageokan2015-06-281-2/+2
| |
* | cvsimportokan2015-06-091-2/+3
|\|
| * add client labelokan2015-06-081-2/+3
| |
* | cvsimportChristian Neukirchen2015-01-221-2/+3
|\|
| * Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAXokan2015-01-191-2/+3
| | | | | | | | | | | | and HOST_NAME_MAX+1, respectively. ok doug@
* | cvsimportokan2014-09-181-7/+7
|\|
| * use similiar style for client flagsokan2014-09-151-1/+1
| |
| * more style nitsokan2014-09-071-6/+6
| |
* | cvsimportChristian Neukirchen2014-09-071-1/+1
|\|
| * Fix nogroup regression, where nogroup became an actual group - theokan2014-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | symantics between cwm groups and ewmh got in the way. Ensure a client that wants to be in nogroup stays in nogroup (thus stays in view), even when (re)reading NET_WM_DESKTOP. Paritially reverts patchset 644 (2014-02-07 13:09 PST) which deals with a NULL cc->group. All to be revisited when NET_WM_STATE_STICKY hits cwm. Reported by many; testing and ok phessler.
| * Purely mechanical; unify 'num', 'no' and 'shortcut'.okan2014-08-201-1/+1
| |
* | cvsimportokan2014-02-081-1/+1
|\|
| * all mapped clients now should have a group, so simplify some casesokan2014-02-071-1/+1
| |
* | cvsimportokan2014-01-211-7/+4
|\|
| * Add a function that adds an entry to a menuq, normalizing a common codeokan2014-01-201-7/+4
| | | | | | | | path; from Tiago Cunha.
* | cvsimportokan2014-01-031-2/+2
|\|
| * use consistent typesokan2014-01-031-2/+2
| |
* | cvsimportokan2013-12-111-2/+2
|\|
| * Stash Class and WM Hints in client_ctxokan2013-12-111-2/+2
| |
* | cvsimport dh-gapsnapokan2013-12-081-1/+1
|\|
| * If not using sticky mode (the default), clients aren't automagically cn-bisectgtkbugokan2013-12-081-1/+1
| | | | | | | | | | assigned a group, thus cc->group will be NULL - fix the client group shortcut in menu lists; crash reported by Christian Neukirchen.
* | cvsimportokan2013-12-021-2/+2
|\|
| * Prepend the group shortcut in the client search menu; from Thomas Adam.okan2013-12-021-2/+2
| | | | | | | | Likewise, prepend shortcut in unhide menu.
* | cvsimportokan2013-04-301-1/+3
|\|