
Hi - here's a patch to add fullscreen output to the vout_x11.c plugin. 
vout_xvideo.c will be coming along in a little bit, if no one gets to it first.

This is my first patch (of any significance) ever, so I hope it's all okay!

If the output window isn't raised above your gnome-panel (or other windows), 
you'll have to tell your panel that it shouldn't be above everyone else.


David


-- Attached file included as plaintext by Listar --

--- vout_x11.old	Fri Apr 20 15:34:37 2001
+++ vout_x11.c	Fri Apr 20 16:09:45 2001
@@ -64,6 +64,18 @@
 
 #include "main.h"
 
+/* Fullscreen needs to be able to hide the wm decorations */
+#define MWM_HINTS_DECORATIONS   (1L << 1)
+#define PROP_MWM_HINTS_ELEMENTS 5
+typedef struct _mwmhints {
+	uint32_t flags;
+	uint32_t functions;
+	uint32_t decorations;
+	int32_t  input_mode;
+	uint32_t status;
+} MWMHints;
+
+
 /*****************************************************************************
  * vout_sys_t: video output X11 method descriptor
  *****************************************************************************
@@ -108,6 +120,9 @@
     /* Mouse pointer properties */
     boolean_t           b_mouse;         /* is the mouse pointer displayed ? */
 
+	/* Displaying fullscreen */
+    boolean_t           b_fullscreen;
+
 } vout_sys_t;
 
 /*****************************************************************************
@@ -199,8 +214,12 @@
     }
     p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
 
+    p_vout->p_sys->b_fullscreen = main_GetIntVariable( VOUT_FULLSCREEN_VAR,
+		                                VOUT_FULLSCREEN_DEFAULT );
+
     /* Spawn base window - this window will include the video output window,
      * but also command buttons, subtitles and other indicators */
