Merge branch 'master' of https://git.suckless.org/st
commit
a35f266d5a
49
x.c
49
x.c
|
@ -1822,9 +1822,29 @@ char *kmap(KeySym k, uint state) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void kpress(XEvent *ev) {
|
void cmessage(XEvent *e) {
|
||||||
|
/*
|
||||||
|
* See xembed specs
|
||||||
|
* http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
|
||||||
|
*/
|
||||||
|
if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) {
|
||||||
|
if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) {
|
||||||
|
win.mode |= MODE_FOCUSED;
|
||||||
|
xseturgency(0);
|
||||||
|
} else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) {
|
||||||
|
win.mode &= ~MODE_FOCUSED;
|
||||||
|
}
|
||||||
|
} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
|
||||||
|
ttyhangup();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
kpress(XEvent *ev)
|
||||||
|
{
|
||||||
XKeyEvent *e = &ev->xkey;
|
XKeyEvent *e = &ev->xkey;
|
||||||
KeySym ksym;
|
KeySym ksym = NoSymbol;
|
||||||
char buf[64], *customkey;
|
char buf[64], *customkey;
|
||||||
int len;
|
int len;
|
||||||
Rune c;
|
Rune c;
|
||||||
|
@ -1840,10 +1860,13 @@ void kpress(XEvent *ev) {
|
||||||
if (IS_SET(MODE_KBDLOCK))
|
if (IS_SET(MODE_KBDLOCK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (xw.ime.xic)
|
if (xw.ime.xic) {
|
||||||
len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status);
|
len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status);
|
||||||
else
|
if (status == XBufferOverflow)
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
len = XLookupString(e, buf, sizeof buf, &ksym, NULL);
|
len = XLookupString(e, buf, sizeof buf, &ksym, NULL);
|
||||||
|
}
|
||||||
/* 1. shortcuts */
|
/* 1. shortcuts */
|
||||||
for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
|
for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
|
||||||
if (ksym == bp->keysym && match(bp->mod, e->state)) {
|
if (ksym == bp->keysym && match(bp->mod, e->state)) {
|
||||||
|
@ -1876,24 +1899,6 @@ void kpress(XEvent *ev) {
|
||||||
ttywrite(buf, len, 1);
|
ttywrite(buf, len, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmessage(XEvent *e) {
|
|
||||||
/*
|
|
||||||
* See xembed specs
|
|
||||||
* http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
|
|
||||||
*/
|
|
||||||
if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) {
|
|
||||||
if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) {
|
|
||||||
win.mode |= MODE_FOCUSED;
|
|
||||||
xseturgency(0);
|
|
||||||
} else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) {
|
|
||||||
win.mode &= ~MODE_FOCUSED;
|
|
||||||
}
|
|
||||||
} else if (e->xclient.data.l[0] == xw.wmdeletewin) {
|
|
||||||
ttyhangup();
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void resize(XEvent *e) {
|
void resize(XEvent *e) {
|
||||||
if (e->xconfigure.width == win.w && e->xconfigure.height == win.h)
|
if (e->xconfigure.width == win.w && e->xconfigure.height == win.h)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue