diff --git a/base b/base index f92a6b5d8..520fcf62b 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit f92a6b5d80af0d9b18050a0ba99a1d6f02924ad6 +Subproject commit 520fcf62b0fb1197a3fd6196629ba2f38d248c4b diff --git a/frontend/device/sdl/device.lua b/frontend/device/sdl/device.lua index 40f22c7ff..a6353146f 100644 --- a/frontend/device/sdl/device.lua +++ b/frontend/device/sdl/device.lua @@ -43,12 +43,19 @@ function Device:init() device = self, event_map = require("device/sdl/event_map_sdl2"), handleMiscEv = function(device_input, ev) - -- bit of a hack for passing SDL window resize events + -- bit of a hack for passing SDL events + local SDL_DROPFILE = 4096 local SDL_WINDOWEVENT_RESIZED = 5 local w = 0 local h = 1 - if ev.code == w then + if ev.code == SDL_DROPFILE then + local dropped_file_path = input.getDroppedFilePath() + if dropped_file_path and dropped_file_path ~= "" then + local ReaderUI = require("apps/reader/readerui") + ReaderUI:doShowReader(dropped_file_path) + end + elseif ev.code == w then device_input.new_w = ev.value elseif ev.code == h then device_input.new_h = ev.value