mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-03 06:26:04 +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();
|
||||
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
||||
|
||||
WatchKey watckKey = watcher.take();
|
||||
List<WatchEvent<?>> events = watckKey.pollEvents();
|
||||
for (WatchEvent event:events) {
|
||||
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||
String name = event.context().toString();
|
||||
if (filter.accept(input, name)) {
|
||||
LimeLog.info("Input " + name + " added");
|
||||
new EvdevHandler(conn, new File(input, name).getAbsolutePath(), mapping).start();
|
||||
for (;;) {
|
||||
WatchKey watckKey = watcher.take();
|
||||
List<WatchEvent<?>> events = watckKey.pollEvents();
|
||||
for (WatchEvent event:events) {
|
||||
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||
String name = event.context().toString();
|
||||
if (filter.accept(input, name)) {
|
||||
LimeLog.info("Input " + name + " added");
|
||||
new EvdevHandler(conn, new File(input, name).getAbsolutePath(), mapping).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user