Backport a fix from upstream: don't hide controls and mouse in

fullscreen mode when mouse is over controls.

While here, make our defaults really work as it was intended.
This commit is contained in:
dcoppa 2010-11-15 11:11:34 +00:00
parent 6eae70237d
commit 53cbf96152
4 changed files with 109 additions and 17 deletions

View File

@ -1,7 +1,8 @@
# $OpenBSD: Makefile,v 1.26 2010/11/08 15:20:33 dcoppa Exp $
# $OpenBSD: Makefile,v 1.27 2010/11/15 11:11:34 dcoppa Exp $
COMMENT = GTK+/GNOME frontend for MPlayer
DISTNAME = gnome-mplayer-1.0.0
REVISION = 0
CATEGORIES = x11 multimedia
MAINTAINER = David Coppa <dcoppa@openbsd.org>

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_common_h,v 1.3 2010/11/15 11:11:34 dcoppa Exp $
fix from upstream: don't hide controls and mouse in fullscreen mode
when mouse is over controls
--- src/common.h.orig Tue Oct 19 18:33:40 2010
+++ src/common.h Mon Nov 15 08:35:10 2010
@@ -369,6 +369,7 @@ gboolean disable_embeddedfonts;
gboolean disable_animation;
gint auto_hide_timeout;
gboolean always_hide_after_timeout;
+gboolean mouse_over_controls;
gchar *subtitlefont;
gdouble subtitle_scale;
gdouble subtitle_delay;

View File

