hide cursor on video playback
This commit is contained in:
parent
552a899d29
commit
a3279c36d9
3 changed files with 22 additions and 0 deletions
|
@ -870,6 +870,7 @@ static gboolean photo_booth_bus_callback (GstBus *bus, GstMessage *message, Phot
|
||||||
{
|
{
|
||||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pb->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "photo_booth_video_start");
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pb->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "photo_booth_video_start");
|
||||||
GST_DEBUG ("video_bin GST_STATE_CHANGE_PAUSED_TO_PLAYING -> hide spinner!");
|
GST_DEBUG ("video_bin GST_STATE_CHANGE_PAUSED_TO_PLAYING -> hide spinner!");
|
||||||
|
photo_booth_window_hide_cursor (priv->win);
|
||||||
photo_booth_window_set_spinner (priv->win, FALSE);
|
photo_booth_window_set_spinner (priv->win, FALSE);
|
||||||
}
|
}
|
||||||
if (src == GST_OBJECT (priv->screensaver_playbin) && transition == GST_STATE_CHANGE_READY_TO_PAUSED)
|
if (src == GST_OBJECT (priv->screensaver_playbin) && transition == GST_STATE_CHANGE_READY_TO_PAUSED)
|
||||||
|
@ -974,6 +975,8 @@ static gboolean photo_booth_preview_ready (PhotoBooth *pb)
|
||||||
PhotoBoothPrivate *priv = photo_booth_get_instance_private (pb);
|
PhotoBoothPrivate *priv = photo_booth_get_instance_private (pb);
|
||||||
photo_booth_change_state (pb, PB_STATE_PREVIEW);
|
photo_booth_change_state (pb, PB_STATE_PREVIEW);
|
||||||
gtk_label_set_text (priv->win->status, _("Touch screen to take a photo!"));
|
gtk_label_set_text (priv->win->status, _("Touch screen to take a photo!"));
|
||||||
|
photo_booth_window_hide_cursor (priv->win);
|
||||||
|
|
||||||
if (priv->screensaver_timeout > 0)
|
if (priv->screensaver_timeout > 0)
|
||||||
priv->screensaver_timeout_id = g_timeout_add_seconds (priv->screensaver_timeout, (GSourceFunc) photo_booth_screensaver, pb);
|
priv->screensaver_timeout_id = g_timeout_add_seconds (priv->screensaver_timeout, (GSourceFunc) photo_booth_screensaver, pb);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1064,6 +1067,7 @@ void photo_booth_background_clicked (GtkWidget *widget, GdkEventButton *event, P
|
||||||
PhotoBoothPrivate *priv = photo_booth_get_instance_private (pb);
|
PhotoBoothPrivate *priv = photo_booth_get_instance_private (pb);
|
||||||
priv = photo_booth_get_instance_private (pb);
|
priv = photo_booth_get_instance_private (pb);
|
||||||
GST_INFO_OBJECT (pb, "background clicked in state %s", photo_booth_state_get_name (priv->state));
|
GST_INFO_OBJECT (pb, "background clicked in state %s", photo_booth_state_get_name (priv->state));
|
||||||
|
|
||||||
if (priv->screensaver_timeout_id)
|
if (priv->screensaver_timeout_id)
|
||||||
{
|
{
|
||||||
int ret = g_source_remove (priv->screensaver_timeout_id);
|
int ret = g_source_remove (priv->screensaver_timeout_id);
|
||||||
|
@ -1102,6 +1106,7 @@ void photo_booth_background_clicked (GtkWidget *widget, GdkEventButton *event, P
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (priv->prints_remaining < 1)
|
// if (priv->prints_remaining < 1)
|
||||||
// photo_booth_get_printer_status (pb);
|
// photo_booth_get_printer_status (pb);
|
||||||
}
|
}
|
||||||
|
@ -1380,6 +1385,7 @@ static GstPadProbeReturn photo_booth_catch_photo_buffer (GstPad * pad, GstPadPro
|
||||||
photo_booth_change_state (pb, PB_STATE_PROCESS_PHOTO);
|
photo_booth_change_state (pb, PB_STATE_PROCESS_PHOTO);
|
||||||
GST_DEBUG_OBJECT (pb, "first buffer caught -> display in sink, invoke processing");
|
GST_DEBUG_OBJECT (pb, "first buffer caught -> display in sink, invoke processing");
|
||||||
gtk_widget_show (GTK_WIDGET (priv->win->button_yes));
|
gtk_widget_show (GTK_WIDGET (priv->win->button_yes));
|
||||||
|
photo_booth_window_show_cursor (priv->win);
|
||||||
gtk_label_set_text (priv->win->status, _("Print Photo? Touch background to cancel!"));
|
gtk_label_set_text (priv->win->status, _("Print Photo? Touch background to cancel!"));
|
||||||
g_main_context_invoke (NULL, (GSourceFunc) photo_booth_process_photo_plug_elements, pb);
|
g_main_context_invoke (NULL, (GSourceFunc) photo_booth_process_photo_plug_elements, pb);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -156,6 +156,20 @@ gboolean _pbw_tick_countdown (PhotoBoothWindow *win)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void photo_booth_window_hide_cursor (PhotoBoothWindow *win)
|
||||||
|
{
|
||||||
|
GdkDisplay *display = gdk_display_get_default ();
|
||||||
|
GdkCursor *cursor_blank = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
|
||||||
|
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (win)), cursor_blank);
|
||||||
|
}
|
||||||
|
|
||||||
|
void photo_booth_window_show_cursor (PhotoBoothWindow *win)
|
||||||
|
{
|
||||||
|
GdkDisplay *display = gdk_display_get_default ();
|
||||||
|
GdkCursor* cursor_arrow = gdk_cursor_new_for_display (display, GDK_ARROW);
|
||||||
|
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (win)), cursor_arrow);
|
||||||
|
}
|
||||||
|
|
||||||
void photo_booth_window_start_countdown (PhotoBoothWindow *win, gint count)
|
void photo_booth_window_start_countdown (PhotoBoothWindow *win, gint count)
|
||||||
{
|
{
|
||||||
PhotoBoothWindowPrivate *priv;
|
PhotoBoothWindowPrivate *priv;
|
||||||
|
|
|
@ -48,6 +48,8 @@ PhotoBoothWindow *photo_booth_window_new (PhotoBooth *pb);
|
||||||
void photo_booth_window_add_gtkgstwidget (PhotoBoothWindow *win, GtkWidget *gtkgstwidget);
|
void photo_booth_window_add_gtkgstwidget (PhotoBoothWindow *win, GtkWidget *gtkgstwidget);
|
||||||
void photo_booth_window_set_spinner (PhotoBoothWindow *win, gboolean active);
|
void photo_booth_window_set_spinner (PhotoBoothWindow *win, gboolean active);
|
||||||
void photo_booth_window_start_countdown (PhotoBoothWindow *win, gint count);
|
void photo_booth_window_start_countdown (PhotoBoothWindow *win, gint count);
|
||||||
|
void photo_booth_window_hide_cursor (PhotoBoothWindow *win);
|
||||||
|
void photo_booth_window_show_cursor (PhotoBoothWindow *win);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue