summaryrefslogtreecommitdiff
path: root/src/actions.c
AgeCommit message (Collapse)Author
2014-03-03"deffoo..." -> "set foo..." in the error messages.Jérémie Courrèges-Anglas
* "deffoo"-style names are only compat aliases these days.
2014-03-03Rename string_to_window_number to string_to_number.Jérémie Courrèges-Anglas
* The previous name didn't make sense since it was also used for group numbers. * This function should probably make more checks or be deleted.
2014-03-03Fix a typo in a comment.Jérémie Courrèges-Anglas
2014-03-03Silence warning in previous commit.Jérémie Courrèges-Anglas
2014-03-02Allow exact matching with gselect.fix/gselect_exact_matchcos
When having two groups where the second one's name partially matches the name of the first one, it is hard to gselect the second one. Similarly it is not possible to select groups with fully numerical names. e.g. If having the group list: 0-default 1*other 2-de 3-0 The user expactation when typing ":gselect de" or ":gselect 0" would likely be to select group number 2 & group number 3 respectively. This commit modifies the behaviour of gselect, to primarily select the group with an exactly matching name if possible, before trying numerical or partial matches.
2014-02-20Fall back to ioctl(TIOCNOTTY) to detach from the controlling terminal.Jérémie Courrèges-Anglas
* As with setpgid, only do this if setsid fails or is absent.
2014-02-20Only call setpgid when setsid fails or is absent.Jérémie Courrèges-Anglas
2014-02-20Change set_close_on_exec to take a file descriptor.Jérémie Courrèges-Anglas
* Since it's easier to get a fd from a FILE * rather than the other way around.
2014-01-03Don't mix code and decls.Jérémie Courrèges-Anglas
2014-01-03strdup -> xstrdupJérémie Courrèges-Anglas
2014-01-03malloc -> xmallocJérémie Courrèges-Anglas
2014-01-03One realloc -> xrealloc.Jérémie Courrèges-Anglas
2014-01-03Get rid of useless casts of xmalloc/realloc return value.Jérémie Courrèges-Anglas
2014-01-03if (ptr) free(ptr) is not a good idiom.Jérémie Courrèges-Anglas
2014-01-03In parse_keydesc() strdup the key desc only if needed.Jérémie Courrèges-Anglas
2014-01-03Remove some fairly obvious comments.Jérémie Courrèges-Anglas
2013-12-03Bogus cmdret_free call.Jérémie Courrèges-Anglas
2013-11-22Cast char arguments to to*/is* ctype calls to unsigned charJérémie Courrèges-Anglas
* those functions expect an int whose value is between -1 and 255. Cast to unsigned char so that sign extension when promoting to int doesn't bite us.
2013-11-20Cleanup cmd_metaJérémie Courrèges-Anglas
* plug memory leak * consistent indentation * minimize variables scope * kill commented code
2013-11-20In cmd_meta, don't pass stack garbage to XSendEvent.Jérémie Courrèges-Anglas
* zero out the whole struct and explicitely assign CurrentTime (OL) to ev.xkey.time. This should please Firefox when using C-t t.
2013-11-17Use sbuf_chop in fdump() to trim trailing comma.Jérémie Courrèges-Anglas
* those commas shouldn't have been there in the first place. If your scripts rely on this, watch out! * code simplified and variables better named, while here.
2013-08-08Plug leak in cmd_sfrestore.Jérémie Courrèges-Anglas
Noticed by Repolho <repolho at zoho dot com>, who came with a different fix.
2013-08-08Cleanup cmd_sfdump.Jérémie Courrèges-Anglas
Better variable names, more readable formatting. Use a fixed buffer for the screen number appended to each frameset.
2013-08-08Consistent formatting in cmd_sfrestore.Jérémie Courrèges-Anglas
2013-08-08Remove useless/untrue comments in cmd_sfrestore.Jérémie Courrèges-Anglas
2013-08-08Better variable names in cmd_sfrestoreJérémie Courrèges-Anglas
2013-08-08In cmd_sfrestore don't pass screen number to frestore.Jérémie Courrèges-Anglas
Noticed by Repolho <repolho at zoho dot com>, who came with a similar fix.
2013-05-26Adapt group bar to be updated on group number or name change.cr/implement_gnumber-with_winliststylecos
2013-05-26Remove redundant check for NULL.cos
Since add_command() for cmd_gnumber is forcing one (or two) numerical argument, command() will never allow calling the cmd_gnumber() with arg[0] set to NULL.
2013-05-26Add initial cmd_gnumber implementation.cos
2013-04-10Get rid of several unused variablesJérémie Courrèges-Anglas
* cmd_definekey: actually use cmd * cmd_meta: remove ev1 * cmd_resize: remove nbytes * cmd_ratrelwarp: remove s * draw_string: remove lgv, lgc, mask; lgc wasn't XFreeGC'ed * get_more_input: remove nbytes * cleanup_frame: remove last_win * get_window_list: remove other_window Patch from Bernhard R. Link
2013-04-10Refactor cmd_promptJérémie Courrèges-Anglas
* use a local variable instead of using ARG_STRING(0) ten times * minimize scope of local variables * use a struct sbuf instead of playing with xmalloc and strncpy * correct indentation
2013-04-10Refactor cmd_timeJérémie Courrèges-Anglas
* instead of playing with xmalloc, strlen and strncpy, use xstrdup to do the copying and strcspn to delete the newline
2013-04-10cmd_prompt: handle NULL outputJérémie Courrèges-Anglas
* if the user aborted we receive a NULL pointer; don't attempt to dereference it, and treat this case as a failure. Matches the behaviour of cmd_colon and cmd_select
2013-02-22fixup return values of several commandsJérémie Courrèges-Anglas
* in cmd_select(), consistently set the return value for all cases we deal with * in cmd_unmanage(), don't attempt to use a NULL pointer if the unmanaged windows list is empty; just report success * in cmd_kill, only report failure if XKillClient() actually failed * in command(), remove a useless test: cmd can't be NULL * in cmd_gravity, don't call current_window() twice
2013-02-18more correct cmd_help()Jérémie Courrèges-Anglas
* only print the "Command key: ..." bits if we're dealing with the root kmap * don't read (and print) uninitialized data (foomap->actions[foomap->actions_last] shouldn't be accessed) It seems like keymap actions and other things like aliases use arrays because they were implemented before linkedlist.[ch] were introduced. Perhaps should we just switch them to more fool-proof linked lists?
2013-02-06rp_text_width: remove "font" argumentJérémie Courrèges-Anglas
* (globals.[ch]): remove rp_text_width "font" arg, since its value is always the global variable defaults.font (non-Xft case). remove one #ifdef while here * update rp_text_width() calls to match new signature
2013-01-20tmpwm fix: SIG_IGN -> SIG_DFLJérémie Courrèges-Anglas
for waitpid(SIGCHLD, SIG_IGN) behaves wildly differently across OSes. Fixes tmpwm hanging after child wm exits on OpenBSD.
2012-12-26environment handling fixesJérémie Courrèges-Anglas
* AC_CHECK_FUNCS: +setenv +unsetenv -putenv (the check for putenv() wasn't used anyway) * prefer setenv() to putenv() in cmd_setenv() * prefer unsetenv() to putenv() in cmd_unsetenv() - putenv("FOO") isn't legit everywhere - putenv("FOO=") will only work on MinGW * make the getenv command return an empty output if the variable wasn't found * while here, split and sort AC_CHECK_FUNCS |cos| on #ratpoison reported that environment variables weren't properly removed, and proposed a different fix. thanks!
2012-07-01cmd_info: also display a window not in the current groupBernhard R. Link
Without this change, cmd_info displays "No Window" if called with the current window not in the current group (for example directly after a gselect). This change makes it also look in other groups. In that case it might show a number not the one to switch back to it without switching the group first, but I guess that is less confusing than just claiming there is no window.
2010-05-18add a titlechanged hookZed Lopez
2010-05-07fix alias bugKeith Amling
When an alias is executed without arguments, for example aliasing "reload" to "source .ratpoisonrc" and then running "reload" by itself results in "source: .ratpoisonrc : No such file or directory" implying it was trying to load ".ratpoisonrc " (note the extra space).
2010-03-31Cleaned up some cmdret, sbuf, char * usage; eliminating associated memory leaksKipling Inscore
2010-03-17fix swap across multiple screensBernhard R. Link
exchange_with_frame now always selects the second frame given, simplifying the code (getting rid of segfaults when both were on different screens). This changes the behaviour of cmd_swap to always focus the first argument when two arguments are given. This patch also removes the screen argument of exchange_with_frame, which is now no longer needed (and cmd_swap was giving the wrong screen anyway in the case of multiple arguments given).
2010-01-31change error message for gdelete to reduce confusion.Shawn Betts
2010-01-31cother/iother Segfault patchRob Paisley
As reported by "Gentooer" in the #ratpoison IRC channel, there is a bug in :cother and :iother. If are no windows and you issue either :cother, or :iother ratpoison segfaults. This patch resolves the issue.
2009-07-15silence gcc false-positive undefined warningBernhard R. Link
2009-07-15silence unused variables and unused parameters warningsBernhard R. Link
2009-07-15do not shadow identifiers (silencing gcc's -Wshadow warnings)Bernhard R. Link
2009-07-04fix inverted text when using xftwinliststyle-row_brokenShawn Betts
Now the inverted rectangle is drawn first and the text overtop in the bg color.