@ -1,11 +1,53 @@
$OpenBSD: patch-src_gui_c,v 1.9 2010/11/08 15:04:15 dcoppa Exp $
$OpenBSD: patch-src_gui_c,v 1.10 2010/11/15 11:11:34 dcoppa Exp $
adapt audio/video device selection gui
set DVD device to /dev/rcd0c instead of /dev/dvd
--- src/gui.c.orig Mon Nov 8 11:15:15 2010
+++ src/gui.c Mon Nov 8 11:24:41 2010
@@ -5053,9 +5053,6 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
fix from upstream: don't hide controls and mouse in fullscreen mode
when mouse is over controls
--- src/gui.c.orig Mon Nov 15 08:35:34 2010
+++ src/gui.c Mon Nov 15 08:35:10 2010
@@ -2716,7 +2716,7 @@ gboolean slide_panel_away(gpointer data)
}
// mutex was already locked, this is good since we only want to do the animation if locked
- if (GTK_IS_WIDGET(fs_controls) && get_visible(fs_controls)) {
+ if (GTK_IS_WIDGET(fs_controls) && get_visible(fs_controls) && mouse_over_controls == FALSE) {
gtk_widget_hide(fs_controls);
g_mutex_unlock(slide_away);
return FALSE;
@@ -2748,7 +2748,8 @@ gboolean make_panel_and_mouse_invisible(gpointer data)
GTimeVal currenttime;
if ((fullscreen || always_hide_after_timeout) && auto_hide_timeout > 0
- && (get_visible(controls_box) || fs_controls != NULL)) {
+ && (get_visible(controls_box) || fs_controls != NULL)
+ && mouse_over_controls == FALSE) {
g_get_current_time(&currenttime);
g_time_val_add(&currenttime, -auto_hide_timeout * G_USEC_PER_SEC);
if (last_movement_time > 0 && currenttime.tv_sec > last_movement_time) {
@@ -2835,6 +2836,19 @@ gboolean leave_button_callback(GtkWidget * widget, Gdk
return FALSE;
}
+gboolean fs_controls_entered(GtkWidget * widget, GdkEventCrossing * event, gpointer data)
+{
+ mouse_over_controls = TRUE;
+ return FALSE;
+}
+
+gboolean fs_controls_left(GtkWidget * widget, GdkEventCrossing * event, gpointer data)
+{
+ mouse_over_controls = FALSE;
+ return FALSE;
+}
+
+
void menuitem_open_callback(GtkMenuItem * menuitem, void *data)
{
@@ -5053,9 +5067,6 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
gtk_combo_box_append_text(GTK_COMBO_BOX(config_vo), "gl2");
gtk_combo_box_append_text(GTK_COMBO_BOX(config_vo), "x11");
gtk_combo_box_append_text(GTK_COMBO_BOX(config_vo), "xv");
@ -15,7 +57,7 @@ set DVD device to /dev/rcd0c instead of /dev/dvd
if (vo != NULL) {
if (strcmp(vo, "gl") == 0)
@@ -5066,16 +5063,10 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
@@ -5066,16 +5077,10 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
gtk_combo_box_set_active(GTK_COMBO_BOX(config_vo), 2);
if (strcmp(vo, "xv") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(config_vo), 3);
@ -33,7 +75,7 @@ set DVD device to /dev/rcd0c instead of /dev/dvd
}
}
}
@@ -5145,39 +5136,36 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
@@ -5145,39 +5150,36 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
#ifdef GTK2_12_ENABLED
gtk_widget_set_tooltip_text(config_ao,
_
@ -83,7 +125,7 @@ set DVD device to /dev/rcd0c instead of /dev/dvd
}
}
}
@@ -5264,8 +5252,8 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
@@ -5264,8 +5266,8 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
j = -1;
config_mplayer_dvd_device = gtk_combo_box_entry_new_text();
@ -94,7 +136,7 @@ set DVD device to /dev/rcd0c instead of /dev/dvd
j = i;
}
i++;
@@ -6634,9 +6622,9 @@ GtkWidget *create_window(gint windowid)
@@ -6634,9 +6636,9 @@ GtkWidget *create_window(gint windowid)
gtk_menu_append(menu_file_tv, GTK_WIDGET(menuitem_file_open_dtv));
#ifdef HAVE_GPOD
menuitem_file_open_ipod =
@ -106,3 +148,14 @@ set DVD device to /dev/rcd0c instead of /dev/dvd
gtk_menu_append(menu_file, GTK_WIDGET(menuitem_file_open_ipod));
#endif
@@ -7658,6 +7660,10 @@ void show_fs_controls()
if (fs_controls == NULL && fullscreen) {
fs_controls = gtk_window_new(GTK_WINDOW_POPUP);
+ gtk_widget_add_events(fs_controls, GDK_ENTER_NOTIFY_MASK);
+ gtk_widget_add_events(fs_controls, GDK_LEAVE_NOTIFY_MASK);
+ g_signal_connect(G_OBJECT(fs_controls), "enter_notify_event", G_CALLBACK(fs_controls_entered), NULL);
+ g_signal_connect(G_OBJECT(fs_controls), "leave_notify_event", G_CALLBACK(fs_controls_left), NULL);
g_object_ref(hbox);
gtk_container_remove(GTK_CONTAINER(controls_box), hbox);
gtk_container_add(GTK_CONTAINER(fs_controls), hbox);

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_main_c,v 1.7 2010/11/08 15:04:15 dcoppa Exp $
$OpenBSD: patch-src_main_c,v 1.8 2010/11/15 11:11:34 dcoppa Exp $
set some sane defaults:
use mplayer's software volume control (see pkg/MESSAGE)
@ -6,30 +6,30 @@ disable bar animation in full screen
use xscrnsaver controls over gnome-power-manager
--- src/main.c.orig Tue Oct 19 18:33:40 2010
+++ src/main.c Mon Nov 8 15:43:36 2010
@@ -689,9 +689,9 @@ int main(int argc, char *argv[])
+++ src/main.c Mon Nov 15 11:49:10 2010
@@ -689,8 +689,8 @@ int main(int argc, char *argv[])
playlist_visible = FALSE;
disable_fullscreen = FALSE;
disable_framedrop = FALSE;
- softvol = FALSE;
- remember_softvol = FALSE;
- volume_softvol = -1;
+ softvol = TRUE;
+ remember_softvol = TRUE;
+ volume_softvol = 50;
volume_softvol = -1;
volume_gain = 0;
subtitlefont = NULL;
subtitle_codepage = NULL;
@@ -705,7 +705,7 @@ int main(int argc, char *argv[])
@@ -705,8 +705,9 @@ int main(int argc, char *argv[])
reallyverbose = 0;
embedding_disabled = FALSE;
disable_pause_on_click = FALSE;
- disable_animation = FALSE;
+ disable_animation = TRUE;
auto_hide_timeout = 3;
+ mouse_over_controls = FALSE;
use_mediakeys = TRUE;
use_defaultpl = FALSE;
@@ -744,7 +744,7 @@ int main(int argc, char *argv[])
mplayer_bin = NULL;
@@ -744,7 +745,7 @@ int main(int argc, char *argv[])
start_second = 0;
play_length = 0;
save_loc = TRUE;
@ -38,3 +38,26 @@ use xscrnsaver controls over gnome-power-manager
screensaver_disabled = FALSE;
update_control_flag = FALSE;
gchar *filename;
@@ -796,9 +797,10 @@ int main(int argc, char *argv[])
audio_channels = gm_pref_store_get_int(gm_store, AUDIO_CHANNELS);
use_hw_audio = gm_pref_store_get_boolean(gm_store, USE_HW_AUDIO);
fullscreen = gm_pref_store_get_boolean(gm_store, FULLSCREEN);
- softvol = gm_pref_store_get_boolean(gm_store, SOFTVOL);
- remember_softvol = gm_pref_store_get_boolean(gm_store, REMEMBER_SOFTVOL);
- volume_softvol = gm_pref_store_get_int(gm_store, VOLUME_SOFTVOL);
+ softvol = gm_pref_store_get_boolean_with_default(gm_store, SOFTVOL, softvol);
+ remember_softvol = gm_pref_store_get_boolean_with_default(gm_store, REMEMBER_SOFTVOL, remember_softvol);
+ volume_softvol = gm_pref_store_get_int_with_default(gm_store, VOLUME_SOFTVOL, volume_softvol);
+ if (volume_softvol == -1) volume_softvol = 50;
volume_gain = gm_pref_store_get_int(gm_store, VOLUME_GAIN);
forcecache = gm_pref_store_get_boolean(gm_store, FORCECACHE);
vertical_layout = gm_pref_store_get_boolean(gm_store, VERTICAL);
@@ -815,7 +817,7 @@ int main(int argc, char *argv[])
disable_ass = gm_pref_store_get_boolean(gm_store, DISABLEASS);
disable_embeddedfonts = gm_pref_store_get_boolean(gm_store, DISABLEEMBEDDEDFONTS);
disable_pause_on_click = gm_pref_store_get_boolean(gm_store, DISABLEPAUSEONCLICK);
- disable_animation = gm_pref_store_get_boolean(gm_store, DISABLEANIMATION);
+ disable_animation = gm_pref_store_get_boolean_with_default(gm_store, DISABLEANIMATION, disable_animation);
auto_hide_timeout =
gm_pref_store_get_int_with_default(gm_store, AUTOHIDETIMEOUT, auto_hide_timeout);
disable_cover_art_fetch = gm_pref_store_get_boolean(gm_store, DISABLE_COVER_ART_FETCH);