don't allow drawing images until KeyRelease event

This commit is contained in:
speedie 2023-05-11 19:53:23 +02:00
parent ee7419704d
commit 9032af968d
3 changed files with 5 additions and 14 deletions

View file

@ -314,9 +314,6 @@ issues!</p>
MD5() is deprecated as of OpenSSL 3.0, but this would also make it very MD5() is deprecated as of OpenSSL 3.0, but this would also make it very
easy to have LibreSSL compatibility.</li> easy to have LibreSSL compatibility.</li>
<li>Image support: Ability to display icons, similar to rofi</li> <li>Image support: Ability to display icons, similar to rofi</li>
<li>Image support: Images take a long time to load sometimes,
particularly when items are selected using the cursor so what we really
need is a way to skip over images after a set time limit.</li>
<li>Text drawing: Use cairo for text drawing over Xft.</li> <li>Text drawing: Use cairo for text drawing over Xft.</li>
<li>Lines: Rofi-like newlines in the same entry <li>Lines: Rofi-like newlines in the same entry
<ul> <ul>

View file

@ -122,9 +122,6 @@ Pull requests would be greatly appreciated for any of these issues!
is deprecated as of OpenSSL 3.0, but this would also make it very easy to is deprecated as of OpenSSL 3.0, but this would also make it very easy to
have LibreSSL compatibility. have LibreSSL compatibility.
- Image support: Ability to display icons, similar to rofi - Image support: Ability to display icons, similar to rofi
- Image support: Images take a long time to load sometimes, particularly when
items are selected using the cursor so what we really need is a way to
skip over images after a set time limit.
- Text drawing: Use cairo for text drawing over Xft. - Text drawing: Use cairo for text drawing over Xft.
- Lines: Rofi-like newlines in the same entry - Lines: Rofi-like newlines in the same entry
- Just need to `XMoveResizeWindow()` as well as `mh += bh` and `y += bh` - Just need to `XMoveResizeWindow()` as well as `mh += bh` and `y += bh`

View file

@ -1,8 +1,6 @@
void eventloop(void) { void eventloop(void) {
XEvent ev; XEvent ev;
#if USEIMAGE
int noimg = 0; int noimg = 0;
#endif
while (!XNextEvent(dpy, &ev)) { while (!XNextEvent(dpy, &ev)) {
if (XFilterEvent(&ev, None)) if (XFilterEvent(&ev, None))
@ -16,9 +14,7 @@ void eventloop(void) {
exit(1); exit(1);
case ButtonPress: case ButtonPress:
buttonpress(&ev); buttonpress(&ev);
#if USEIMAGE
noimg = 0; noimg = 0;
#endif
break; break;
case MotionNotify: // currently does nothing case MotionNotify: // currently does nothing
break; break;
@ -38,6 +34,7 @@ void eventloop(void) {
} }
keypress(&ev); keypress(&ev);
noimg = 1;
break; break;
case SelectionNotify: // paste selection case SelectionNotify: // paste selection
if (ev.xselection.property == utf8) if (ev.xselection.property == utf8)
@ -50,6 +47,7 @@ void eventloop(void) {
case KeyRelease: case KeyRelease:
getcapsstate(); getcapsstate();
drawmenu(); drawmenu();
noimg = 0;
break; break;
} }
@ -70,12 +68,11 @@ void eventloop(void) {
} }
// redraw image on X11 event // redraw image on X11 event
if (!noimg)
#if USEIMAGE #if USEIMAGE
if (!noimg) {
drawimage(); drawimage();
} else { #else
noimg = 0; // draw it next time ;
}
#endif #endif
} }
} }