summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-01 20:59:07 +0000
committeratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-01 20:59:07 +0000
commit9de08fa0eb89bdf7fdb768a38ae68a6f8c44faa7 (patch)
tree466d08553992320f66c7fc76b5341122cf50d61c /libvo
parent36a536128fd4048f8935c8c70ca914674010c6a5 (diff)
downloadmpv-9de08fa0eb89bdf7fdb768a38ae68a6f8c44faa7.tar.bz2
mpv-9de08fa0eb89bdf7fdb768a38ae68a6f8c44faa7.tar.xz
ALSA syc is not so good as OSS - small corrections
added Motif hints memorizing before switching to full screen because WM can modify decorations of the app window git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12097 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 20f7c16115..6647ef8ae3 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -608,19 +608,15 @@ extern int vo_screenheight;
static MotifWmHints vo_MotifWmHints;
static Atom vo_MotifHints = None;
-// Note: always d==0 !
void vo_x11_decoration( Display * vo_Display,Window w,int d )
{
-
+ static unsigned int olddecor = MWM_DECOR_ALL;
+ static unsigned int oldfuncs = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
+ Atom mtype;
+ int mformat;
+ unsigned long mn,mb;
if ( !WinID ) return;
- if(vo_fsmode&1){
- XSetWindowAttributes attr;
- attr.override_redirect = (!d) ? True : False;
- XChangeWindowAttributes(vo_Display, w, CWOverrideRedirect, &attr);
-// XMapWindow(vo_Display, w);
- }
-
if(vo_fsmode&8){
XSetTransientForHint (vo_Display, w, RootWindow(vo_Display,mScreen));
}
@@ -628,12 +624,26 @@ void vo_x11_decoration( Display * vo_Display,Window w,int d )
vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
if ( vo_MotifHints != None )
{
+ if (!d) {
+ MotifWmHints *mhints=NULL;
+ XGetWindowProperty(vo_Display,w, vo_MotifHints, 0, 20, False,
+ vo_MotifHints, &mtype, &mformat, &mn,
+ &mb, (unsigned char **)&mhints) ;
+ if (mhints){
+ if (mhints->flags & MWM_HINTS_DECORATIONS)
+ olddecor = mhints->decorations;
+ if (mhints->flags & MWM_HINTS_FUNCTIONS)
+ oldfuncs = mhints->functions;
+ XFree (mhints);
+ }
+ }
+
memset( &vo_MotifWmHints,0,sizeof( MotifWmHints ) );
vo_MotifWmHints.flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
if ( d )
{
- vo_MotifWmHints.functions=MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
- d=MWM_DECOR_ALL;
+ vo_MotifWmHints.functions= oldfuncs;
+ d=olddecor;
}
#if 0
vo_MotifWmHints.decorations=d|((vo_fsmode&2)?0:MWM_DECOR_MENU);