# HG changeset patch
# User Darren Salt <[EMAIL PROTECTED]>
# Date 1170952695 0
# Node ID 90b0fbb02fe6421420cf988b8d9b34a182767681
# Parent 1d119b3797b56e076c0c85748b77d85b07f8f0f6
Config item for whether the video window is always sticky in full-screen mode.
Also add a corresponding JS item (vo_fullscreen.sticky) and menu item.
Fix a bug which would cause a BadWindow error if the fs window isn't sticky.
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 ChangeLog
--- a/ChangeLog Thu Feb 08 16:38:15 2007 +0000
+++ b/ChangeLog Thu Feb 08 16:32:20 2007 +0000
@@ -28,6 +28,9 @@ 0.5.900:2007/??/??
obsoleted next year.
* Brought vo_deinterlace into line with the other two chain objects
by adding the missing property & method.
+ * Added a config item to control whether, when in full-screen mode,
+ the video window is forcibly stuck to all desktops & viewports.
+ This is currently only checked at startup.
* Reworked the JS property code somewhat. No user-visible changes.
* Only display the "broken xine-lib" message (for when there is no
demuxer for the logo image) at most once.
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/globals.h
--- a/src/globals.h Thu Feb 08 16:38:15 2007 +0000
+++ b/src/globals.h Thu Feb 08 16:32:20 2007 +0000
@@ -65,7 +65,7 @@ typedef struct {
typedef struct {
GtkToggleAction *fullscreen, *resize_factor, *auto_resize, *auto_rescale,
*deinterlace, *vo_postproc, *ao_postproc, *fs_toolbar,
- *wm_toolbar, *wm_toolbar_snap, *wm_unblank;
+ *wm_toolbar, *wm_toolbar_snap, *wm_unblank, *fs_sticky;
GSList *aspect, *vis, *fs_toolbar_pos, *video_size, *subtitles;
GtkAction *keypad;
} action_items_t;
@@ -82,6 +82,8 @@ extern xine_video_port_t *video_port;
extern xine_video_port_t *video_port;
extern GAsyncQueue *js_queue;
+
+extern gboolean fs_always_sticky;
#define MAX_MRL_LEN 1024
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/menu.c
--- a/src/menu.c Thu Feb 08 16:38:15 2007 +0000
+++ b/src/menu.c Thu Feb 08 16:32:20 2007 +0000
@@ -302,6 +302,7 @@ JS_CB_T (WMUnblank)
{
gtk_video_set_windowed_unblank ((GtkVideo *)gtv, v);
}
+JS_CB_T (FSSticky) { window_fs_stickiness_update (v); }
/* Audio */
JS_CB (AudioSettings, "settings_show (1);")
@@ -407,12 +408,13 @@ static GtkToggleActionEntry toggle_actio
CB(VideoPP, NULL, N_("_Post-processing"), NULL,
FALSE),
CB(AudioPP, NULL, N_("_Post-processing"), NULL,
FALSE),
CB(WMUnblank, NULL, N_("Prevent _blanking in windowed mode"),
NULL, FALSE),
+ CB(FSSticky, NULL, N_("Force _stickiness in full-screen mode"),
NULL, FALSE),
};
static const char *const toggle_prefs[] = {
NULL, NULL, NULL, NULL, NULL,
"gui.magnify_lowres_video", "gui.post_plugins.deinterlace_enable",
"gui.post_plugins.video_enable", "gui.post_plugins.audio_enable",
- "gui.windowedmode_unblank"
+ "gui.windowedmode_unblank", "gui.fullscreen_always_sticky",
};
#undef CB
@@ -555,6 +557,7 @@ static GtkWidget *add_menu_ui (GtkUIMana
"</menu>\n"
"<menu action='ViewMisc'>\n"
"<menuitem action='WMUnblank' />\n"
+ "<menuitem action='FSSticky' />\n"
"</menu>\n"
"<separator />\n"
"<menuitem action='EngineLog' />\n"
@@ -719,6 +722,7 @@ void create_menus (GtkWidget *window)
action_items.wm_toolbar = get_toggle ("WMToolbarVisible");
action_items.wm_toolbar_snap = get_toggle ("WMToolbarSnap");
action_items.wm_unblank = get_toggle ("WMUnblank");
+ action_items.fs_sticky = get_toggle ("FSSticky");
action_items.aspect = get_radio_group ("AspectAuto");
action_items.vis = get_radio_group ("VisNone");
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/noskin_window.c
--- a/src/noskin_window.c Thu Feb 08 16:38:15 2007 +0000
+++ b/src/noskin_window.c Thu Feb 08 16:32:20 2007 +0000
@@ -233,7 +233,8 @@ static gboolean window_fs_toolbar_show_i
window_fs_toolbar_set_geometry ();
window_fs_toolbar_move (NULL);
window_show (fs_toolbar, NULL);
- gtk_window_stick (GTK_WINDOW(fs_toolbar));
+ if (fs_always_sticky)
+ gtk_window_stick (GTK_WINDOW(fs_toolbar));
XChangeProperty (GDK_WINDOW_XDISPLAY (fs_toolbar->window),
GDK_WINDOW_XWINDOW (fs_toolbar->window), opacity_lock,
XA_CARDINAL, 32, PropModeReplace,
@@ -331,6 +332,19 @@ void window_wm_toolbar_set_snap (gboolea
}
/* callbacks */
+
+void window_fs_stickiness_update (gboolean data)
+{
+ fs_always_sticky = data;
+
+ if (gtk_video_is_fullscreen ((GtkVideo *) gtv))
+ {
+ if (data || app_prop.sticky)
+ gtk_window_stick ((GtkWindow *) app);
+ else
+ gtk_window_unstick ((GtkWindow *) app);
+ }
+}
#ifdef WINDOW_STACKING_HACK
/* whether gdk_window_lower() is used; present in case the wm toolbar window
@@ -451,10 +465,13 @@ app_state_cb (GtkWindow *window, GdkEven
gtk_video_deny_shrink ((GtkVideo *) gtv);
/* restore stickiness as was, pre-fullscreen */
- if (app_prop.sticky)
- gtk_window_stick (window);
- else
- gtk_window_unstick (window);
+ if (fs_always_sticky)
+ {
+ if (app_prop.sticky)
+ gtk_window_stick (window);
+ else
+ gtk_window_unstick (window);
+ }
/* restore handling wrt window stack */
gtk_window_set_keep_above (window, FALSE);
@@ -485,7 +502,8 @@ app_state_cb (GtkWindow *window, GdkEven
else
{
gtk_window_set_shade (window, FALSE);
- gtk_window_stick (window);
+ if (fs_always_sticky)
+ gtk_window_stick (window);
if (!wm_toolbar)
gtk_container_foreach (GTK_CONTAINER (window->bin.child),
fs_show_hide, NULL);
@@ -567,7 +585,7 @@ xevent_properties (void)
if (app_prop.real_sticky != new_prop.real_sticky)
{
- if (!new_prop.fs)
+ if (!new_prop.fs || !fs_always_sticky)
new_prop.sticky = new_prop.real_sticky;
else if (!new_prop.real_sticky)
{
@@ -599,11 +617,13 @@ xevent_filter_cb (GdkXEvent *gx, GdkEven
return GDK_FILTER_REMOVE; /* else the screen goes black :-| */
case FocusOut:
- if (gtk_video_is_fullscreen ((GtkVideo *) gtv))
+ if (gtk_video_is_fullscreen ((GtkVideo *) gtv)
+ && GTK_WIDGET_MAPPED (gtv))
{
Display *xd = GDK_WINDOW_XDISPLAY (((GtkWidget *) d)->window);
Window fw = None;
int fr;
+ gdk_error_trap_push ();
XGetInputFocus (xd, &fw, &fr);
GdkWindow *gw = gdk_window_lookup (fw);
#ifdef HAVE_XINERAMA
@@ -612,6 +632,7 @@ xevent_filter_cb (GdkXEvent *gx, GdkEven
if (!gw || gw == fs_toolbar->window)
#endif
XSetInputFocus (xd, x->xany.window, RevertToParent, CurrentTime);
+ gdk_error_trap_pop ();
}
return GDK_FILTER_REMOVE;
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/player.c
--- a/src/player.c Thu Feb 08 16:38:15 2007 +0000
+++ b/src/player.c Thu Feb 08 16:32:20 2007 +0000
@@ -1093,11 +1093,17 @@ void player_init (void)
{ "y", N_("v=int, min, max; video zoom (within window)"), UI_XINE_PARAM
(XINE_PARAM_VO_ZOOM_Y, NULL), XINE_VO_ZOOM_MIN, XINE_VO_ZOOM_MAX },
{ NULL }
};
+ static const ui_property_t fs_subprops[] = {
+ { "sticky", N_("v=bool, toggle(); forced stickiness in full-screen
mode"), UI_BOOL (fs_sticky, fs_always_sticky, NULL) },
+ { NULL }
+ };
ui_create_properties (int_props, NULL, SE_TYPE_INT);
ui_create_properties (bool_props, NULL, SE_TYPE_BOOL);
ui_create_properties (zoom_subprops, se_find_object (gse, NULL, "vo_zoom"),
SE_TYPE_INT);
+ ui_create_properties (fs_subprops, se_find_object (gse, NULL,
"vo_fullscreen"),
+ SE_TYPE_BOOL);
}
/* a few extras - chain definition should be done via the GUI */
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/ui.c
--- a/src/ui.c Thu Feb 08 16:38:15 2007 +0000
+++ b/src/ui.c Thu Feb 08 16:32:20 2007 +0000
@@ -51,6 +51,8 @@ gboolean fs_toolbar_visible = FALSE;
gboolean fs_toolbar_visible = FALSE;
gboolean wm_toolbar_visible = TRUE;
gboolean wm_toolbar_snap = TRUE;
+
+gboolean fs_always_sticky = FALSE;
GtkIconSize icon_size_logo;
@@ -799,6 +801,11 @@ void ui_preferences_register (xine_t *th
_("In windowed mode, whether the logo is shown after playing an
audio-only stream if no audio visualisation was active."), NULL,
0, gtk_true, NULL);
+ fs_always_sticky = xine_config_register_bool
+ (this, "gui.fullscreen_always_sticky", 1,
+ _("In full-screen mode, whether the video always appears on all desktops
& viewports"),
+ NULL, 0, NULL, NULL);
+
xine_config_register_enum
(this, "gui.fullscreen_toolbar", 1, tbar_pos_labels,
_("Default position & visibility of the full-screen toolbar"),
diff -r 90b0fbb02fe6421420cf988b8d9b34a182767681 -r
1d119b3797b56e076c0c85748b77d85b07f8f0f6 src/ui.h
--- a/src/ui.h Thu Feb 08 16:38:15 2007 +0000
+++ b/src/ui.h Thu Feb 08 16:32:20 2007 +0000
@@ -204,6 +204,7 @@ void window_wm_toolbar_set_snap (gboolea
void window_wm_toolbar_set_snap (gboolean);
gboolean window_wm_toolbar_snap (void);
void window_check_vis (gboolean force);
+void window_fs_stickiness_update (gboolean);
void ui_init (void);
gboolean ui_post_init (void);
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog