Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libs/openFrameworks/app/ofAppGLFWWindow.cpp b/libs/openFrameworks/app/ofAppGLFWWindow.cpp
- index 02b1a8c..1a41028 100644
- --- a/libs/openFrameworks/app/ofAppGLFWWindow.cpp
- +++ b/libs/openFrameworks/app/ofAppGLFWWindow.cpp
- @@ -13,7 +13,8 @@
- #define GLFW_EXPOSE_NATIVE_GLX
- #else
- #define GLFW_EXPOSE_NATIVE_EGL
- - #endif
- + #endif
- + #include <X11/extensions/Xrandr.h>
- #include "GLFW/glfw3native.h"
- #include <X11/Xatom.h>
- #include "Poco/URI.h"
- @@ -238,7 +239,7 @@ void ofAppGLFWWindow::initializeWindow(){
- glfwSetWindowSizeCallback(windowP, resize_cb);
- glfwSetWindowCloseCallback(windowP, exit_cb);
- glfwSetScrollCallback(windowP, scroll_cb);
- - glfwSetDropCallback(windowP, drop_cb);
- + glfwSetDropCallback(windowP, drop_cb);
- }
- @@ -874,15 +875,16 @@ void ofAppGLFWWindow::scroll_cb(GLFWwindow* windowP_, double x, double y) {
- }
- //------------------------------------------------------------
- -void ofAppGLFWWindow::drop_cb(GLFWwindow* windowP_, const char* dropString) {
- - string drop = dropString;
- - ofDragInfo drag;
- - drag.position.set(ofGetMouseX(),ofGetMouseY());
- - drag.files = ofSplitString(drop,"\n",true);
- +void ofAppGLFWWindow::drop_cb(GLFWwindow* windowP_, const int dropArraySize, const char* dropStringArray[]) {
- + ofDragInfo drag;
- + drag.position.set(ofGetMouseX(),ofGetMouseY());
- + for(int i=0; i<dropArraySize; i++){
- + drag.files.push_back(dropStringArray[i]);
- + }
- #ifdef TARGET_LINUX
- - for(int i=0; i<(int)drag.files.size(); i++){
- + for(int i=0; i<dropArraySize; i++){
- drag.files[i] = Poco::URI(drag.files[i]).getPath();
- - }
- + }
- #endif
- ofNotifyDragEvent(drag);
- }
- diff --git a/libs/openFrameworks/app/ofAppGLFWWindow.h b/libs/openFrameworks/app/ofAppGLFWWindow.h
- index 838cca7..343f6b6 100644
- --- a/libs/openFrameworks/app/ofAppGLFWWindow.h
- +++ b/libs/openFrameworks/app/ofAppGLFWWindow.h
- @@ -111,7 +111,7 @@ private:
- static void resize_cb(GLFWwindow* windowP_, int w, int h);
- static void exit_cb(GLFWwindow* windowP_);
- static void scroll_cb(GLFWwindow* windowP_, double x, double y);
- - static void drop_cb(GLFWwindow* windowP_, const char* dropString);
- + static void drop_cb(GLFWwindow* windowP_, const int dropArraySize, const char* dropStringArray[]);
- static void error_cb(int errorCode, const char* errorDescription);
- static void exitApp();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement