1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Insert key paste secondary, shift-insert primary.

This commit is contained in:
QC 2014-06-02 13:29:43 +02:00
parent 92db68b36d
commit 6fb7e345d0
4 changed files with 12 additions and 11 deletions

View file

@ -81,7 +81,7 @@ typedef int ( *menu_match_cb )( char **tokens, const char *input, int index, voi
MenuReturn menu ( char **lines, char **input, char *prompt,
Time *time, int *shift,
menu_match_cb mmc, void *mmc_data,
int *selected_line ) __attribute__ ((nonnull(1,2,3,8)));
int *selected_line ) __attribute__ ( ( nonnull ( 1, 2, 3, 8 ) ) );
void catch_exit ( __attribute__( ( unused ) ) int sig );

View file

@ -19,12 +19,12 @@ typedef struct
typedef enum
{
TB_AUTOHEIGHT = 1 << 0,
TB_AUTOWIDTH = 1 << 1,
TB_LEFT = 1 << 16,
TB_RIGHT = 1 << 17,
TB_CENTER = 1 << 18,
TB_EDITABLE = 1 << 19,
TB_AUTOHEIGHT = 1 << 0,
TB_AUTOWIDTH = 1 << 1,
TB_LEFT = 1 << 16,
TB_RIGHT = 1 << 17,
TB_CENTER = 1 << 18,
TB_EDITABLE = 1 << 19,
} TextboxFlags;
typedef enum

View file

@ -1338,7 +1338,8 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 );
if ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v )
if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ||
key == XK_Insert )
{
// TODO move these.
Atom clip = XInternAtom ( display, "CLIPBOARD", False );

View file

@ -239,8 +239,8 @@ void textbox_draw ( textbox *tb )
// Trailing spaces still go wrong....
// The replace by _ is needed, one way or the other.
// Make a copy, and replace all trailing spaces.
char *test = strdup(text);
for(int iter = strlen(text)-1; iter >= 0 && test[iter] == ' '; iter--)
char *test = strdup ( text );
for ( int iter = strlen ( text ) - 1; iter >= 0 && test[iter] == ' '; iter-- )
{
test[iter] = '_';
}
@ -248,7 +248,7 @@ void textbox_draw ( textbox *tb )
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) test, cursor_offset, &extents );
// Add a small 4px offset between cursor and last glyph.
cursor_x = extents.width + ( ( extents.width > 0 ) ? 2 : 0 );
free(test);
free ( test );
}
// calc full input text width