diff --git a/source/rofi.c b/source/rofi.c index cf45a478..7c6e9c0f 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1364,8 +1364,12 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 ); - if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) || - key == XK_Insert ) { + if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ) { + XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ? + XA_PRIMARY : netatoms[CLIPBOARD], + netatoms[UTF8_STRING], netatoms[UTF8_STRING], main_window, CurrentTime ); + } + if ( key == XK_Insert ) { XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ? netatoms[CLIPBOARD] : XA_PRIMARY, netatoms[UTF8_STRING], netatoms[UTF8_STRING], main_window, CurrentTime ); diff --git a/source/textbox.c b/source/textbox.c index 496550de..fc89df5d 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -178,9 +178,10 @@ void textbox_moveresize ( textbox *tb, int x, int y, int w, int h ) } else { // set ellipsize - if( (tb->flags & TB_EDITABLE) == TB_EDITABLE ) { + if ( ( tb->flags & TB_EDITABLE ) == TB_EDITABLE ) { pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_MIDDLE ); - }else{ + } + else{ pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_END ); } } @@ -257,18 +258,18 @@ void textbox_draw ( textbox *tb ) pango_layout_set_width ( tb->layout, PANGO_SCALE * ( tb->w - 2 * SIDE_MARGIN ) ); - int x = PANGO_SCALE*SIDE_MARGIN, y = 0; + int x = PANGO_SCALE * SIDE_MARGIN, y = 0; if ( tb->flags & TB_RIGHT ) { - x = (tb->w - line_width)*PANGO_SCALE; + x = ( tb->w - line_width ) * PANGO_SCALE; } else if ( tb->flags & TB_CENTER ) { - x = (PANGO_SCALE*( tb->w - line_width )) / 2; + x = ( PANGO_SCALE * ( tb->w - line_width ) ) / 2; } - y = (PANGO_SCALE*(textbox_get_width(tb) - textbox_get_font_width(tb)))/2; + y = ( PANGO_SCALE * ( textbox_get_width ( tb ) - textbox_get_font_width ( tb ) ) ) / 2; // Render the layout. pango_xft_render_layout ( draw, &( tb->color_fg ), tb->layout, - x , y ); + x, y ); // draw the cursor if ( tb->flags & TB_EDITABLE ) {