forked from speedie/spmenu
don't allow the image to be scaled up beyond menu width
This commit is contained in:
parent
d3ec1b609b
commit
61d9813387
44
libs/event.c
Normal file
44
libs/event.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
void
|
||||
eventloop(void)
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
while (!XNextEvent(dpy, &ev)) {
|
||||
if (XFilterEvent(&ev, win))
|
||||
continue;
|
||||
switch(ev.type) {
|
||||
case DestroyNotify:
|
||||
if (ev.xdestroywindow.window != win)
|
||||
break;
|
||||
cleanup();
|
||||
exit(1);
|
||||
case ButtonPress:
|
||||
buttonpress(&ev);
|
||||
break;
|
||||
case Expose:
|
||||
if (ev.xexpose.count == 0)
|
||||
drw_map(drw, win, 0, 0, mw, mh);
|
||||
break;
|
||||
case FocusIn:
|
||||
/* regrab focus from parent window */
|
||||
if (ev.xfocus.window != win)
|
||||
grabfocus();
|
||||
break;
|
||||
case KeyPress:
|
||||
keypress(&ev);
|
||||
break;
|
||||
case SelectionNotify:
|
||||
if (ev.xselection.property == utf8)
|
||||
pastesel();
|
||||
break;
|
||||
case VisibilityNotify:
|
||||
if (ev.xvisibility.state != VisibilityUnobscured)
|
||||
XRaiseWindow(dpy, win);
|
||||
break;
|
||||
}
|
||||
|
||||
#if USEIMAGE
|
||||
drawimage();
|
||||
#endif
|
||||
}
|
||||
}
|
1
libs/event.h
Normal file
1
libs/event.h
Normal file
|
@ -0,0 +1 @@
|
|||
static void eventloop(void);
|
Loading…
Reference in a new issue