mirror of https://github.com/davatorium/rofi.git
Remove random atoms and put them in the netatoms array.
This commit is contained in:
parent
f9149b5bdb
commit
7b06ec4a55
|
@ -255,6 +255,8 @@ static int ( *xerror )( Display *, XErrorEvent * );
|
||||||
X ( _NET_WM_STATE_ABOVE ), \
|
X ( _NET_WM_STATE_ABOVE ), \
|
||||||
X ( _NET_WM_DESKTOP ), \
|
X ( _NET_WM_DESKTOP ), \
|
||||||
X ( I3_SOCKET_PATH ), \
|
X ( I3_SOCKET_PATH ), \
|
||||||
|
X ( CLIPBOARD ), \
|
||||||
|
X ( UTF8_STRING ), \
|
||||||
X ( _NET_WM_WINDOW_OPACITY )
|
X ( _NET_WM_WINDOW_OPACITY )
|
||||||
|
|
||||||
enum { EWMH_ATOMS ( ATOM_ENUM ), NETATOMS };
|
enum { EWMH_ATOMS ( ATOM_ENUM ), NETATOMS };
|
||||||
|
@ -1142,8 +1144,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
||||||
}
|
}
|
||||||
else if ( ev.type == SelectionNotify ) {
|
else if ( ev.type == SelectionNotify ) {
|
||||||
// TODO move this.
|
// TODO move this.
|
||||||
Atom utf8 = XInternAtom ( display, "UTF8_STRING", False );
|
if ( ev.xselection.property == netatoms[UTF8_STRING] ) {
|
||||||
if ( ev.xselection.property == utf8 ) {
|
|
||||||
char *pbuf = NULL;
|
char *pbuf = NULL;
|
||||||
int di;
|
int di;
|
||||||
unsigned long dl, rm;
|
unsigned long dl, rm;
|
||||||
|
@ -1153,11 +1154,11 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
||||||
XGetWindowProperty (
|
XGetWindowProperty (
|
||||||
display,
|
display,
|
||||||
main_window,
|
main_window,
|
||||||
utf8,
|
netatoms[UTF8_STRING],
|
||||||
0,
|
0,
|
||||||
256 / 4, // max length in words.
|
256 / 4, // max length in words.
|
||||||
False, // Do not delete clipboard.
|
False, // Do not delete clipboard.
|
||||||
utf8, &da, &di, &dl, &rm, (unsigned char * *) &pbuf );
|
netatoms[UTF8_STRING], &da, &di, &dl, &rm, (unsigned char * *) &pbuf );
|
||||||
// If There was remaining data left.. lets ignore this.
|
// If There was remaining data left.. lets ignore this.
|
||||||
// Only accept it when we get bytes!
|
// Only accept it when we get bytes!
|
||||||
if ( di == 8 ) {
|
if ( di == 8 ) {
|
||||||
|
@ -1195,11 +1196,9 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
|
||||||
|
|
||||||
if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ||
|
if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ||
|
||||||
key == XK_Insert ) {
|
key == XK_Insert ) {
|
||||||
// TODO move these.
|
XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ?
|
||||||
Atom clip = XInternAtom ( display, "CLIPBOARD", False );
|
netatoms[CLIPBOARD] : XA_PRIMARY,
|
||||||
Atom utf8 = XInternAtom ( display, "UTF8_STRING", False );
|
netatoms[UTF8_STRING], netatoms[UTF8_STRING], main_window, CurrentTime );
|
||||||
XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ? clip : XA_PRIMARY,
|
|
||||||
utf8, utf8, main_window, CurrentTime );
|
|
||||||
}
|
}
|
||||||
else if ( ( ( ev.xkey.state & ShiftMask ) == ShiftMask ) &&
|
else if ( ( ( ev.xkey.state & ShiftMask ) == ShiftMask ) &&
|
||||||
key == XK_slash ) {
|
key == XK_slash ) {
|
||||||
|
|
Loading…
Reference in New Issue