summaryrefslogtreecommitdiff
path: root/src/main.c
AgeCommit message (Collapse)Author
2013-04-13read_rc_file: use getline(3) instead of emulating itJérémie Courrèges-Anglas
2013-04-10main: in case XOpenDisplay fails, use exit not returnJérémie Courrèges-Anglas
* this is consistent with surrounding code, and helps code analyzers not to barf about possible memory leaks
2013-04-10strtok_ws: account for erroneous usageJérémie Courrèges-Anglas
* if s and last are both NULL then we'll get a fatal error; instead of waiting for the segfault, display an error message and call abort()
2013-04-10main: free display and alt_rcfileJérémie Courrèges-Anglas
* otherwise specifying -d or -f more than once would lead to a memory leak
2013-04-07In strtok_ws() use "last", not "pointer" for the static variableJérémie Courrèges-Anglas
* since X11/Xdefs.h may define it too. Found by -Wshadow. Bonus: "last" carries more meaning.
2013-02-22make ratpoison -c provide a useful exit statusJérémie Courrèges-Anglas
* properly define the way the wm may give feedback to ratpoison -c; see communications.c:receive_command_result() * follow this protocol in events.c:receive_command() * modify receive_command_result() to return an int (which is the mirror of the struct cmdret "success" member used on the wm side) * pass that error status back to main.c; exit with an error status if any of the commands we sent failed
2013-02-13move xa_string initialisation before first useBernhard R. Link
otherwise ratpoison -c no longer works
2013-02-06make TEXT atoms global variablesJérémie Courrèges-Anglas
* (events.c) extract xa_compound_text from selection_request(), make it a global * introduce xa_string (same as XA_STRING) and rename utf8_string to xa_utf8_string, for consistency
2013-02-06introduce defaults.utf8_localeJérémie Courrèges-Anglas
* use nl_langinfo() to detect if locale codeset is UTF-8
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.
2009-04-30fix 'set fgcolor' for xft. Change screen's ft_font and color slots to ↵Shawn Betts
xft_font and xft_color.
2009-01-16set _net_wm_name for the root window to ratpoisonBernhard R. Link
2009-01-16Move screen activation code to new (de)activate_screen functions,Bernhard R. Link
making sure _NET atoms are reset after tmpwm and deleted when exiting.
2008-10-22make history expansion an option (switched off by default)Bernhard R. Link
2008-10-22add 'set historysize' and 'set historycompaction' (defaulting to true) to ↵Bernhard R. Link
compact history
2008-10-22move all HAVE_HISTORY into history.cBernhard R. Link
2008-10-10allow window border color to be set seperately for focused and unfocused windowsKipling Inscore
2008-06-22make xstrdup argument const char*Bernhard R. Link
2008-06-20support the netwm dialog window typeShawn
2008-06-16update copyright noticeShawn Betts
2008-05-25don't free defaults.font when xft is enabledShawn
2008-05-24Add xft supportMidare Kiyura
2007-08-14src/main.c (xvsprintf): limit memory allocation to 200K when vsnprintf ↵brl
return -1.
2007-07-18free more stuff at termination time to make valgrind output better readablebrl
2007-05-07(init_defaults): only load the backup font when thesabetts
default font fails.
2007-05-04* src/main.c (init_defaults): if the default font fails, use thesabetts
backup font. * src/conf.h (BACKUP_FONT): new define
2007-03-08* src/split.c (set_active_frame): call switch_frame hooksabetts
(show_frame_indicator): only show frame indicator (set_active_frame): new arg force_indicator. all callers updated. (show_frame_indicator): new arg force. all callers updated. * src/main.c (init_defaults): init bar_in_padding * src/globals.c (rp_switch_screen_hook): new hook * src/data.h (struct rp_defaults): new slot, bar_in_padding * src/bar.c (bar_x): honour bar_in_padding setting (bar_y): likewise * src/actions.c (init_set_vars): add barinpadding (set_barinpadding): new function * src/globals.h: new global rp_switch_screen_hook
2006-11-17* src/split.c (show_frame_indicator): use defaults.frame_fmtsabetts
(show_frame_message): format frame_fmt string with format_string * src/messages.h (MESSAGE_FRAME_STRING): removed * src/main.c (init_defaults): init defaults.frame_fmt * src/data.h (struct rp_defaults): add frame_fmt * src/actions.c (set_framefmt): new function (init_set_vars): new set var "framefmt"
2006-10-04(strtok_ws): remove useless debug ouput.sabetts
2006-09-27*** empty log message ***sabetts
2006-05-24* src/xinerama.c (free_xinerama): take void arguments. prototype updated.sabetts
(init_xinerama): likewise * src/window.c (init_window_stuff): take void arguments. prototype updated. (free_window_stuff): likewise * src/split.c (remove_all_splits): take void arguments. prototype updated. (current_frame): likewise (init_frame_lists): likewise (find_last_frame): likewise (current_window): likewise (remove_all_splits): likewise (hide_frame_indicator): likewise (show_frame_indicator): likewise * src/main.c (check_child_procs): take void arguments. prototype updated. (clean_up): likewise * src/number.c (numset_new): take void arguments. prototype updated. * src/manage.c (clear_unmanaged_list): take void arguments. prototype updated. (list_unmanaged_windows): likewise (ungrab_keys_all_wins): likewise (grab_keys_all_wins): likewise (current_screen): likewise (unhide_all_windows): likewise * src/main.c (sighandler): static function (hup_handler): likewise (alrm_handler): likewise (handler): likewise (print_version): likewise (print_help): likewise (show_welcome_message): take void arguments (init_defaults): likewise * src/input.c (ring_bell): take void arguments. prototype updated (update_modifier_map): likewise * src/history.c (get_history_filename): take void arguments (history_load): take void arguments. prototype updated (history_save): likewise (history_reset): likewise (history_previous): likewise (history_next): likewise (history_list_items): likewise * src/group.c (group_in_list): static function (init_groups): take void arguments. prototype updated (free_groups): likewise (group_next_group): likewise (group_prev_group): likewise * src/globals.c (x_export_selection): take void arguments (get_cut_buffer): likewise (get_primary_selection): likewise (get_selection): take void arguments. protype updated. (init_globals): likewise * src/events.c (selection_clear): take void arguments (handle_signals): likewise (listen_for_events): take void argumens. prototype updated * src/bar.c (reset_alarm): take void arguments (show_last_message): take void arguments. prototype updated. (free_bar): likewise * src/actions.c (init_set_vars): static function. take void arguments (clear_frame_redos): take void arguments (pop_frame_undo): likewise (pop_frame_redo): likewise (keymap_new): static function (parse_keydesc): likewise (trivial_completions): likewise (keymap_completions): likewise (window_completions): likewise (group_completions): likewise (colon_completions): likewise (exec_completions): likewise (hook_completions): likewise (var_completions): likewise (update_all_gcs): take void arguments (grab_rat): likewise (ungrab_rat): likewise (init_user_commands): take void arguments. prototype updated. (free_keymaps): likewise (free_aliases): likewise
2006-05-15* src/manage.c (grab_top_level_keys): use defaults.top_kmap for the top kmapsabetts
* src/main.c (init_defaults): init defaults.top_kmap * src/events.c (handle_key): use defaults.top_kmap for the top kmap * src/data.h (struct rp_defaults): new field, top_kmap * src/actions.c (set_topkmap): new prototype (init_set_vars): topkmap new set variable (initialize_default_keybindings): use defaults.top_kmap for the top kmap (cmd_undefinekey): likewise (cmd_definekey): likewise (cmd_escape): likewise (cmd_delkmap): likewise (set_topkmap): new function
2006-04-21(print_version): print build datesabetts
2006-04-20* src/split.c (show_frame_message): use XmbDrawString and XmbTextEscapementsabetts
* src/screen.c (init_screen): don't include the font in the gc * src/ratpoison.h: include Xlocale.h * src/manage.c (get_wmname): support i18n characters * src/main.c (init_defaults): call load_query_font_set and set_extents_of_fontset (main): call setlocale (clean_up): call XFreeFontSet (set_extents_of_fontset): new function (load_query_font_set): likewise * src/input.c (update_input_window): use XmbTextEscapement and XmbDrawString * src/globals.h (FONT_HEIGHT): use rp_font_ascent and rp_font_descent (MAX_FONT_WIDTH): use rp_font_width new globals rp_font_ascent, rp_font_descent, rp_font_width * src/globals.c: new globals rp_font_ascent, rp_font_descent, rp_font_width * src/data.h (struct rp_defaults): font is a XFontSet * src/bar.c (max_line_length): call XmbTextEscapement (draw_string): call XmbDrawString (get_mark_box): call XmbTextEscapement * src/actions.c (read_frame): call XmbTextEscapement (cmd_license): likewise (read_frame): call XmbDrawString (cmd_license): likewise (cmd_help): likewise (update_gc): don't include the font (set_font): call load_query_font_set
2006-03-16* src/main.c (clean_up): use list_size not rp_num_frame_undossabetts
* src/globals.c: remove global var rp_num_frame_undos. All callers updated. * src/actions.c (push_frame_undo): use list_size, not rp_num_frame_undos (set_maxundos): likewise
2006-03-16* src/window.c (_XOPEN_SOURCE): new definesabetts
* src/screen.c (is_a_root_window): w is unsigned int (init_screen): typecast _net_wm_pid as unsigned char*. * src/main.c (read_rc_file): linesize is size_t * src/frame.c (frame_read): use a temp var when reading the :dedicated value. * src/bar.c (max_line_length): i and start are size_t (draw_string): i is size_t (get_mark_box): mark_start and mark_end are size_t * src/actions.c (find_keybinding): state is unsigned int (remove_keybinding): likewise (frame_selector): n is unsigned int (frame_selector_match): i is size_t. typecast comparison as size_t.
2006-03-16remove tabs and trailing whitespace.sabetts
2006-03-15(init_user_commands): add optional argument to "info"sabetts
(cmd_info): handle optional argument * src/format.c: new file * src/format.h: new file * Makefile.am (ratpoison_SOURCES): add format.c and format.h * src/actions.c (set_infofmt): new function (wingravity_to_string): char * instead of static char * because needed in format.c (cmd_info): use format_string * src/actions.h (wingravity_to_string): add prototype * src/data.h (info_fmt): new variable * src/main.c (init_defaults): set a value for defaults.info_fmt * src/ratpoison.h: include format.h * src/windows.c (get_window_list): use format_string (isdigit): remove function as the formatting is now done in format.c (concat_width): likewise (format_window_name): likewise
2006-03-08* src/main.c (clean_up): properly free rp_frame_numsetsabetts
* src/editor.c (editor_enter): free line->buffer before setting it to the history expansion. * src/completions.c (completions_free): free the rp_completions struct too * src/actions.c (del_frame_undo): free the rp_frame_undo struct too.
2006-01-03* src/number.c (numset_add_num): store the ret val ofsabetts
numset_find_empty_cell in a variable and use it as an index into the numbers_taken array. * src/actions.c (cmd_curframe): return the frame number in non-interactive mode. * src/split.c (cleanup_frame): in the maxsize windows are transients check either the width or height must be less than the screen width/height (just like in windows.c).
2005-10-20* src/window.c: include unistd.hsabetts
(get_child_info): new function (add_to_window_list): get the window's client's pid if possible and assign the window the appropriate group and frame. (add_to_window_list): init intended_frame_number (save_mouse_position): save the position relative to the window (give_window_focus): restore the position relative to the window (set_active_window_body): put the window in the frame contained in intended_frame_number when appropriate. * src/screen.c (screen_find_frame_by_frame): new function (init_screen): add the net_supported atom to the root window. * src/main.c (main): init netwm atoms * src/group.c (groups_find_group_by_group): new function * src/globals.c (_net_wm_pid, _net_supported): new globals * src/data.h (struct rp_window): new field intended_frame_number. (struct rp_child_info): new fields group, frame, screen. * src/actions.c (spawn): call the command directly when new argument, raw, is non zero. all callers updated. (spawn): fill in the frame, group and screen for the child.
2005-06-11* src/main.c (clean_up): call del_frame_undo not pop_frame_undosabetts
* src/globals.h: new global prototype rp_frame_redos * src/globals.c: new global rp_frame_redos * src/actions.h: new command 'undo' (del_frame_undo): new prototype (pop_frame_undo): delete prototype * src/actions.c (init_user_commands): new command 'undo' (clear_frame_redos): new function (del_frame_undo): likewise (push_frame_undo): call del_frame_undo instead of pop_frame_undo. call clear_frame_redos. (pop_frame_list): new function (pop_frame_undo): returns the popped frame. all callers updated. (pop_frame_redo): new function (initialize_default_keybindings): bind undo to u and C-u, bind redo to U. (set_maxundos): call del_frame_undo instead of pop_frame_redo (cmd_redo): new function
2005-03-05* src/ratpoison.h (check_child_procs): new prototypesabetts
(chld_handler): likewise (set_sig_handler): likewise * src/main.c (check_child_procs): new function (chld_handler): call check_child_procs (free_screen): unselect all events on the root window. * src/actions.c: include signal.h (spawn): don't prefix the command with exec. (set_wingravity): print the setting as a string. (set_transgravity): likewise (set_maxsizegravity): likewise (set_bargravity): likewise (set_font): likewise (set_winfmt): likewise (set_fgcolor): likewise (set_bgcolor): likewise (set_framesels): likewise (cmd_tmpwm): ungrab the keys for all windows before spawning the new wm. (cmd_tmpwm): disable the sigchld handler then enabled it after the wm returns. call check_child_procs.
2005-02-22* src/main.c (read_startup_files): use xsprintf when generatingsabetts
path to ratpoisonrc. * src/input.c (get_more_input): Use HAVE_HISTORY to ifdef out history_reset. * src/actions.c (command): new variable, raw, which records whether to tell parse_args not to parse the last arg. (cmd_set): likewise
2005-02-10(main): set the RATPOISON env. variable to the pathsabetts
to this executable.
2005-01-15(main): Report extra unparsed arguments.sabetts
2005-01-15(init_defaults): turn off warp by default.sabetts
doc updates
2005-01-15 * src/actions.c (ARG_STRING): new definesabetts
(ARG): likewise (set_vars): change to a list_head. (add_set_var): new function (init_set_vars): likewise (user_commands): change to a list_head. Move command definitions to init_user_commands. (add_command): new function (init_user_commands): likewise (cmdret_new): likewise (cmdret_new_printf): likewise (cmdret_free): likewise (read_string): likewise (read_keymap): likewise (read_keydesc): likewise (read_command): likewise (read_shellcmd): likewise (read_frame): likewise (read_window): likewise (read_gravity): likewise (read_group): likewise (read_hook): likewise (read_variable): likewise (hook_completions): likewise (read_number): likewise (read_arg): likewise (parsed_input_to_args): likewise (fill_in_missing_args): likewise (parse_args): likewise (arg_array): likewise (arg_free): likewise (command): use parse_args, parsed_input_to_args, fill_in_missing_args to parse arguments and pass to command functions. (command): return cmdret* structure. prototype updated. (cmd_abort): second arg is an array of struct cmdarg*. Return cmdret*. Updated to use new parsed arguments. (cmd_addhook): likewise (cmd_alias): likewise (cmd_banish): likewise (cmd_bind): likewise (cmd_chdir): likewise (cmd_clrunmanaged): likewise (cmd_colon): likewise (cmd_curframe): likewise (cmd_delete): likewise (cmd_echo): likewise (cmd_escape): likewise (cmd_exec): likewise (cmd_fdump): likewise (cmd_focusdown): likewise (cmd_focuslast): likewise (cmd_focusleft): likewise (cmd_focusright): likewise (cmd_focusup): likewise (cmd_frestore): likewise (cmd_fselect): likewise (cmd_gdelete): likewise (cmd_getenv): likewise (cmd_gmerge): likewise (cmd_gmove): likewise (cmd_gnew): likewise (cmd_gnewbg): likewise (cmd_gnext): likewise (cmd_gprev): likewise (cmd_gravity): likewise (cmd_groups): likewise (cmd_gselect): likewise (cmd_h_split): likewise (cmd_help): likewise (cmd_info): likewise (cmd_kill): likewise (cmd_last): likewise (cmd_lastmsg): likewise (cmd_license): likewise (cmd_link): likewise (cmd_listhook): likewise (cmd_meta): likewise (cmd_msgwait): likewise (cmd_newwm): likewise (cmd_next): likewise (cmd_next_frame): likewise (cmd_nextscreen): likewise (cmd_number): likewise (cmd_only): likewise (cmd_other): likewise (cmd_prev): likewise (cmd_prev_frame): likewise (cmd_prevscreen): likewise (cmd_quit): likewise (cmd_redisplay): likewise (cmd_remhook): likewise (cmd_remove): likewise (cmd_rename): likewise (cmd_resize): likewise (cmd_restart): likewise (cmd_rudeness): likewise (cmd_select): likewise (cmd_setenv): likewise (cmd_shrink): likewise (cmd_source): likewise (cmd_startup_message): likewise (cmd_time): likewise (cmd_tmpwm): likewise (cmd_unalias): likewise (cmd_unbind): likewise (cmd_unimplemented): likewise (cmd_unmanage): likewise (cmd_unsetenv): likewise (cmd_v_split): likewise (cmd_verbexec): likewise (cmd_version): likewise (cmd_warp): likewise (cmd_windows): likewise (cmd_readkey): likewise (cmd_newkmap): likewise (cmd_delkmap): likewise (cmd_definekey): likewise (cmd_undefinekey): likewise (cmd_set): likewise (cmd_sselect): likewise (cmd_ratwarp): likewise (cmd_ratclick): likewise (cmd_ratrelwarp): likewise (cmd_rathold): likewise (cmd_cnext): likewise (cmd_cother): likewise (cmd_cprev): likewise (cmd_dedicate): likewise (cmd_describekey): likewise (cmd_inext): likewise (cmd_iother): likewise (cmd_iprev): likewise (cmd_prompt): likewise (cmd_sdump): likewise (cmd_sfdump): likewise (cmd_undo): likewise (cmd_putsel): likewise (cmd_getsel): likewise (set_resizeunit): arg is an array of struct cmdarg*. Return cmdret*. Updated to use new parsed arguments. (set_wingravity): likewise (set_transgravity): likewise (set_maxsizegravity): likewise (set_bargravity): likewise (set_font): likewise (set_padding): likewise (set_border): likewise (set_barborder): likewise (set_inputwidth): likewise (set_waitcursor): likewise (set_winfmt): likewise (set_winname): likewise (set_fgcolor): likewise (set_bgcolor): likewise (set_barpadding): likewise (set_winliststyle): likewise (set_framesels): likewise (set_maxundos): likewise * src/actions.h: include ratpoison.h (argtype): add arg_FRAME, arg_WINDOW, arg_COMMAND, arg_SHELLCMD, arg_KEYMAP, arg_KEY, arg_GRAVITY, arg_GROUP, arg_HOOK, arg_VARIABLE. (union arg_union): new union (struct cmdarg): new struct (struct argspec): likewise (struct cmdret): likewise (user_command): change func to reflect new command function args. add num_args, ni_required_args, i_required_args. (RP_CMD): new macro for prototyping command functions. all command function prototypes updated to use this macro. (init_user_commands): new prototype (cmdret_free): likewise * src/main.c (read_rc_file): handle cmdret* returned by command. (main): call init_user_commands * src/linkedlist.h (list_size): new prototype * src/linkedlist.c (list_size): new function * src/globals.h (RET_SUCCESS): new define (RET_FAILURE): new define * src/events.c (handle_key): handle the cmdret structure returned by command. (execute_remote_command): return cmdret*. (receive_command): mark the command return string as error or output before sending. * src/data.h (struct rp_action): change data element type to char* * src/communications.c (receive_command_result): print command output to stderr if marked as an error.