summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-04-06 06:17:50 +0000
committerjstebbins <[email protected]>2009-04-06 06:17:50 +0000
commit7ca544fec43a9d3f68830d8d47840f6d06563ffa (patch)
treeef026c918057c45b5e39e48cbc9de59de8168ba3 /gtk/src
parent9cad799608299f5f56a3ae6cfce3ec761c23b8fb (diff)
LinGui: improve behavior of hud enter/leave and timout events
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2305 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/ghb.ui23
-rw-r--r--gtk/src/preview.c30
2 files changed, 26 insertions, 27 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 7d4fc799c..797463353 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -4876,11 +4876,11 @@ location as the movie.</property>
<child>
<object class="GtkDrawingArea" id="preview_image">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<property name="app_paintable">True</property>
<signal name="motion-notify-event" handler="preview_motion_cb"/>
<signal name="leave-notify-event" handler="preview_leave_cb"/>
- <signal handler="preview_image_configure_cb" name="configure-event"/>
</object>
<packing>
</packing>
@@ -4902,8 +4902,10 @@ location as the movie.</property>
<property name="visible">True</property>
<property name="width-request">500</property>
<property name="app-paintable">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
+ <property name="above-child">False</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK</property>
<signal name="enter-notify-event" handler="hud_enter_cb"/>
+ <signal name="leave-notify-event" handler="preview_leave_cb"/>
<child>
<object class="GtkAlignment" id="alignment53">
<property name="visible">True</property>
@@ -4924,6 +4926,8 @@ location as the movie.</property>
<property name="adjustment">adjustment19</property>
<property name="digits">0</property>
<property name="value_pos">bottom</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal name="value_changed" handler="preview_frame_value_changed_cb"/>
</object>
<packing>
@@ -4942,6 +4946,8 @@ location as the movie.</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal name="clicked" handler="live_preview_start_cb"/>
<child>
<object class="GtkImage" id="live_preview_play_image">
@@ -4961,6 +4967,8 @@ location as the movie.</property>
<property name="adjustment">preview_progress_adj</property>
<property name="draw_value">False</property>
<property name="value_pos">right</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal name="value_changed" handler="live_preview_seek_cb"/>
</object>
<packing>
@@ -4983,7 +4991,8 @@ location as the movie.</property>
<object class="GtkProgressBar" id="live_encode_progress">
<property name="height_request">16</property>
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
</object>
<packing>
<property name="expand">False</property>
@@ -5034,6 +5043,8 @@ location as the movie.</property>
<property name="can_focus">True</property>
<property name="adjustment">adjustment21</property>
<property name="numeric">True</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal name="value_changed" handler="preview_duration_changed_cb"/>
</object>
<packing>
@@ -5052,6 +5063,8 @@ location as the movie.</property>
<property name="can_focus">True</property>
<property name="tooltip-text" translatable="yes">View Fullscreen Preview</property>
<property name="label" translatable="yes">Fullscreen</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal handler="fullscreen_clicked_cb" name="clicked"/>
</object>
<packing>
@@ -5065,6 +5078,8 @@ location as the movie.</property>
<property name="can_focus">True</property>
<property name="tooltip-text" translatable="yes">Open Picture Settings</property>
<property name="label" translatable="yes">Settings</property>
+ <property name="events">GDK_ENTER_NOTIFY_MASK</property>
+ <signal name="enter-notify-event" handler="hud_enter_cb"/>
<signal handler="picture_settings_alt2_clicked_cb" name="clicked"/>
</object>
<packing>
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 511e8f7b4..c7e825eac 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -988,6 +988,7 @@ hud_timeout(signal_user_data_t *ud)
{
GtkWidget *widget;
+ g_debug("hud_timeout()");
widget = GHB_WIDGET(ud->builder, "preview_hud");
gtk_widget_hide(widget);
hud_timeout_id = 0;
@@ -1000,6 +1001,7 @@ hud_enter_cb(
GdkEventCrossing *event,
signal_user_data_t *ud)
{
+ g_debug("hud_enter_cb()");
if (hud_timeout_id != 0)
{
GMainContext *mc;
@@ -1022,6 +1024,7 @@ preview_leave_cb(
GdkEventCrossing *event,
signal_user_data_t *ud)
{
+ g_debug("hud_leave_cb()");
if (hud_timeout_id != 0)
{
GMainContext *mc;
@@ -1042,6 +1045,7 @@ preview_motion_cb(
GdkEventMotion *event,
signal_user_data_t *ud)
{
+ //g_debug("hud_motion_cb %d", hud_timeout_id);
if (hud_timeout_id != 0)
{
GMainContext *mc;
@@ -1052,36 +1056,16 @@ preview_motion_cb(
if (source != NULL)
g_source_destroy(source);
}
- else
+ widget = GHB_WIDGET(ud->builder, "preview_hud");
+ if (!GTK_WIDGET_VISIBLE(widget))
{
- GtkWidget *widget;
-
- widget = GHB_WIDGET(ud->builder, "preview_hud");
gtk_widget_show(widget);
}
- hud_timeout_id = g_timeout_add_seconds(10, (GSourceFunc)hud_timeout, ud);
+ hud_timeout_id = g_timeout_add_seconds(4, (GSourceFunc)hud_timeout, ud);
return FALSE;
}
G_MODULE_EXPORT gboolean
-preview_image_configure_cb(
- GtkWidget *widget,
- GdkEventConfigure *event,
- signal_user_data_t *ud)
-{
- static gint w = 0, h = 0;
-
- g_debug("preview_image_configure_cb()");
- if ((w != event->width) || (h != event->height))
- {
- w = event->width;
- h = event->height;
- }
- return FALSE;
-}
-
-
-G_MODULE_EXPORT gboolean
preview_configure_cb(
GtkWidget *widget,
GdkEventConfigure *event,