+	
     if( X11CreateWindow( p_vout ) )
     {
         intf_ErrMsg( "vout error: cannot create X11 window" );
@@ -360,15 +379,17 @@
 {
     XEvent      xevent;                                         /* X11 event */
     boolean_t   b_resized;                        /* window has been resized */
+    boolean_t   b_gofullscreen;                    /* user wants full-screen */
     char        i_key;                                    /* ISO Latin-1 key */
     KeySym      x_key_symbol;
 
-
     /* Handle X11 events: ConfigureNotify events are parsed to know if the
      * output window's size changed, MapNotify and UnmapNotify to know if the
      * window is mapped (and if the display is useful), and ClientMessages
      * to intercept window destruction requests */
     b_resized = 0;
+    b_gofullscreen = 0;
+
     while( XCheckWindowEvent( p_vout->p_sys->p_display, p_vout->p_sys->window,
                               StructureNotifyMask | KeyPressMask |
                               ButtonPressMask | ButtonReleaseMask | 
@@ -432,6 +453,10 @@
                         case 'Q':
                             p_main->p_intf->b_die = 1;
                             break;
+						case 'f':
+						case 'F':
+							b_gofullscreen = 1;
+							break;
                         case '0':
                             network_ChannelJoin( 0 );
                             break;
@@ -533,14 +558,49 @@
         }
     }
 
-    /*
-     * Handle vout window resizing
-     */
-    if( b_resized )
-    {
-        /* If interface window has been resized, change vout size */
-        intf_DbgMsg( "resizing output window" );
-        p_vout->i_width =  p_vout->p_sys->i_width;
+	if ( b_gofullscreen )
+	{
+		char *psz_display;
+		/* Open display, unsing 'vlc_display' or DISPLAY environment variable */
+		psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
+
+		intf_DbgMsg( "changing full-screen status" );
+
+		p_vout->p_sys->b_fullscreen = !p_vout->p_sys->b_fullscreen;
+
+		/* Get rid of the old window */
+		XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window );
+		XFreeGC( p_vout->p_sys->p_display, p_vout->p_sys->gc );
+
+		/* And create a new one */
+		if( X11CreateWindow( p_vout ) )
+		{
+			intf_ErrMsg( "vout error: cannot create X11 window" );
+			XCloseDisplay( p_vout->p_sys->p_display );
+
+			free( p_vout->p_sys );
+			return( 1 );
+		}
+
+		if( X11InitDisplay( p_vout, psz_display ) )
+		{
+			intf_ErrMsg( "vout error: cannot initialize X11 display" );
+			XCloseDisplay( p_vout->p_sys->p_display );
+			free( p_vout->p_sys );
+			return( 1 );
+		}
+		/* We've changed the size, update it */
+        p_vout->i_changes |= VOUT_SIZE_CHANGE;
+	}
+
+	/*
+	 * Handle vout window resizing
+	 */
+	if( b_resized )
+	{
+		/* If interface window has been resized, change vout size */
+		intf_DbgMsg( "resizing output window" );
+		p_vout->i_width =  p_vout->p_sys->i_width;
         p_vout->i_height = p_vout->p_sys->i_height;
         p_vout->i_changes |= VOUT_SIZE_CHANGE;
     }
@@ -687,39 +747,71 @@
     boolean_t               b_configure_notify;
     boolean_t               b_map_notify;
 
-    /* Set main window's size */
-    p_vout->p_sys->i_width =  main_GetIntVariable( VOUT_WIDTH_VAR,
-                                                   VOUT_WIDTH_DEFAULT );
-    p_vout->p_sys->i_height = main_GetIntVariable( VOUT_HEIGHT_VAR,
-                                                   VOUT_HEIGHT_DEFAULT );
-
-    /* Prepare window manager hints and properties */
-    xsize_hints.base_width          = p_vout->p_sys->i_width;
-    xsize_hints.base_height         = p_vout->p_sys->i_height;
-    xsize_hints.flags               = PSize;
-    p_vout->p_sys->wm_protocols     = XInternAtom( p_vout->p_sys->p_display,
-                                                   "WM_PROTOCOLS", True );
-    p_vout->p_sys->wm_delete_window = XInternAtom( p_vout->p_sys->p_display,
-                                                   "WM_DELETE_WINDOW", True );
-
-    /* Prepare window attributes */
-    xwindow_attributes.backing_store = Always;       /* save the hidden part */
-    xwindow_attributes.background_pixel = WhitePixel( p_vout->p_sys->p_display,
-                                                      p_vout->p_sys->i_screen );
-
-    xwindow_attributes.event_mask = ExposureMask | StructureNotifyMask;
-
-    /* Create the window and set hints - the window must receive ConfigureNotify
-     * events, and, until it is displayed, Expose and MapNotify events. */
-    p_vout->p_sys->window =
-            XCreateWindow( p_vout->p_sys->p_display,
+	XColor                  background, ignored;
+	XSetWindowAttributes  attr;
+	XClassHint           *xv_xclasshint;
+	Atom                  prop;
+	MWMHints              mwmhints;
+
+	/* If we're full screen, we're full screen! */
+	if ( p_vout->p_sys->b_fullscreen ) 
+	{
+		p_vout->p_sys->i_width = DisplayWidth( p_vout->p_sys->p_display, 
+									p_vout->p_sys->i_screen );
+		p_vout->p_sys->i_height =  DisplayHeight( p_vout->p_sys->p_display, 
+									p_vout->p_sys->i_screen ); 
+		p_vout->i_width =  p_vout->p_sys->i_width;
+        p_vout->i_height = p_vout->p_sys->i_height;
+	} else {
+		/* Set main window's size */
+		p_vout->p_sys->i_width =  main_GetIntVariable( VOUT_WIDTH_VAR,
+													   VOUT_WIDTH_DEFAULT );
+		p_vout->p_sys->i_height = main_GetIntVariable( VOUT_HEIGHT_VAR,
+													   VOUT_HEIGHT_DEFAULT );
+		p_vout->i_width =  p_vout->p_sys->i_width;
+        p_vout->i_height = p_vout->p_sys->i_height;
+	}
+
+	/* Prepare window manager hints and properties */
+	xsize_hints.base_width          = p_vout->p_sys->i_width;
+	xsize_hints.base_height         = p_vout->p_sys->i_height;
+	xsize_hints.flags               = PSize;
+	p_vout->p_sys->wm_protocols     = XInternAtom( p_vout->p_sys->p_display,
+												   "WM_PROTOCOLS", True );
+	p_vout->p_sys->wm_delete_window = XInternAtom( p_vout->p_sys->p_display,
+												   "WM_DELETE_WINDOW", True );
+
+	/* Prepare window attributes */
+	xwindow_attributes.backing_store = Always;       /* save the hidden part */
+	xwindow_attributes.background_pixel = BlackPixel( p_vout->p_sys->p_display,
+													  p_vout->p_sys->i_screen );
+	xwindow_attributes.event_mask = ExposureMask | StructureNotifyMask;
+	
+
+	/* Create the window and set hints - the window must receive ConfigureNotify
+	 * events, and, until it is displayed, Expose and MapNotify events. */
+
+	p_vout->p_sys->window =
+		XCreateWindow( p_vout->p_sys->p_display,
                            DefaultRootWindow( p_vout->p_sys->p_display ),
                            0, 0,
-                           p_vout->p_sys->i_width, p_vout->p_sys->i_height, 1,
+                           p_vout->p_sys->i_width, p_vout->p_sys->i_height, 0,
                            0, InputOutput, 0,
                            CWBackingStore | CWBackPixel | CWEventMask,
                            &xwindow_attributes );
 
+	if ( p_vout->p_sys->b_fullscreen ) {
+		prop = XInternAtom(p_vout->p_sys->p_display, "_MOTIF_WM_HINTS", False);
+		mwmhints.flags = MWM_HINTS_DECORATIONS;
+		mwmhints.decorations = 0;
+		XChangeProperty(p_vout->p_sys->p_display, p_vout->p_sys->window, prop, prop, 32,
+			PropModeReplace, (unsigned char *) &mwmhints,
+			PROP_MWM_HINTS_ELEMENTS);
+
+		XSetTransientForHint(p_vout->p_sys->p_display, p_vout->p_sys->window, None);
+		XRaiseWindow(p_vout->p_sys->p_display, p_vout->p_sys->window);
+	}
+
     /* Set window manager hints and properties: size hints, command,
      * window's name, and accepted protocols */
     XSetWMNormalHints( p_vout->p_sys->p_display, p_vout->p_sys->window,
@@ -797,8 +889,14 @@
                                  CWColormap, &xwindow_attributes );
     }
 
+	if (p_vout->p_sys->b_fullscreen) {
+		XSetInputFocus (p_vout->p_sys->p_display, p_vout->p_sys->window, RevertToNone, CurrentTime);
+		XMoveWindow (p_vout->p_sys->p_display, p_vout->p_sys->window, 0, 0);
+	}
+
     /* At this stage, the window is open, displayed, and ready to
      * receive data */
+	
     return( 0 );
 }
 
@@ -814,6 +912,8 @@
     XVisualInfo *               p_xvisual;           /* visuals informations */
     XVisualInfo                 xvisual_template;         /* visual template */
     int                         i_count;                       /* array size */
+
+
 
     /* Initialize structure */
     p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );



