diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-10 23:05:44 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-03-10 23:05:44 +0000 |
commit | 59623831cf7e3aaeffe987f1f70c1e01469e4301 (patch) | |
tree | 4e0b831aa202a44d015f200fc015773884ace1fb | |
parent | fe1e1f22411b017988f94bdb32d96852d1206f43 (diff) |
rewrite MWM hint handling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5032 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | Gui/wm/ws.c | 53 |
1 files changed, 6 insertions, 47 deletions
diff --git a/Gui/wm/ws.c b/Gui/wm/ws.c index 4adcb8efbc..9ed89661b9 100644 --- a/Gui/wm/ws.c +++ b/Gui/wm/ws.c @@ -103,59 +103,18 @@ inline int wsSearch( Window win ); void wsWindowDecoration( wsTWindow * win,long d ) { -#if 0 - MotifWmHints *hints = &wsMotifWmHints; - Atom type; - int format; - unsigned long nitems; - unsigned long bytes_after; -#endif - wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 ); 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 ); + wsMotifWmHints.flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; + if ( d ) + { + wsMotifWmHints.functions=MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE; + wsMotifWmHints.decorations=MWM_DECOR_ALL; + } 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 } // ---------------------------------------------------------------------------------------------- |