Skip to content

Commit 2c1290f

Browse files
committed
(#6) Updated Linux implementation to use milliseconds
1 parent 8a0de30 commit 2c1290f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/highlightwindow_linux.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <X11/Xlib.h>
22
#include <X11/Xutil.h>
3+
#include <unistd.h>
34
#include "highlightwindow.h"
45

5-
void showHighlightWindow(int x, int y, int width, int height, int duration, float opacity)
6-
{
6+
void showHighlightWindow(int32_t x, int32_t y, int32_t width, int32_t height, long duration, float opacity) {
77
Display *d = XOpenDisplay(NULL);
88
Window root = DefaultRootWindow(d);
99
int default_screen = XDefaultScreen(d);
@@ -32,7 +32,7 @@ void showHighlightWindow(int x, int y, int width, int height, int duration, floa
3232

3333
XFlush(d);
3434

35-
sleep(duration);
35+
usleep(1000 * duration);
3636

3737
XUnmapWindow(d, overlay);
3838
XCloseDisplay(d);

0 commit comments

Comments
 (0)