summaryrefslogtreecommitdiff
path: root/src/manage.c
AgeCommit message (Collapse)Author
2017-03-10At init time, add unmapped windows to the default (first) screen.Jérémie Courrèges-Anglas
Kills an error message and fixes a "regression" in my setup. Previously, if xinerama was not active (disabled or screen count == 1), out-of-screen windows were added to screen 0 and were considered "managed".
2017-02-15Merge branch 'xrandr'Jérémie Courrèges-Anglas
All the hard work on xrandr done by Mathieu OTHACEHE, thanks!
2016-12-21Add a hide_screen_windows functionMathieu OTHACEHE
This function is useful to find the windows displayed on a specific screen and hide them.
2016-12-09no parameter -> void; C and C++ differ hereJérémie Courrèges-Anglas
2016-12-09Adapt function nameJérémie Courrèges-Anglas
2016-12-08Simplify scanwins functionMathieu OTHACEHE
Use find_screen_by_attr function, remove screen argument and a useless debug message.
2016-12-08Remove useless argument from is_rp_window_for_screen functionMathieu OTHACEHE
The screen argument is useless as this function operates on all screens. To find if a window belong to a specific ratpoison screen, function is_rp_window_for_given_screen may be used.
2016-11-23Kill redundant declJérémie Courrèges-Anglas
2016-11-17Add xrandr supportMathieu OTHACEHE
Drop deprecated xinerama support and replace it with xrandr. Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
2014-03-24Indent function calls in unmanaged_window.Jérémie Courrèges-Anglas
2014-03-24Make unmanaged_window cheaper.Jérémie Courrèges-Anglas
* No need to get then free the window name in the loop, do it out of the loop.
2014-03-04Simplify list_unmanaged_windows using sbufJérémie Courrèges-Anglas
2013-06-04silence compilation warning in src/manage.cJérémie Courrèges-Anglas
2013-04-27avoid get_wmname spammingJérémie Courrèges-Anglas
This should be a PRINT_DEBUG, not a PRINT_ERROR.
2013-02-18silence minor compilation warning in src/manage.cJérémie Courrèges-Anglas
2013-02-06use utf8-handling Xft functions if we are in an UTF-8 localeJérémie Courrèges-Anglas
* (manage.c) in get_wmname(), try to get the (UTF-8 encoded) _NET_WM_NAME property. Fallback to GetWMName() if unavailable. Add some debugging bits to see which TEXT encoding clients use for WM_NAME. * (globals.c) use Xft*Utf8 functions to compute text width and draw strings. No regressions with or without Xft, UTF-8 locale or not. * assume we can use Xft*Utf8 functions whenever we have Xft, to reduce the #ifdef dance Original patch from Bernhard R. Link
2010-04-12add a new_window_hook to the map_window function of manage.c.Eric A
2008-11-18fix AUTO_CLOSE code in unmanage()Shawn
2008-10-10in get_net_wm_window_type, only call XFree on successShawn
This fixes a crash bug that was reproduced by running dolphin (the kde file manager).
2008-10-10choose a better approach to setting the border color in remove_frameShawn
* remove call to give_window_focus in remove_frame * set the border color in hide_window calling give_window_focus in remove_frame was plain incorrect. setting it in hide_window might be considered overkill but I believe it will catch this case and any others that might be lurking.
2008-06-20support the netwm dialog window typeShawn
2007-07-19src/manage.c (update_window_name): call get_class_hints directly to avoid it ↵brl
being called two times
2007-07-19src/manage.c (get_wmname): always try XmbTextPropertyToTextList first to ↵brl
also support UTF-8 window titles when encoded as XA_STRING
2007-05-19* src/manage.c (get_wmname): free buffer to close memory holebrl
2006-12-19(force_maximize): remove call to usleepsabetts
2006-12-14*** empty log message ***sabetts
2006-09-26* src/manage.c (update_window_name): return 1 if anything changed. 0 otherwise.sabetts
* src/events.c (property_notify): only update the window names if the window name actually changed. * src/bar.h (redraw_last_message): new prototype * src/bar.c (update_bar): update the window list if that's what's displayed. call redraw_last_message. (update_window_names): call marked_message_internal. (marked_message): call marked_message_internal. (marked_message_internal): ripped body from old marked_message minus alarm reset. (redraw_last_message): new function (show_last_message): call redraw_last_message * src/actions.c: include ctype.h (cmd_license): use redraw_last_message (cmd_help): likewise
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-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-04-04* src/messages.h (MESSAGE_MAP_TRANSIENT_GROUP): new definesabetts
(MESSAGE_MAP_WINDOW_GROUP): likewise * src/manage.c (map_window): call show_rudeness_msg * src/events.h (show_rudeness_msg): new prototype * src/events.c (show_rudeness_msg): renamed from show_rudeness_raise_msg. handle the MAP messages as well. all callers updated.
2006-03-16remove tabs and trailing whitespace.sabetts
2006-03-14* src/manage.c (ungrab_top_level_keys): unconditionally ungrab every key.sabetts
* src/events.c (mapping_notify): call ungrab_keys_all_wins and grab_keys_all_wins.
2006-03-11*** empty log message ***sabetts
2006-01-05* src/conf.h (ASPECT_WINDOWS_ARE_TRANSIENTS): new definesabetts
* src/manage.c (window_is_transient): new function (maximize_normal): honour aspect ratio hint * src/window.c (update_window_gravity): use maxsize_gravity for windows with aspect hints. (set_active_window_body): call window_is_transient * src/split.c (cleanup_frame): call window_is_transient
2005-12-11* src/manage.c (withdraw_window): call rp_delete_window_hook hooksabetts
* src/globals.c: new hook rp_delete_window_hook
2005-11-05* src/manage.h (unhide_all_windows): new prototypesabetts
* src/manage.c (unhide_all_windows): new function. * src/events.c (handle_signals): unhide windows before switching to a new wm
2004-12-06remove call to numset_release.sabetts
2004-12-04update copyright.sabetts
2004-12-02Updated copyright notices.sabetts
2004-11-18* src/window.c (unhide_transient_for): add a newline to debuggingsabetts
output. (hide_transient_for_between): likewise. * src/manage.c (get_wmname): typecast name when passing to xstrdup. * src/main.c (main): typecast command[i] when passing to send_command. * src/events.c (execute_remote_command): typecast req[1] when passing to command. (receive_command): typecast result when passing to XChangeProperty. * src/editor.c (editor_history_previous): Add newline to debugging output. (editor_history_next): likewise. (paste_primary_selection): typecast data when passing to editor_insert. * src/communications.c (receive_command_result): typecast result when passing to strlen. (send_command): typecast cmd when passing the XChangeProperty. * src/actions.c (user_commands): add focusprev (cmd_prev): clean up (cmd_next): likewise (cmd_prev_frame): call find_frame_prev instead of find_frame_next. (cmd_frestore): grab the frame's number first when processing the frames.
2004-09-29* configure.in: Warn when the history header or library is notsabetts
found and compile without history support. * src/ratpoison.h: change ifdef to check for HAVE_HISTORY. * src/manage.c (get_state): change data to an unsigned char and cast data to a long* when it's used. * src/main.c (main): change ifdef to check for HAVE_HISTORY. (clean_up): likewise * src/history.c: change ifdef to check for HAVE_HISTORY. * src/events.c (receive_command): make prop_return an unsigned char. * src/editor.c (editor_history_previous): change ifdef to check for HAVE_HISTORY. (editor_history_next): likewise (editor_enter): likewise
2004-06-03* src/number.c (numset_add_num): add debugging output to print the args.sabetts
(numset_release): likewise (numset_request): add debugging output to print the requested number * src/manage.c (withdraw_window): Print an error when withdrawing a window who's number is -1. * src/main.c (clean_up): free the global frame numset. (free_screen): don't free the screen's numset, since it's a pointer to the global numset. * src/group.c (group_del_window): don't release the window number here. It's already been done in group_unmap_window. * src/events.c (configure_request): only change the stack mode for non withdrawn windows.
2004-04-24* src/data.h (struct rp_defaults): new members, font_string,sabetts
fgcolor_string, bgcolor_string. * src/actions.c (set_font): return defaults.font_string when data is NULL (set_fgcolor): likewise for fgcolor_string (set_bgcolor): likewise for bgcolor_string * src/manage.c (ungrab_top_level_keys): properly grab capital letters. * src/main.c (init_defaults): init fgcolor_string, bgcolor_string, and font_string * src/input.c (grab_key): change keysym type to KeySym. convert keysym to keycode. All callers updated.
2004-04-18* src/manage.h (ungrab_keys_all_wins): new prototypesabetts
(grab_keys_all_wins): likewise * src/manage.c (grab_top_level_keys): renamed from grab_prefix_key (all callers updated). Grab all keys in the top level keymap. (ungrab_top_level_keys): renamed from ungrab_prefix_key (all callers updated). ungrab all keys in the top level keymap. (ungrab_keys_all_wins): new function (grab_keys_all_wins): likewise * src/globals.c: (rp_key_hook): rename from rp_prefix_hook. Dependant code updated. (set_rp_window_focus): change 'prefix' hook to 'key' hook. * src/events.c (handle_key): handle a top level key press. (handle_key): new arguments ks, and mod. (key_press): pass the keysym and modifier to handle_key * src/conf.h (TOP_KEYMAP): new define * src/actions.c (cmd_v_split, cmd_h_split): swap names. (user_commands): bind split to cmd_v_split. (initialize_default_keybindings): initialize the top level keymap (cmd_definekey): update the keys grabbed when changing a key on the top level keymap. (cmd_escape): update the escape key in the top level map. (cmd_delkmap): don't allow the deletion of the top level keymap.
2004-02-27new filessabetts
2004-02-27* src/window.c (give_window_focus): save the mouse position beforesabetts
checking if win is NULL. (give_window_focus): set rp_current_screen to xine_screen_num of the window's screen. (set_active_window): when using xinerama get the frame from the current screen. * src/split.c (set_frames_window): update the window's scr attribute to point to the frame's screen. (find_window_for_frame): when xinerama is being used search all windows. (set_active_frame): update rp_current_screen to point to the frame's screen. * src/screen.h (init_screens): new prototype (is_rp_window_for_screen): likewise * src/screen.c: include string.h and X11/cursorfont.h (init_screens): new function (is_rp_window_for_screen): new function. (init_screen): fill in xine_screen_num when using xinerama. * src/ratpoison.h: include xinerama.h * src/manage.c (current_screen): use xine_screen_num to find the current screen. (scanwins): use is_rp_window_for_screen to skip over ratpoison windows. (scanwins): when using xinerama only manage windows inside the viewable area. * src/main.c (main): call init_xinerama and init_screens. Move screen initing code to these functions. (init_rat_cursor): move to screen.c (init_screen): likewise (find_screen): likewise (clean_up): call free_xinerama * src/group.c (group_last_window): only check windows in the current screen, unless xinerama is being used in which case all windows are accessible. (group_next_window): likewise (group_prev_window): likewise * src/globals.h: new globals rp_have_xinerama, xine_screen_num. * src/events.c (new_window): when using xinerama, the new window's screen is the current screen. (key_press): when using xinerama, use the current screen. * src/data.h (struct rp_screen): remove root_attr and add left, top, width, height. All dependant code updated. Add xine_screen_num. * src/actions.c (cmd_remove): show the frame indicator in the new current frame after removing the frame. * src/Makefile.am (ratpoison_SOURCES): add xinerama.c and xinerama.h
2003-08-23* src/split.c (remove_all_splits): only hide the windows in thesabetts
current screen. * src/group.h (group_delete_group): new prototype * src/group.c (group_last_window): find the last window in the current screen. (group_next_window): find next window in current screen. (group_prev_window): find previous window in current screen. * src/manage.c (force_maximize): call XSync() after first resize. * src/globals.h (GROUP_DELETE_GROUP_OK): new define (GROUP_DELETE_GROUP_NONEMPTY): likewise * src/actions.h (cmd_gdelete): new prototype * src/actions.c (user_commands): new command gdelete (cmd_gdelete): new command
2003-05-25* src/window.c: do not include ctype.hsabetts
* src/ratpoison.h (str_comp): new prototype * src/messages.h (MESSAGE_PROMPT_SWITCH_TO_GROUP): new define * src/main.c: include ctype.h (str_comp): moved from window.c * src/group.h (groups_find_group_by_name): new prototype. (groups_find_group_by_number): likewise. (groups_merge): likewise (group_move_window): likewise * src/group.c: include string.h (group_new): new argument, name. All callers updated. prototype updated. (init_groups): create the first group with DEFAULT_GROUP_NAME as its name. (group_new): new argument, name. All callers updated. Prototype updated. (group_free): free the group's name. (group_add_new_group): new argument, name. All callers updated. Prototype updated. (groups_find_group_by_name): new function (groups_find_group_by_number): likewise (group_move_window): likewise (groups_merge): likewise * src/conf.h (DEFAULT_GROUP_NAME): new define * src/actions.h (cmd_gselect): new prototype (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise (cmd_gnewbg): likewise * src/actions.c (user_commands): new commands gselect, groups, gmove, gmerge, gnewbg. (cmd_gnewbg): new function (find_group): likewise (cmd_gselect): likewise (cmd_groups): likewise (cmd_gmove): likewise (cmd_gmerge): likewise
2003-05-16* src/window.c (add_to_window_list): add the window to the currentsabetts
group. (find_window_name): search the current group for a matching window. (find_window_other): likewise. (format_window_name): take a rp_window_elem as an argument, not an rp_window. Print the group window's number, not the window's internal number. (get_window_list): loop through the current group. * src/split.c (find_window_for_frame): search the current group for a window to fit in the frame. * src/ratpoison.h: include globals.h and group.h * src/manage.c (unmanage): remove the window from any groups it was in. (map_window): map the window in any groups it is in. (withdraw_window): unmap the window in any groups it is in. * src/main.c: Move all globals to globals.h (main): initialize the group functions. * src/data.h: Move all defines and extern globals to globals.h (struct rp_window_elem): new struct (struct rp_group): likewise * src/actions.h (cmd_gnext): new prototype (cmd_gprev): likewise (cmd_gnew): likewise * src/actions.c (user_commands): new commands gnext, gprev, and gnew (cmd_prev): fix to work with new group code. (cmd_next): likewise (cmd_gnext): new function (cmd_gprev): likewise (cmd_gnew): likewise * src/Makefile.am (ratpoison_SOURCES): add files globals.h, globals.c, group.h and group.c