]> git.sesse.net Git - vlc/blobdiff - plugins/x11/vout_x11.c
* Ported Glide and MGA plugins to the new module API. MGA never worked,
[vlc] / plugins / x11 / vout_x11.c
index 0ea7552137496d4da76c9292906ce5c4b7659e17..0aa7b225302279d1152fade01060652ced9c4685 100644 (file)
@@ -2,7 +2,7 @@
  * vout_x11.c: X11 video output display method
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout_x11.c,v 1.13 2001/02/16 06:37:09 sam Exp $
+ * $Id: vout_x11.c,v 1.15 2001/02/20 07:49:13 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -22,6 +22,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define MODULE_NAME x11
+#include "modules_inner.h"
+
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
@@ -114,8 +117,7 @@ static int  vout_Manage    ( struct vout_thread_s * );
 static void vout_Display   ( struct vout_thread_s * );
 static void vout_SetPalette( struct vout_thread_s *, u16*, u16*, u16*, u16* );
 
-static int  X11CreateWindow             ( vout_thread_t *p_vout );
-
+static int  X11CreateWindow     ( vout_thread_t *p_vout );
 static int  X11InitDisplay      ( vout_thread_t *p_vout, char *psz_display );
 
 static int  X11CreateImage      ( vout_thread_t *p_vout, XImage **pp_ximage );
@@ -125,7 +127,6 @@ static int  X11CreateShmImage   ( vout_thread_t *p_vout, XImage **pp_ximage,
 static void X11DestroyShmImage  ( vout_thread_t *p_vout, XImage *p_ximage,
                                   XShmSegmentInfo *p_shm_info );
 
-/* local prototypes */
 static void X11TogglePointer            ( vout_thread_t *p_vout );
 static void X11EnableScreenSaver        ( vout_thread_t *p_vout );
 static void X11DisableScreenSaver       ( vout_thread_t *p_vout );
@@ -134,7 +135,7 @@ static void X11DisableScreenSaver       ( vout_thread_t *p_vout );
  * Functions exported as capabilities. They are declared as static so that
  * we don't pollute the namespace too much.
  *****************************************************************************/
-void vout_getfunctions( function_list_t * p_function_list )
+void _M( vout_getfunctions )( function_list_t * p_function_list )
 {
     p_function_list->pf_probe = vout_Probe;
     p_function_list->functions.vout.pf_create     = vout_Create;
@@ -354,7 +355,8 @@ static int vout_Manage( vout_thread_t *p_vout )
     b_resized = 0;
     while( XCheckWindowEvent( p_vout->p_sys->p_display, p_vout->p_sys->window,
                               StructureNotifyMask | KeyPressMask |
-                              ButtonPressMask, &xevent ) == True )
+                              ButtonPressMask | ButtonReleaseMask, &xevent )
+           == True )
     {
         /* ConfigureNotify event: prepare  */
         if( (xevent.type == ConfigureNotify)
@@ -412,7 +414,13 @@ static int vout_Manage( vout_thread_t *p_vout )
                 case Button2:
                     X11TogglePointer( p_vout );
                     break;
-
+            }
+        }
+        /* Mouse release */
+        else if( xevent.type == ButtonRelease )
+        {
+            switch( ((XButtonEvent *)&xevent)->button )
+            {
                 case Button3:
                     /* FIXME: need locking ! */
                     p_main->p_intf->b_menu_change = 1;
@@ -678,7 +686,8 @@ static int X11CreateWindow( vout_thread_t *p_vout )
     } while( !( b_expose && b_configure_notify && b_map_notify ) );
 
     XSelectInput( p_vout->p_sys->p_display, p_vout->p_sys->window,
-                  StructureNotifyMask | KeyPressMask | ButtonPressMask );
+                  StructureNotifyMask | KeyPressMask |
+                  ButtonPressMask | ButtonReleaseMask );
 
     if( XDefaultDepth(p_vout->p_sys->p_display, p_vout->p_sys->i_screen) == 8 )
     {