X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=plugins%2Fx11%2Fvout_x11.c;h=eb7c2a3c3778507ad446cd37f9a39ea006ac9dcf;hb=440f9992ee947ea5fd0debbf35fdd1011c6404b3;hp=064210645f76139f829b2c7b7544538def7c67b9;hpb=9268862b2bb5a6a3c5d6467d18f75854df6c767a;p=vlc diff --git a/plugins/x11/vout_x11.c b/plugins/x11/vout_x11.c index 064210645f..eb7c2a3c37 100644 --- a/plugins/x11/vout_x11.c +++ b/plugins/x11/vout_x11.c @@ -2,10 +2,11 @@ * vout_x11.c: X11 video output display method ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vout_x11.c,v 1.19 2001/04/21 00:31:07 sam Exp $ + * $Id: vout_x11.c,v 1.26 2001/05/30 17:03:12 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar + * David Kennedy * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,10 @@ #include #endif +#ifndef WIN32 +#include /* BSD: struct in_addr */ +#endif + #include /* shmget(), shmctl() */ #include #include @@ -52,7 +57,6 @@ #include "threads.h" #include "mtime.h" #include "tests.h" -#include "modules.h" #include "video.h" #include "video_output.h" @@ -64,6 +68,9 @@ #include "main.h" +#include "modules.h" +#include "modules_export.h" + /***************************************************************************** * vout_sys_t: video output X11 method descriptor ***************************************************************************** @@ -108,9 +115,6 @@ typedef struct vout_sys_s /* 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 */ @@ -214,7 +218,7 @@ static int vout_Create( vout_thread_t *p_vout ) } 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, @@ -310,8 +314,8 @@ static int vout_Init( vout_thread_t *p_vout ) /* 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(); @@ -379,7 +383,6 @@ static int vout_Manage( vout_thread_t *p_vout ) { 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; @@ -387,9 +390,8 @@ static int vout_Manage( vout_thread_t *p_vout ) * 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 | @@ -455,7 +457,7 @@ static int vout_Manage( vout_thread_t *p_vout ) break; case 'f': case 'F': - b_gofullscreen = 1; + p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE; break; case '0': network_ChannelJoin( 0 ); @@ -531,13 +533,11 @@ static int vout_Manage( vout_thread_t *p_vout ) 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 @@ -557,15 +557,17 @@ static int vout_Manage( vout_thread_t *p_vout ) } } - 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 ); @@ -750,7 +752,7 @@ static int X11CreateWindow( vout_thread_t *p_vout ) 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 ); @@ -798,7 +800,7 @@ static int X11CreateWindow( vout_thread_t *p_vout ) 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; @@ -889,7 +891,7 @@ static int X11CreateWindow( vout_thread_t *p_vout ) 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 );