diff options
-rw-r--r-- | data/uncrustify.cfg | 4 | ||||
-rw-r--r-- | include/dialogs/dmenu.h | 1 | ||||
-rw-r--r-- | include/dialogs/script.h | 1 | ||||
-rw-r--r-- | include/helper.h | 1 | ||||
-rw-r--r-- | include/history.h | 2 | ||||
-rw-r--r-- | include/keyb.h | 1 | ||||
-rw-r--r-- | include/rofi.h | 15 | ||||
-rw-r--r-- | include/textbox.h | 4 | ||||
-rw-r--r-- | include/x11-helper.h | 3 | ||||
-rw-r--r-- | include/xrmoptions.h | 1 | ||||
-rw-r--r-- | source/dialogs/dmenu.c | 7 | ||||
-rw-r--r-- | source/dialogs/run.c | 7 | ||||
-rw-r--r-- | source/dialogs/script.c | 7 | ||||
-rw-r--r-- | source/dialogs/window.c | 4 | ||||
-rw-r--r-- | source/helper.c | 56 | ||||
-rw-r--r-- | source/history.c | 1 | ||||
-rw-r--r-- | source/i3-support.c | 2 | ||||
-rw-r--r-- | source/keyb.c | 110 | ||||
-rw-r--r-- | source/rofi.c | 201 | ||||
-rw-r--r-- | source/textbox.c | 26 | ||||
-rw-r--r-- | source/x11-helper.c | 61 | ||||
-rw-r--r-- | source/xrmoptions.c | 274 | ||||
-rw-r--r-- | test/history-test.c | 1 | ||||
-rw-r--r-- | test/textbox-test.c | 2 |
24 files changed, 273 insertions, 519 deletions
diff --git a/data/uncrustify.cfg b/data/uncrustify.cfg index f5b7dbf9..8fc2b96e 100644 --- a/data/uncrustify.cfg +++ b/data/uncrustify.cfg @@ -1,7 +1,9 @@ # # My favorite format # -code_width = 100 +code_width = 140 +nl_max = 2 +ls_func_split_full = True indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs input_tab_size = 8 # original tab size output_tab_size = 4 # new tab size diff --git a/include/dialogs/dmenu.h b/include/dialogs/dmenu.h index 7d20b3a7..748587ec 100644 --- a/include/dialogs/dmenu.h +++ b/include/dialogs/dmenu.h @@ -1,7 +1,6 @@ #ifndef __DMENU_DIALOG_H__ #define __DMENU_DIALOG_H__ - /** * dmenu dialog. * diff --git a/include/dialogs/script.h b/include/dialogs/script.h index fed5189b..68d5248c 100644 --- a/include/dialogs/script.h +++ b/include/dialogs/script.h @@ -1,7 +1,6 @@ #ifndef __SCRIPT_DIALOG_H__ #define __SCRIPT_DIALOG_H__ - /** * @param str The input string to parse * diff --git a/include/helper.h b/include/helper.h index 250bea9b..cdd4bc7f 100644 --- a/include/helper.h +++ b/include/helper.h @@ -71,7 +71,6 @@ int find_arg_uint ( const char * const key, unsigned int *val ); */ int find_arg_int ( const char * const key, int *val ); - /** * @param key The key to search for * @param val Pointer to the string to set to the key value (if found) diff --git a/include/history.h b/include/history.h index 2ec59f9c..96b36840 100644 --- a/include/history.h +++ b/include/history.h @@ -10,7 +10,6 @@ */ void history_set ( const char *filename, const char *entry ) __attribute__( ( nonnull ) ); - /** * @param filename The filename of the history cache. * @param entry The entry to remove @@ -19,7 +18,6 @@ void history_set ( const char *filename, const char *entry ) __attribute__( ( no */ void history_remove ( const char *filename, const char *entry ) __attribute__( ( nonnull ) ); - /** * @param filename The filename of the history cache. * @param length The length of the returned list. diff --git a/include/keyb.h b/include/keyb.h index 71f10156..89cf4b4f 100644 --- a/include/keyb.h +++ b/include/keyb.h @@ -56,7 +56,6 @@ typedef enum _KeyBindingAction NUM_ABE } KeyBindingAction; - /** * Parse the keybindings. * This should be called after the setting system is initialized. diff --git a/include/rofi.h b/include/rofi.h index d2fc047a..8bdf098e 100644 --- a/include/rofi.h +++ b/include/rofi.h @@ -37,7 +37,6 @@ typedef enum typedef SwitcherMode ( *switcher_callback )( char **input, void *data ); typedef void ( *switcher_free )( Switcher *data ); - typedef const char * ( *get_display_value )( unsigned int selected_line, void *data, int *state ); /** * State returned by the rofi window. @@ -64,7 +63,6 @@ typedef enum MENU_LOWER_MASK = 0x0000FFFF } MenuReturn; - /** * @param tokens List of (input) tokens to match. * @param input The entry to match against. @@ -76,8 +74,7 @@ typedef enum * * @returns 1 when it matches, 0 if not. */ -typedef int ( *menu_match_cb )( char **tokens, const char *input, int case_sensitive, - unsigned int index, Switcher *data ); +typedef int ( *menu_match_cb )( char **tokens, const char *input, int case_sensitive, unsigned int index, Switcher *data ); /** * @param sw the Switcher to show. @@ -95,10 +92,9 @@ typedef int ( *menu_match_cb )( char **tokens, const char *input, int case_sensi * * @returns The command issued (see MenuReturn) */ -MenuReturn menu ( Switcher *sw, char **input, char *prompt, - unsigned int *selected_line, - unsigned int *next_pos, - const char *message ) __attribute__ ( ( nonnull ( 1, 2, 3, 4 ) ) ); +MenuReturn menu ( Switcher *sw, char **input, char *prompt, unsigned int *selected_line, unsigned int *next_pos, const char *message ) +__attribute__ ( ( nonnull ( 1, 2, 3, 4 ) ) ); + /** * @param sig The caught signal * @@ -268,7 +264,6 @@ struct _Switcher KeySym keysym; unsigned int modmask; - /** * A switcher normally consists of the following parts: */ @@ -313,7 +308,5 @@ struct _Switcher #define color_magenta_bold "\033[1;35m" #define color_cyan_bold "\033[1;36m" - - int show_error_message ( const char *msg, int markup ); #endif diff --git a/include/textbox.h b/include/textbox.h index 11d1df65..20252fe7 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -21,7 +21,6 @@ typedef struct int changed; } textbox; - typedef enum { TB_AUTOHEIGHT = 1 << 0, @@ -33,7 +32,6 @@ typedef enum TB_MARKUP = 1 << 20, } TextboxFlags; - typedef enum { // Render font normally @@ -202,7 +200,6 @@ int textbox_get_font_width ( textbox *tb ); */ double textbox_get_estimated_char_width ( void ); - /** * @param tb Handle to the textbox * @@ -243,6 +240,5 @@ void textbox_delete ( textbox *tb, int pos, int dlen ); void textbox_moveresize ( textbox *tb, int x, int y, int w, int h ); int textbox_get_estimated_char_height ( void ); - void textbox_text_markup ( textbox *tb, const char *text ); #endif //ROFI_TEXTBOX_H diff --git a/include/x11-helper.h b/include/x11-helper.h index afdf3eb0..faedb1d1 100644 --- a/include/x11-helper.h +++ b/include/x11-helper.h @@ -1,7 +1,6 @@ #ifndef X11_ROFI_HELPER_H #define X11_ROFI_HELPER_H - int window_get_prop ( Display *display, Window w, Atom prop, Atom *type, int *items, void *buffer, unsigned int bytes ) __attribute__ ( ( nonnull ( 4, 5 ) ) ); @@ -23,7 +22,6 @@ void window_set_atom_prop ( Display *display, Window w, Atom prop, Atom *atoms, int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned long *list, int count ); - /** * Window info. */ @@ -142,7 +140,6 @@ void x11_setup ( Display *display ); */ void create_visual_and_colormap ( Display *display ); - /** * @param display Connection to the X server. * @param name String representing the color. diff --git a/include/xrmoptions.h b/include/xrmoptions.h index 147add30..a0233d71 100644 --- a/include/xrmoptions.h +++ b/include/xrmoptions.h @@ -20,7 +20,6 @@ typedef enum */ void config_parse_xresource_options ( Display *display ); - /** * Parse commandline options. */ diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index d500486a..d92ed614 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -57,7 +57,6 @@ typedef struct _DmenuModePrivateData unsigned int cmd_list_length; } DmenuModePrivateData; - static char **get_dmenu ( unsigned int *length ) { char buffer[1024]; @@ -96,7 +95,6 @@ static char ** dmenu_mode_get_data ( unsigned int *length, Switcher *sw ) return rmpd->cmd_list; } - static void parse_pair ( char *input, struct range_pair *item ) { int index = 0; @@ -209,7 +207,6 @@ static void dmenu_mode_free ( Switcher *sw ) } DmenuModePrivateData *pd = (DmenuModePrivateData *) sw->private_data; - g_strfreev ( pd->cmd_list ); g_free ( pd->urgent_list ); g_free ( pd->active_list ); @@ -295,8 +292,7 @@ int dmenu_switcher_dialog ( void ) unsigned int cmd_list_length = 0; char **cmd_list = dmenu_mode.get_data ( &( cmd_list_length ), &dmenu_mode ); - - int only_selected = FALSE; + int only_selected = FALSE; if ( find_arg ( "-only-match" ) >= 0 || find_arg ( "-no-custom" ) >= 0 ) { only_selected = TRUE; if ( cmd_list_length == 0 ) { @@ -392,7 +388,6 @@ int dmenu_switcher_dialog ( void ) } } while ( restart ); - g_free ( input ); dmenu_mode.destroy ( &dmenu_mode ); return retv; diff --git a/source/dialogs/run.c b/source/dialogs/run.c index d32f0f8e..fe87c935 100644 --- a/source/dialogs/run.c +++ b/source/dialogs/run.c @@ -79,7 +79,6 @@ static void exec_cmd ( const char *cmd, int run_in_term ) return; } - execsh ( cmd, run_in_term ); /** @@ -155,7 +154,6 @@ static char ** get_apps_external ( char **retv, unsigned int *length, unsigned i retv = g_realloc ( retv, ( ( *length ) + 2 ) * sizeof ( char* ) ); retv[( *length )] = g_strdup ( buffer ); - ( *length )++; } if ( fclose ( inp ) != 0 ) { @@ -181,14 +179,12 @@ static char ** get_apps ( unsigned int *length ) return NULL; } - path = g_strdup_printf ( "%s/%s", cache_dir, RUN_CACHE_FILE ); retv = history_get_list ( path, length ); g_free ( path ); // Keep track of how many where loaded as favorite. num_favorites = ( *length ); - path = g_strdup ( getenv ( "PATH" ) ); for ( const char *dirname = strtok ( path, ":" ); @@ -259,7 +255,6 @@ static char ** get_apps ( unsigned int *length ) } } - if ( ( *length ) > num_favorites ) { g_qsort_with_data ( &retv[num_favorites], ( *length ) - num_favorites, sizeof ( char* ), sort_func, @@ -278,7 +273,6 @@ typedef struct _RunModePrivateData unsigned int cmd_list_length; } RunModePrivateData; - static void run_mode_init ( Switcher *sw ) { if ( sw->private_data == NULL ) { @@ -333,7 +327,6 @@ static SwitcherMode run_mode_result ( int mretv, char **input, unsigned int sele return retv; } - static void run_mode_destroy ( Switcher *sw ) { RunModePrivateData *rmpd = (RunModePrivateData *) sw->private_data; diff --git a/source/dialogs/script.c b/source/dialogs/script.c index 7452bd7c..3bb54b1a 100644 --- a/source/dialogs/script.c +++ b/source/dialogs/script.c @@ -25,7 +25,6 @@ * */ - #include <config.h> #include <stdio.h> #include <stdlib.h> @@ -39,10 +38,6 @@ #include "dialogs/script.h" #include "helper.h" - - - - static char **get_script_output ( const char *command, unsigned int *length ) { char **retv = NULL; @@ -102,7 +97,6 @@ typedef struct _ScriptModePrivateData unsigned int cmd_list_length; } ScriptModePrivateData; - static void script_mode_init ( Switcher *sw ) { if ( sw->private_data == NULL ) { @@ -145,7 +139,6 @@ static SwitcherMode script_mode_result ( int mretv, char **input, unsigned int s new_list = execute_executor ( sw, *input, &new_length ); } - // If a new list was generated, use that an loop around. if ( new_list != NULL ) { g_strfreev ( rmpd->cmd_list ); diff --git a/source/dialogs/window.c b/source/dialogs/window.c index 85ba7f2f..6aad4ebc 100644 --- a/source/dialogs/window.c +++ b/source/dialogs/window.c @@ -44,7 +44,6 @@ #include "i3-support.h" #include "dialogs/window.h" - #define WINLIST 32 #define CLIENTTITLE 100 @@ -417,8 +416,6 @@ static char ** _window_mode_get_data ( unsigned int *length, Switcher *sw, unsig // if we happen to have a window destroyed while we're working... pd->ids = winlist_new (); - - // calc widths of fields for ( i = nwins - 1; i > -1; i-- ) { client *c; @@ -549,7 +546,6 @@ static SwitcherMode window_mode_result ( int mretv, G_GNUC_UNUSED char **input, return retv; } - static void window_mode_destroy ( Switcher *sw ) { SwitcherModePrivateData *rmpd = (SwitcherModePrivateData *) sw->private_data; diff --git a/source/helper.c b/source/helper.c index 8e2a8d0b..2011d7e0 100644 --- a/source/helper.c +++ b/source/helper.c @@ -84,9 +84,7 @@ char* fgets_s ( char* s, int n, FILE *iop, char sep ) * * @returns TRUE to stop replacement, FALSE to continue */ -static gboolean helper_eval_cb ( const GMatchInfo *info, - GString *res, - gpointer data ) +static gboolean helper_eval_cb ( const GMatchInfo *info, GString *res, gpointer data ) { gchar *match; // Get the match @@ -131,10 +129,7 @@ int helper_parse_setup ( char * string, char ***output, int *length, ... ) // Replace hits within {-\w+}. GRegex *reg = g_regex_new ( "{[-\\w]+}", 0, 0, NULL ); - char *res = g_regex_replace_eval ( reg, - string, -1, - 0, 0, helper_eval_cb, h, - NULL ); + char *res = g_regex_replace_eval ( reg, string, -1, 0, 0, helper_eval_cb, h, NULL ); // Free regex. g_regex_unref ( reg ); // Destroy key-value storage. @@ -147,8 +142,7 @@ int helper_parse_setup ( char * string, char ***output, int *length, ... ) g_free ( res ); // Throw error if shell parsing fails. if ( error ) { - char *msg = g_strdup_printf ( "Failed to parse: '%s'\nError: '%s'", string, - error->message ); + char *msg = g_strdup_printf ( "Failed to parse: '%s'\nError: '%s'", string, error->message ); error_dialog ( msg, FALSE ); g_free ( msg ); // print error. @@ -190,9 +184,7 @@ char **tokenize ( const char *input, int case_sensitive ) // Iterate over tokens. // strtok should still be valid for utf8. - for ( token = strtok_r ( str, " ", &saveptr ); - token != NULL; - token = strtok_r ( NULL, " ", &saveptr ) ) { + for ( token = strtok_r ( str, " ", &saveptr ); token != NULL; token = strtok_r ( NULL, " ", &saveptr ) ) { retv = g_realloc ( retv, sizeof ( char* ) * ( num_tokens + 2 ) ); retv[num_tokens] = token_collate_key ( token, case_sensitive ); retv[num_tokens + 1] = NULL; @@ -368,19 +360,10 @@ int execute_generator ( const char * cmd ) int fd = -1; GError *error = NULL; - g_spawn_async_with_pipes ( NULL, - args, - NULL, - G_SPAWN_SEARCH_PATH, - NULL, - NULL, - NULL, - NULL, &fd, NULL, - &error ); + g_spawn_async_with_pipes ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &fd, NULL, &error ); if ( error != NULL ) { - char *msg = g_strdup_printf ( "Failed to execute: '%s'\nError: '%s'", cmd, - error->message ); + char *msg = g_strdup_printf ( "Failed to execute: '%s'\nError: '%s'", cmd, error->message ); error_dialog ( msg, FALSE ); g_free ( msg ); // print error. @@ -391,7 +374,6 @@ int execute_generator ( const char * cmd ) return fd; } - int create_pid_file ( const char *pidfile ) { if ( pidfile == NULL ) { @@ -452,40 +434,32 @@ void config_sanity_check ( ) GString *msg = g_string_new ( "<big><b>The configuration failed to validate:</b></big>\n" ); if ( config.element_height < 1 ) { - g_string_append_printf ( - msg, - "\t<b>config.element_height</b>=%d is invalid. An element needs to be atleast 1 line high.\n", - config.element_height ); + g_string_append_printf ( msg, "\t<b>config.element_height</b>=%d is invalid. An element needs to be atleast 1 line high.\n", + config.element_height ); config.element_height = 1; found_error = TRUE; } if ( config.menu_columns == 0 ) { - g_string_append_printf ( - msg, - "\t<b>config.menu_columns</b>=%d is invalid. You need at least one visible column.\n", - config.menu_columns ); + g_string_append_printf ( msg, "\t<b>config.menu_columns</b>=%d is invalid. You need at least one visible column.\n", + config.menu_columns ); config.menu_columns = 1; found_error = TRUE; } if ( config.menu_width == 0 ) { - show_error_message ( - "<b>config.menu_width</b>=0 is invalid. You cannot have a window with no width.", TRUE ); + show_error_message ( "<b>config.menu_width</b>=0 is invalid. You cannot have a window with no width.", TRUE ); config.menu_columns = 50; found_error = TRUE; } if ( !( config.location >= WL_CENTER && config.location <= WL_WEST ) ) { - g_string_append_printf ( - msg, "\t<b>config.location</b>=%d is invalid. Value should be between %d and %d.\n", - config.location, WL_CENTER, WL_WEST ); + g_string_append_printf ( msg, "\t<b>config.location</b>=%d is invalid. Value should be between %d and %d.\n", + config.location, WL_CENTER, WL_WEST ); config.location = WL_CENTER; found_error = 1; } if ( 0 ) { if ( !( config.line_margin <= 50 ) ) { - g_string_append_printf ( - msg, - "\t<b>config.line_margin</b>=%d is invalid. Value should be between %d and %d.\n", - config.line_margin, 0, 50 ); + g_string_append_printf ( msg, "\t<b>config.line_margin</b>=%d is invalid. Value should be between %d and %d.\n", + config.line_margin, 0, 50 ); config.line_margin = 2; found_error = 1; } diff --git a/source/history.c b/source/history.c index 1423cbe0..6f14e505 100644 --- a/source/history.c +++ b/source/history.c @@ -109,7 +109,6 @@ static _element ** __history_get_element_list ( FILE *fd, unsigned int *length ) return retv; } - void history_set ( const char *filename, const char *entry ) { if ( config.disable_history ) { diff --git a/source/i3-support.c b/source/i3-support.c index ebf7c7e6..1cdf21a0 100644 --- a/source/i3-support.c +++ b/source/i3-support.c @@ -76,7 +76,6 @@ void i3_support_focus_window ( Window id ) return; } - // Formulate command snprintf ( command, upm, "[id=\"%lu\"] focus", id ); // Prepare header. @@ -141,7 +140,6 @@ void i3_support_free_internals ( void ) #else - void i3_support_focus_window ( Window id ) { fprintf ( stderr, "Trying to control i3, when i3 support is not enabled.\n" ); diff --git a/source/keyb.c b/source/keyb.c index 9b14448e..e9577d05 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -34,63 +34,36 @@ extern unsigned int NumlockMask; */ DefaultBinding bindings[NUM_ABE] = { - { .id = PASTE_PRIMARY, .name = "kb-primary-paste", - .keybinding = - "Control+Shift+v,Shift+Insert", }, - { .id = PASTE_SECONDARY, .name = "kb-secondary-paste", .keybinding = - "Control+v,Insert", }, - { .id = CLEAR_LINE, .name = "kb-clear-line", .keybinding = - "Control+u", }, - { .id = MOVE_FRONT, .name = "kb-move-front", .keybinding = - "Control+a", }, - { .id = MOVE_END, .name = "kb-move-end", .keybinding = - "Control+e", }, + { .id = PASTE_PRIMARY, .name = "kb-primary-paste", .keybinding = "Control+Shift+v,Shift+Insert", }, + { .id = PASTE_SECONDARY, .name = "kb-secondary-paste", .keybinding = "Control+v,Insert", }, + { .id = CLEAR_LINE, .name = "kb-clear-line", .keybinding = "Control+u", }, + { .id = MOVE_FRONT, .name = "kb-move-front", .keybinding = "Control+a", }, + { .id = MOVE_END, .name = "kb-move-end", .keybinding = "Control+e", }, { .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .keybinding = "Alt+b", }, { .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .keybinding = "Alt+f", }, - { .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .keybinding = - "Left,Control+b" }, - { .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .keybinding = - "Right,Control+f" }, - { .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .keybinding = - "Control+Alt+h", }, - { .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .keybinding = - "Control+Alt+d", }, - { .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .keybinding = - "Delete,Control+d", }, - { .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .keybinding = - "BackSpace,Control+h", }, - { .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .keybinding = - "Control+j,Control+m,Return,KP_Enter", }, - { .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .keybinding = - "Control+Return", }, - { .id = ACCEPT_ENTRY_CONTINUE, .name = "kb-accept-entry-continue", .keybinding = - "Shift+Return", }, - { .id = MODE_NEXT, .name = "kb-mode-next", .keybinding = - "Shift+Right,Control+Tab" }, - { .id = MODE_PREVIOUS, .name = "kb-mode-previous", .keybinding = - "Shift+Left,Control+Shift+Tab" }, - { .id = TOGGLE_CASE_SENSITIVITY, .name = "kb-toggle-case-sensitivity", .keybinding = - "grave,dead_grave" }, - { .id = DELETE_ENTRY, .name = "kb-delete-entry", .keybinding = - "Shift+Delete" }, - { .id = ROW_LEFT, .name = "kb-row-left", .keybinding = - "Control+Page_Up" }, - { .id = ROW_RIGHT, .name = "kb-row-right", .keybinding = - "Control+Page_Down" }, - { .id = ROW_UP, .name = "kb-row-up", .keybinding = - "Up,Control+p,Shift+Tab" }, - { .id = ROW_DOWN, .name = "kb-row-down", .keybinding = - "Down,Control+n" }, + { .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .keybinding = "Left,Control+b" }, + { .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .keybinding = "Right,Control+f" }, + { .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .keybinding = "Control+Alt+h", }, + { .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .keybinding = "Control+Alt+d", }, + { .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .keybinding = "Delete,Control+d", }, + { .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .keybinding = "BackSpace,Control+h", }, + { .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .keybinding = "Control+j,Control+m,Return,KP_Enter", }, + { .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .keybinding = "Control+Return", }, + { .id = ACCEPT_ENTRY_CONTINUE, .name = "kb-accept-entry-continue", .keybinding = "Shift+Return", }, + { .id = MODE_NEXT, .name = "kb-mode-next", .keybinding = "Shift+Right,Control+Tab" }, + { .id = MODE_PREVIOUS, .name = "kb-mode-previous", .keybinding = "Shift+Left,Control+Shift+Tab" }, + { .id = TOGGLE_CASE_SENSITIVITY, .name = "kb-toggle-case-sensitivity", .keybinding = "grave,dead_grave" }, + { .id = DELETE_ENTRY, .name = "kb-delete-entry", .keybinding = "Shift+Delete" }, + { .id = ROW_LEFT, .name = "kb-row-left", .keybinding = "Control+Page_Up" }, + { .id = ROW_RIGHT, .name = "kb-row-right", .keybinding = "Control+Page_Down" }, + { .id = ROW_UP, .name = "kb-row-up", .keybinding = "Up,Control+p,Shift+Tab" }, + { .id = ROW_DOWN, .name = "kb-row-down", .keybinding = "Down,Control+n" }, { .id = ROW_TAB, .name = "kb-row-tab", .keybinding = "Tab" }, { .id = PAGE_PREV, .name = "kb-page-prev", .keybinding = "Page_Up" }, - { .id = PAGE_NEXT, .name = "kb-page-next", .keybinding = - "Page_Down" }, - { .id = ROW_FIRST, .name = "kb-row-first", .keybinding = - "Home,KP_Home" }, - { .id = ROW_LAST, .name = "kb-row-last", .keybinding = - "End,KP_End" }, - { .id = ROW_SELECT, .name = "kb-row-select", .keybinding = - "Control+space" }, + { .id = PAGE_NEXT, .name = "kb-page-next", .keybinding = "Page_Down" }, + { .id = ROW_FIRST, .name = "kb-row-first", .keybinding = "Home,KP_Home" }, + { .id = ROW_LAST, .name = "kb-row-last", .keybinding = "End,KP_End" }, + { .id = ROW_SELECT, .name = "kb-row-select", .keybinding = "Control+space" }, { .id = CANCEL, .name = "kb-cancel", .keybinding = "Escape" }, { .id = CUSTOM_1, .name = "kb-custom-1", .keybinding = "Alt+1" }, { .id = CUSTOM_2, .name = "kb-custom-2", .keybinding = "Alt+2" }, @@ -102,27 +75,17 @@ DefaultBinding bindings[NUM_ABE] = { .id = CUSTOM_8, .name = "kb-custom-8", .keybinding = "Alt+8" }, { .id = CUSTOM_9, .name = "kb-custom-9", .keybinding = "Alt+9" }, { .id = CUSTOM_10, .name = "kb-custom-10", .keybinding = "Alt+0" }, - { .id = CUSTOM_11, .name = "kb-custom-11", .keybinding = - "Alt+Shift+1" }, - { .id = CUSTOM_12, .name = "kb-custom-12", .keybinding = - "Alt+Shift+2" }, - { .id = CUSTOM_13, .name = "kb-custom-13", .keybinding = - "Alt+Shift+3" }, - { .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = - "Alt+Shift+4" }, - { .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = - "Alt+Shift+5" }, - { .id = CUSTOM_16, .name = "kb-custom-16", .keybinding = - "Alt+Shift+6" }, - { .id = CUSTOM_17, .name = "kb-custom-17", .keybinding = - "Alt+Shift+7" }, - { .id = CUSTOM_18, .name = "kb-custom-18", .keybinding = - "Alt+Shift+8" }, - { .id = CUSTOM_19, .name = "kb-custom-19", .keybinding = - "Alt+Shift+9" }, + { .id = CUSTOM_11, .name = "kb-custom-11", .keybinding = "Alt+Shift+1" }, + { .id = CUSTOM_12, .name = "kb-custom-12", .keybinding = "Alt+Shift+2" }, + { .id = CUSTOM_13, .name = "kb-custom-13", .keybinding = "Alt+Shift+3" }, + { .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = "Alt+Shift+4" }, + { .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = "Alt+Shift+5" }, + { .id = CUSTOM_16, .name = "kb-custom-16", .keybinding = "Alt+Shift+6" }, + { .id = CUSTOM_17, .name = "kb-custom-17", .keybinding = "Alt+Shift+7" }, + { .id = CUSTOM_18, .name = "kb-custom-18", .keybinding = "Alt+Shift+8" }, + { .id = CUSTOM_19, .name = "kb-custom-19", .keybinding = "Alt+Shift+9" }, }; - void setup_abe ( void ) { for ( int iter = 0; iter < NUM_ABE; iter++ ) { @@ -133,8 +96,7 @@ void setup_abe ( void ) abe[id].num_bindings = 0; abe[id].kb = NULL; - config_parser_add_option ( xrm_String, - abe[id].name, (void * *) &( abe[id].keystr ) ); + config_parser_add_option ( xrm_String, abe[id].name, (void * *) &( abe[id].keystr ) ); } } diff --git a/source/rofi.c b/source/rofi.c index 763ce15e..9c003158 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -130,7 +130,6 @@ static inline MainLoopEvent wait_for_xevent_or_timeout ( Display *display, int x return ML_XEVENT; } - /** * Levenshtein Sorting. */ @@ -199,9 +198,7 @@ static Window create_window ( Display *display ) Window box = XCreateWindow ( display, DefaultRootWindow ( display ), 0, 0, 200, 100, config.menu_bw, vinfo.depth, InputOutput, vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr ); - XSelectInput ( display, box, - KeyReleaseMask | KeyPressMask | ExposureMask | - ButtonPressMask | StructureNotifyMask | FocusChangeMask ); + XSelectInput ( display, box, KeyReleaseMask | KeyPress |