* vout_x11.c: X11 video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout_x11.c,v 1.20 2001/04/21 22:49:24 sam Exp $
+ * $Id: vout_x11.c,v 1.26 2001/05/30 17:03:12 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <sys/ipc.h>
#endif
+#ifndef WIN32
+#include <netinet/in.h> /* BSD: struct in_addr */
+#endif
+
#include <sys/shm.h> /* shmget(), shmctl() */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "threads.h"
#include "mtime.h"
#include "tests.h"
-#include "modules.h"
#include "video.h"
#include "video_output.h"
#include "main.h"
+#include "modules.h"
+#include "modules_export.h"
+
/*****************************************************************************
* vout_sys_t: video output X11 method descriptor
*****************************************************************************
/* Mouse pointer properties */
boolean_t b_mouse; /* is the mouse pointer displayed ? */
- /* Displaying fullscreen */
- boolean_t b_fullscreen;
-
} vout_sys_t;
/* Fullscreen needs to be able to hide the wm decorations */
}
p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
- p_vout->p_sys->b_fullscreen
+ p_vout->b_fullscreen
= main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT );
/* Spawn base window - this window will include the video output window,
/* Set bytes per line and initialize buffers */
p_vout->i_bytes_per_line = p_vout->p_sys->p_ximage[0]->bytes_per_line;
- vout_SetBuffers( p_vout, p_vout->p_sys->p_ximage[ 0 ]->data,
- p_vout->p_sys->p_ximage[ 1 ]->data );
+ p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_ximage[ 0 ]->data,
+ p_vout->p_sys->p_ximage[ 1 ]->data );
/* Set date for autohiding cursor */
p_vout->p_sys->i_lastmoved = mdate();
{
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;
* 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;
+ b_resized = 0;
while( XCheckWindowEvent( p_vout->p_sys->p_display, p_vout->p_sys->window,
StructureNotifyMask | KeyPressMask |
ButtonPressMask | ButtonReleaseMask |
break;
case 'f':
case 'F':
- b_gofullscreen = 1;
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
case '0':
network_ChannelJoin( 0 );
X11TogglePointer( p_vout );
}
}
-#ifdef DEBUG
/* Other event */
else
{
- intf_DbgMsg( "vout: unhandled event %d received", xevent.type );
+ intf_WarnMsg( 3, "vout: unhandled event %d received", xevent.type );
}
-#endif
}
/* ClientMessage event - only WM_PROTOCOLS with WM_DELETE_WINDOW data
}
}
- if ( b_gofullscreen )
+ if ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
{
char *psz_display;
- /* Open display, unsing 'vlc_display' or DISPLAY environment variable */
+ /* Open display, unsing 'vlc_display' or the DISPLAY
+ * environment variable */
psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
intf_DbgMsg( "vout: changing full-screen status" );
- p_vout->p_sys->b_fullscreen = !p_vout->p_sys->b_fullscreen;
+ p_vout->b_fullscreen = !p_vout->b_fullscreen;
+ p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
/* Get rid of the old window */
XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window );
boolean_t b_map_notify;
/* If we're full screen, we're full screen! */
- if( p_vout->p_sys->b_fullscreen )
+ if( p_vout->b_fullscreen )
{
p_vout->p_sys->i_width = DisplayWidth( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen );
CWBackingStore | CWBackPixel | CWEventMask,
&xwindow_attributes );
- if ( p_vout->p_sys->b_fullscreen )
+ if ( p_vout->b_fullscreen )
{
prop = XInternAtom(p_vout->p_sys->p_display, "_MOTIF_WM_HINTS", False);
mwmhints.flags = MWM_HINTS_DECORATIONS;
CWColormap, &xwindow_attributes );
}
- if( p_vout->p_sys->b_fullscreen )
+ if( p_vout->b_fullscreen )
{
XSetInputFocus( p_vout->p_sys->p_display, p_vout->p_sys->window,
RevertToNone, CurrentTime );