summaryrefslogtreecommitdiffstats
path: root/Gui/wm/ws.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-21 17:43:57 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-21 17:43:57 +0000
commiteec1ff5f27dd6933ad3d009aa7a063f6ecaef84a (patch)
treef2b8f0189778ec261635bb9add583f78b2cbc6b7 /Gui/wm/ws.c
parent86bb2b4db5d4958a3ccde42ebf8cb69d56c1c194 (diff)
downloadmpv-eec1ff5f27dd6933ad3d009aa7a063f6ecaef84a.tar.bz2
mpv-eec1ff5f27dd6933ad3d009aa7a063f6ecaef84a.tar.xz
add half dvd support for gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3055 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/wm/ws.c')
-rw-r--r--Gui/wm/ws.c67
1 files changed, 54 insertions, 13 deletions
diff --git a/Gui/wm/ws.c b/Gui/wm/ws.c
index a56c66f3f3..6446b75cea 100644
--- a/Gui/wm/ws.c
+++ b/Gui/wm/ws.c
@@ -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 @@ inline int wsSearch( Window win );
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
}
// ----------------------------------------------------------------------------------------------