mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
sink: Do not send the same cursor coords on each GUI redraw
This commit is contained in:
@@ -452,10 +452,13 @@ gtk_clapper_gl_widget_motion_event (GtkEventControllerMotion * motion_controller
|
|||||||
GtkClapperGLWidget *clapper_widget = GTK_CLAPPER_GL_WIDGET (widget);
|
GtkClapperGLWidget *clapper_widget = GTK_CLAPPER_GL_WIDGET (widget);
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
|
|
||||||
if ((element = g_weak_ref_get (&clapper_widget->element))) {
|
if (x != clapper_widget->last_pos_x && y != clapper_widget->last_pos_y &&
|
||||||
|
(element = g_weak_ref_get (&clapper_widget->element))) {
|
||||||
if (GST_IS_NAVIGATION (element)) {
|
if (GST_IS_NAVIGATION (element)) {
|
||||||
gdouble stream_x, stream_y;
|
gdouble stream_x, stream_y;
|
||||||
|
|
||||||
|
clapper_widget->last_pos_x = x;
|
||||||
|
clapper_widget->last_pos_y = y;
|
||||||
_display_size_to_stream_size (clapper_widget, x, y, &stream_x, &stream_y);
|
_display_size_to_stream_size (clapper_widget, x, y, &stream_x, &stream_y);
|
||||||
|
|
||||||
gst_navigation_send_mouse_event (GST_NAVIGATION (element), "mouse-move",
|
gst_navigation_send_mouse_event (GST_NAVIGATION (element), "mouse-move",
|
||||||
@@ -955,6 +958,8 @@ gtk_clapper_gl_widget_init (GtkClapperGLWidget * clapper_widget)
|
|||||||
clapper_widget->par_d = DEFAULT_PAR_D;
|
clapper_widget->par_d = DEFAULT_PAR_D;
|
||||||
clapper_widget->ignore_textures = DEFAULT_IGNORE_TEXTURES;
|
clapper_widget->ignore_textures = DEFAULT_IGNORE_TEXTURES;
|
||||||
clapper_widget->app_context = g_main_context_ref_thread_default ();
|
clapper_widget->app_context = g_main_context_ref_thread_default ();
|
||||||
|
clapper_widget->last_pos_x = 0;
|
||||||
|
clapper_widget->last_pos_y = 0;
|
||||||
|
|
||||||
gst_video_info_init (&clapper_widget->v_info);
|
gst_video_info_init (&clapper_widget->v_info);
|
||||||
gst_video_info_init (&clapper_widget->pending_v_info);
|
gst_video_info_init (&clapper_widget->pending_v_info);
|
||||||
|
@@ -61,6 +61,10 @@ struct _GtkClapperGLWidget
|
|||||||
gint scaled_width;
|
gint scaled_width;
|
||||||
gint scaled_height;
|
gint scaled_height;
|
||||||
|
|
||||||
|
/* Position coords */
|
||||||
|
gdouble last_pos_x;
|
||||||
|
gdouble last_pos_y;
|
||||||
|
|
||||||
gboolean negotiated;
|
gboolean negotiated;
|
||||||
GstBuffer *pending_buffer;
|
GstBuffer *pending_buffer;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
Reference in New Issue
Block a user