forked from speedie/spmenu
last few commits again
This commit is contained in:
parent
77864d43bf
commit
7ca66d674f
12
libs/arg.c
12
libs/arg.c
|
@ -159,17 +159,7 @@ void moveend(Arg *arg) {
|
|||
}
|
||||
|
||||
void paste(Arg *arg) {
|
||||
int clipboard;
|
||||
|
||||
if (arg->i == 1) {
|
||||
clipboard = XA_PRIMARY;
|
||||
} else {
|
||||
clipboard = clip;
|
||||
}
|
||||
|
||||
XConvertSelection(dpy, clipboard, utf8, utf8, win, CurrentTime);
|
||||
|
||||
return;
|
||||
paste_x11(arg->i);
|
||||
}
|
||||
|
||||
void viewhist(Arg *arg) {
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
// declare various macros
|
||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
||||
#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
|
||||
&& MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
|
||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||
#define TEXTW(X) (drw_font_getwidth(drw, (X), False) + lrpad)
|
||||
#define TEXTWM(X) (drw_font_getwidth(drw, (X), True) + lrpad)
|
||||
|
||||
// number
|
||||
#define NUMBERSMAXDIGITS 100
|
||||
#define NUMBERSBUFSIZE (NUMBERSMAXDIGITS * 2) + 1
|
||||
|
||||
// item
|
||||
#define MAXITEMLENGTH 1024
|
||||
|
|
|
@ -17,3 +17,11 @@ void pastesel_x11(void) {
|
|||
// draw the menu
|
||||
drawmenu();
|
||||
}
|
||||
|
||||
int paste_x11(int sel) {
|
||||
if (XConvertSelection(dpy, sel ? XA_PRIMARY : clip, utf8, utf8, win, CurrentTime)) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
static void pastesel_x11(void);
|
||||
static int paste_x11(int sel);
|
||||
|
|
4
libs/x11/def.h
Normal file
4
libs/x11/def.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
|
@ -1,4 +1,5 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include "xim.c"
|
||||
#include "key.c"
|
||||
#include "mouse.c"
|
||||
|
@ -6,6 +7,7 @@
|
|||
#include "xrdb.c"
|
||||
#include "client.h"
|
||||
#include "client.c"
|
||||
#include "event.c"
|
||||
#include "init.c"
|
||||
#include "focus.c"
|
||||
#include "clipboard.c"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include "lib.h"
|
||||
|
||||
#include "def.h"
|
||||
#include "init.h"
|
||||
#include "event.h"
|
||||
#include "xrdb.h"
|
||||
#include "xim.h"
|
||||
#include "key.h"
|
||||
|
|
Loading…
Reference in a new issue