[Mplayer-cvslog] CVS: main/Gui/wm ws.c,1.26,1.27
Zoltan Ponekker
pontscho at mplayer.dev.hu
Wed Nov 21 18:43:59 CET 2001
- Previous message: [Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.34,1.35 play.h,1.13,1.14 psignal.c,1.19,1.20 sw.h,1.21,1.22 widgets.h,1.9,1.10
- Next message: [Mplayer-cvslog] CVS: main/Gui/mplayer/gtk fs.c,1.3,1.4 menu.c,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/mplayer/main/Gui/wm
In directory mplayer:/var/tmp.root/cvs-serv26669/Gui/wm
Modified Files:
ws.c
Log Message:
add half dvd support for gui
Index: ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ws.c 18 Nov 2001 19:24:50 -0000 1.26
+++ ws.c 21 Nov 2001 17:43:57 -0000 1.27
@@ -36,11 +36,11 @@
typedef struct
{
- long flags;
- long functions;
- long decorations;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
long input_mode;
- long status;
+ unsigned long status;
} MotifWmHints;
Atom wsMotifHints;
@@ -107,16 +107,57 @@
void wsWindowDecoration( wsTWindow * win,long d )
{
+ MotifWmHints *hints = &wsMotifWmHints;
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long bytes_after;
+
wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
- if ( wsMotifHints != None )
- {
- memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
- wsMotifWmHints.flags=( d?0:MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS );
- wsMotifWmHints.functions=( d?0:MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
- wsMotifWmHints.decorations=( d?MWM_DECOR_ALL:0 );
- XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
- PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
- }
+ if ( wsMotifHints == None ) return;
+
+#if 1
+ memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
+ wsMotifWmHints.flags=( d?0:MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS );
+ wsMotifWmHints.functions=( d?0:MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+ wsMotifWmHints.decorations=( d?MWM_DECOR_ALL:0 );
+ XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
+ PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
+#else
+ XGetWindowProperty( wsDisplay,win->WindowID,
+ wsMotifHints,0,5,
+ False,AnyPropertyType,&type,&format,&nitems,
+ &bytes_after,(unsigned char **)&hints );
+
+ if ( type != None )
+ {
+ fprintf( stderr,"[ws] set valid mwm hints.\n" );
+ hints->flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
+ if ( d )
+ {
+ hints->functions|=( MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+ hints->decorations|=MWM_DECOR_ALL;
+ }
+ else
+ {
+ hints->functions|=~( MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+ hints->decorations|=~MWM_DECOR_ALL;
+ }
+ }
+ else
+ {
+ fprintf( stderr,"[ws] set my mwm hints.\n" );
+ memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
+ hints=&wsMotifWmHints;
+ hints->flags=( d?MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS:0 );
+ hints->functions=( d?MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE:0 );
+ hints->decorations=( d?MWM_DECOR_ALL:0 );
+ }
+
+ XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
+ PropModeReplace,&wsMotifWmHints,5 );
+ if ( hints != &wsMotifWmHints ) XFree( hints );
+#endif
}
// ----------------------------------------------------------------------------------------------
- Previous message: [Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.34,1.35 play.h,1.13,1.14 psignal.c,1.19,1.20 sw.h,1.21,1.22 widgets.h,1.9,1.10
- Next message: [Mplayer-cvslog] CVS: main/Gui/mplayer/gtk fs.c,1.3,1.4 menu.c,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list