Skip to content
Snippets Groups Projects
Commit 65999448 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

LibVLC: Awindow: don't send same events more than one time

parent 202fe369
No related branches found
No related tags found
No related merge requests found
......@@ -381,26 +381,23 @@ public class AWindow implements IVLCVout {
@Override
public void sendMouseEvent(int action, int button, int x, int y) {
synchronized (mNativeLock) {
if (mCallbackNativeHandle != 0)
if (mCallbackNativeHandle != 0 && (mMouseAction != action || mMouseButton != button
|| mMouseX != x || mMouseY != y))
mAWindowNativeHandler.nativeOnMouseEvent(mCallbackNativeHandle, action, button, x, y);
else {
mMouseAction = action;
mMouseButton = button;
mMouseX = x;
mMouseY = y;
}
mMouseAction = action;
mMouseButton = button;
mMouseX = x;
mMouseY = y;
}
}
@Override
public void setWindowSize(int width, int height) {
synchronized (mNativeLock) {
if (mCallbackNativeHandle != 0)
if (mCallbackNativeHandle != 0 && (mWindowWidth != width || mWindowHeight != height))
mAWindowNativeHandler.nativeOnWindowSize(mCallbackNativeHandle, width, height);
else {
mWindowWidth = width;
mWindowHeight = height;
}
mWindowWidth = width;
mWindowHeight = height;
}
}
......@@ -467,8 +464,6 @@ public class AWindow implements IVLCVout {
if (mWindowWidth != -1 && mWindowHeight != -1)
nativeOnWindowSize(mCallbackNativeHandle, mWindowWidth, mWindowHeight);
}
mMouseAction = mMouseButton = mMouseX = mMouseY = -1;
mWindowWidth = mWindowHeight = -1;
}
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment