You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
handle drag-and-drop events as ACTION_SEND Intents
This commit is contained in:
@@ -99,6 +99,7 @@ void set_up_handle_cache(JNIEnv *env)
|
||||
(*env)->ExceptionDescribe(env);
|
||||
handle_cache.context.sendBroadcast = _METHOD(handle_cache.context.class, "sendBroadcast", "(Landroid/content/Intent;)V");
|
||||
handle_cache.context.startActivity = _METHOD(handle_cache.context.class, "startActivity", "(Landroid/content/Intent;)V");
|
||||
handle_cache.context.resolveActivityInternal = _STATIC_METHOD(handle_cache.context.class, "resolveActivityInternal", "(Landroid/content/Intent;)Landroid/app/Activity;");
|
||||
handle_cache.context.startService = _METHOD(handle_cache.context.class, "startService", "(Landroid/content/Intent;)Landroid/content/ComponentName;");
|
||||
|
||||
handle_cache.application.class = _REF((*env)->FindClass(env, "android/app/Application"));
|
||||
|
||||
@@ -97,6 +97,7 @@ struct handle_cache {
|
||||
jmethodID get_package_name;
|
||||
jmethodID sendBroadcast;
|
||||
jmethodID startActivity;
|
||||
jmethodID resolveActivityInternal;
|
||||
jmethodID startService;
|
||||
} context;
|
||||
struct {
|
||||
|
||||
@@ -158,6 +158,8 @@ static gboolean on_event(GtkEventControllerLegacy *event_controller, GdkEvent *e
|
||||
}
|
||||
|
||||
uintptr_t id = (uintptr_t)gdk_event_get_event_sequence(event);
|
||||
if (id > MAX_POINTERS-1) // sequence id is a real pointer for drag and drop events
|
||||
return false;
|
||||
|
||||
/* FIXME: this will clash with touchscreen */
|
||||
if(id == 0)
|
||||
|
||||
Reference in New Issue
Block a user