mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-24 00:56:42 +00:00
Correctly fetch more than one watcher event list
This commit is contained in:
@@ -90,14 +90,16 @@ public class EvdevLoader implements Runnable {
|
|||||||
WatchService watcher = evdev.getFileSystem().newWatchService();
|
WatchService watcher = evdev.getFileSystem().newWatchService();
|
||||||
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
||||||
|
|
||||||
WatchKey watckKey = watcher.take();
|
for (;;) {
|
||||||
List<WatchEvent<?>> events = watckKey.pollEvents();
|
WatchKey watckKey = watcher.take();
|
||||||
for (WatchEvent event:events) {
|
List<WatchEvent<?>> events = watckKey.pollEvents();
|
||||||
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
for (WatchEvent event:events) {
|
||||||
String name = event.context().toString();
|
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||||
if (filter.accept(input, name)) {
|
String name = event.context().toString();
|
||||||
LimeLog.info("Input " + name + " added");
|
if (filter.accept(input, name)) {
|
||||||
new EvdevHandler(conn, new File(input, name).getAbsolutePath(), mapping).start();
|
LimeLog.info("Input " + name + " added");
|
||||||
|
new EvdevHandler(conn, new File(input, name).getAbsolutePath(), mapping).start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user