Merge branch 'jludwig-master'
This commit is contained in:
commit
3a6bc67fbd
5 changed files with 16 additions and 10 deletions
4
LICENSE
4
LICENSE
|
@ -8,8 +8,8 @@ MIT/X Consortium License
|
||||||
© 2009 Markus Schnalke <meillo@marmaro.de>
|
© 2009 Markus Schnalke <meillo@marmaro.de>
|
||||||
© 2009 Evan Gates <evan.gates@gmail.com>
|
© 2009 Evan Gates <evan.gates@gmail.com>
|
||||||
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||||
© 2014-2019 Hiltjo Posthuma <hiltjo@codemadness.org>
|
© 2014-2020 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||||
© 2015-2018 Quentin Rameau <quinq@fifth.space>
|
© 2015-2019 Quentin Rameau <quinq@fifth.space>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# dmenu version
|
# dmenu version
|
||||||
VERSION = 4.9
|
VERSION = 5.0
|
||||||
|
|
||||||
# paths
|
# paths
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
|
19
dmenu.c
19
dmenu.c
|
@ -740,12 +740,17 @@ run(void)
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
while (!XNextEvent(dpy, &ev)) {
|
while (!XNextEvent(dpy, &ev)) {
|
||||||
if (XFilterEvent(&ev, None))
|
if (XFilterEvent(&ev, win))
|
||||||
continue;
|
continue;
|
||||||
switch(ev.type) {
|
switch(ev.type) {
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
buttonpress(&ev);
|
buttonpress(&ev);
|
||||||
break;
|
break;
|
||||||
|
case DestroyNotify:
|
||||||
|
if (ev.xdestroywindow.window != win)
|
||||||
|
break;
|
||||||
|
cleanup();
|
||||||
|
exit(1);
|
||||||
case Expose:
|
case Expose:
|
||||||
if (ev.xexpose.count == 0)
|
if (ev.xexpose.count == 0)
|
||||||
drw_map(drw, win, 0, 0, mw, mh);
|
drw_map(drw, win, 0, 0, mw, mh);
|
||||||
|
@ -852,15 +857,17 @@ setup(void)
|
||||||
CWOverrideRedirect | CWBackPixel | CWColormap | CWEventMask | CWBorderPixel, &swa);
|
CWOverrideRedirect | CWBackPixel | CWColormap | CWEventMask | CWBorderPixel, &swa);
|
||||||
XSetClassHint(dpy, win, &ch);
|
XSetClassHint(dpy, win, &ch);
|
||||||
|
|
||||||
/* open input methods */
|
|
||||||
xim = XOpenIM(dpy, NULL, NULL, NULL);
|
/* input methods */
|
||||||
|
if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
|
||||||
|
die("XOpenIM failed: could not open input device");
|
||||||
|
|
||||||
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
||||||
XNClientWindow, win, XNFocusWindow, win, NULL);
|
XNClientWindow, win, XNFocusWindow, win, NULL);
|
||||||
|
|
||||||
XMapRaised(dpy, win);
|
XMapRaised(dpy, win);
|
||||||
XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
|
|
||||||
if (embed) {
|
if (embed) {
|
||||||
XSelectInput(dpy, parentwin, FocusChangeMask);
|
XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
|
||||||
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
|
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
|
||||||
for (i = 0; i < du && dws[i] != win; ++i)
|
for (i = 0; i < du && dws[i] != win; ++i)
|
||||||
XSelectInput(dpy, dws[i], FocusChangeMask);
|
XSelectInput(dpy, dws[i], FocusChangeMask);
|
||||||
|
@ -953,8 +960,6 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||||
fputs("warning: no locale support\n", stderr);
|
fputs("warning: no locale support\n", stderr);
|
||||||
if (!XSetLocaleModifiers(""))
|
|
||||||
fputs("warning: no locale modifiers support\n", stderr);
|
|
||||||
if (!(dpy = XOpenDisplay(NULL)))
|
if (!(dpy = XOpenDisplay(NULL)))
|
||||||
die("cannot open display");
|
die("cannot open display");
|
||||||
screen = DefaultScreen(dpy);
|
screen = DefaultScreen(dpy);
|
||||||
|
|
0
dmenu_path
Normal file → Executable file
0
dmenu_path
Normal file → Executable file
1
drw.c
1
drw.c
|
@ -98,6 +98,7 @@ drw_free(Drw *drw)
|
||||||
{
|
{
|
||||||
XFreePixmap(drw->dpy, drw->drawable);
|
XFreePixmap(drw->dpy, drw->drawable);
|
||||||
XFreeGC(drw->dpy, drw->gc);
|
XFreeGC(drw->dpy, drw->gc);
|
||||||
|
drw_fontset_free(drw->fonts);
|
||||||
free(drw);
|
free(drw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue