From: Darren S. <ds...@us...> - 2005-09-03 15:53:31
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23120/src Modified Files: noskin_window.c Log Message: Now that the window resizing seems to be working properly wrt no video, disable the window shading code. Fix full-screen mode (when using a combined video+toolbar window). Rearrange some init code to kill a compiler warning. Index: noskin_window.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/noskin_window.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- noskin_window.c 3 Sep 2005 02:51:29 -0000 1.78 +++ noskin_window.c 3 Sep 2005 15:53:23 -0000 1.79 @@ -60,6 +60,7 @@ static GtkWidget *fs_toolbar, *wm_toolbar = NULL; +#ifdef USE_NET_WM_STATE_SHADED static void gtk_window_set_shade (GtkWindow *w, gboolean shade) { GdkWindow *window = ((GtkWidget *)w)->window; @@ -81,6 +82,7 @@ XSendEvent (display, DefaultRootWindow (display) /*FIXME:screen*/, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } +#endif /* * audio only / vis check @@ -101,9 +103,11 @@ if (hv_new) { logprintf ("gxine: stream has video\n"); vis_hide (GTK_VIDEO(gtv), &audio_port); +#ifdef USE_NET_WM_STATE_SHADED if (wm_toolbar) gtk_window_set_shade (GTK_WINDOW (app), FALSE); else +#endif gtk_widget_show (gtv); is_shown = TRUE; } @@ -115,9 +119,11 @@ else if (vis_show (GTK_VIDEO(gtv), &audio_port)) { logprintf ("gxine: stream has audio (visualisation active)\n"); +#ifdef USE_NET_WM_STATE_SHADED if (wm_toolbar) gtk_window_set_shade (GTK_WINDOW (app), FALSE); else +#endif gtk_widget_show (gtv); is_shown = TRUE; } @@ -129,9 +135,11 @@ fs = FALSE; gtk_action_activate ((GtkAction *)action_items.fullscreen); } +#ifdef USE_NET_WM_STATE_SHADED if (wm_toolbar) gtk_window_set_shade (GTK_WINDOW (app), TRUE); else +#endif gtk_widget_hide (gtv); is_shown = FALSE; } @@ -140,8 +148,13 @@ /* Kludge: resize if the video widget visibility has been changed. * If you have a better way of doing this, submit a patch... */ +#ifdef USE_NET_WM_STATE_SHADED if (!fs && !wm_toolbar && is_shown != was_shown) gtk_window_resize (GTK_WINDOW(app), 10, 10); +#else + if (!fs && is_shown != was_shown) + gtk_window_resize (GTK_WINDOW(app), 10, 10); +#endif } } @@ -365,8 +378,18 @@ gtk_action_activate (&action_items.wm_toolbar->parent); } -gboolean app_state_cb (GtkWindow *window, GdkEventWindowState *event, - gpointer data) +static void fs_show_hide (GtkWidget *widget, gpointer show) +{ + if (widget == gtv) + return; + if (show) + gtk_widget_show (widget); + else + gtk_widget_hide (widget); +} + +static gboolean app_state_cb (GtkWindow *window, GdkEventWindowState *event, + gpointer data) { static gboolean sticky = FALSE, lock = FALSE; @@ -390,7 +413,10 @@ { if (!sticky) gtk_window_unstick (window); /* may have been stuck by us, not user */ - if (wm_toolbar_visible) + if (!wm_toolbar) + gtk_container_foreach (GTK_CONTAINER (window->bin.child), + fs_show_hide, window); + else if (wm_toolbar_visible) window_wm_toolbar_restore (); gtk_window_set_keep_above (window, FALSE); } @@ -398,7 +424,11 @@ { lock = !sticky; /* we may be triggering a state change: lock it out */ gtk_window_stick (window); - window_wm_toolbar_reset (); + if (!wm_toolbar) + gtk_container_foreach (GTK_CONTAINER (window->bin.child), + fs_show_hide, NULL); + else + window_wm_toolbar_reset (); gtk_window_set_keep_above (window, TRUE); } @@ -521,13 +551,6 @@ NULL); drag_drop_setup (app); - if (!wm_toolbar) - { - /* this vbox will also contain the info widgets and controls */ - vbox = gtk_vbox_new (0, 0); - gtk_container_add (GTK_CONTAINER (app), vbox); - } - /* * video widget */ @@ -551,25 +574,28 @@ if (xine_config_lookup_entry (xine, "gui.magnify_lowres_video", &entry)) gtk_video_set_auto_rescale ((GtkVideo *)gtv, entry.num_value); - /* - * menu bar (combined window) - */ - if (!wm_toolbar) { + /* + * main vbox, menu bar (combined window) + * also add the video widget + */ + + /* this vbox will also contain the info widgets and controls */ + vbox = gtk_vbox_new (0, 0); + gtk_container_add (GTK_CONTAINER (app), vbox); create_menus (app); gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0); - } - - /* now add the video widget... */ - gtk_container_add (GTK_CONTAINER (wm_toolbar ? app : vbox), gtv); - /* - * menu/info/tools window (separate windows) - */ - - if (wm_toolbar) + gtk_container_add (GTK_CONTAINER (vbox), gtv); + } + else { + /* + * menu/info/tools window (separate windows) + * also add the video widget + */ + W = GTK_WINDOW (wm_toolbar); gtk_window_set_title (W, _("gxine controls")); @@ -602,6 +628,8 @@ create_menus (wm_toolbar); gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0); + + gtk_container_add (GTK_CONTAINER (app), gtv); } /* time_widget / infobar */ |