summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-12 12:26:09 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-12 12:26:09 +0000
commit6c7b76a47ef4498acde750c74708ae802d959612 (patch)
treed22ed1eaaa81a7b60816d4d8beacb7e683c4e555 /Gui
parentc184876b1ab7eb0fe43e586f80559944bbb432fe (diff)
downloadmpv-6c7b76a47ef4498acde750c74708ae802d959612.tar.bz2
mpv-6c7b76a47ef4498acde750c74708ae802d959612.tar.xz
add roleld mouse support and some small bugfix. neked jol a testedbe.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2852 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/app.h2
-rw-r--r--Gui/mplayer/mw.h319
-rw-r--r--Gui/mplayer/sw.h35
-rw-r--r--Gui/wm/ws.c59
-rw-r--r--Gui/wm/ws.h6
5 files changed, 216 insertions, 205 deletions
diff --git a/Gui/app.h b/Gui/app.h
index d67e8d2bc2..16320f418b 100644
--- a/Gui/app.h
+++ b/Gui/app.h
@@ -50,7 +50,7 @@ typedef struct
{
wItem main;
wsTWindow mainWindow;
- int mainDecoration;
+ int mainDecoration;
wItem sub;
wsTWindow subWindow;
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h
index b1ed39356a..c25fe4c87b 100644
--- a/Gui/mplayer/mw.h
+++ b/Gui/mplayer/mw.h
@@ -10,7 +10,6 @@ int mplMainAutoPlay = 0;
int mainVisible = 1;
int boxMoved = 0;
-int msButton = 0;
int sx = 0,sy = 0;
int i,pot = 0;
@@ -94,24 +93,24 @@ calclengthmmmmss:
case 's': if ( mplShMem->Playing == 0 ) strcat( trbuf,"s" ); break;
case 'l': if ( mplShMem->Playing == 1 ) strcat( trbuf,"p" ); break;
case 'e': if ( mplShMem->Playing == 2 ) strcat( trbuf,"e" ); break;
- case 'a':
+ case 'a':
switch ( mplShMem->AudioType )
- {
- case 0: strcat( trbuf,"n" ); break;
- case 1: strcat( trbuf,"m" ); break;
- case 2: strcat( trbuf,"t" ); break;
- }
- break;
- case 'T':
- switch ( mplShMem->StreamType )
- {
- case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
- case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
- case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
- case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
- default: strcat( trbuf," " ); break;
- }
- break;
+ {
+ case 0: strcat( trbuf,"n" ); break;
+ case 1: strcat( trbuf,"m" ); break;
+ case 2: strcat( trbuf,"t" ); break;
+ }
+ break;
+ case 'T':
+ switch ( mplShMem->StreamType )
+ {
+ case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
+ case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
+ case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
+ case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
+ default: strcat( trbuf," " ); break;
+ }
+ break;
case '$': strcat( trbuf,"$" ); break;
default: continue;
}
@@ -162,14 +161,14 @@ void mplMainDraw( wsParamDisplay )
case 0:
btnModify( evPlaySwitchToPause,btnReleased );
btnModify( evPauseSwitchToPlay,btnDisabled );
- break;
+ break;
case 1:
if ( mplShMem->Filename[0] != 0 )
- {
+ {
btnModify( evPlaySwitchToPause,btnDisabled );
- btnModify( evPauseSwitchToPlay,btnReleased );
- }
- }
+ btnModify( evPauseSwitchToPlay,btnReleased );
+ }
+ }
// --- erosen ideiglenes.
strcpy( gtkShMem->fs.filename,mplShMem->Filename );
@@ -188,11 +187,11 @@ void mplMainDraw( wsParamDisplay )
break;
case itPotmeter:
PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
- break;
+ break;
case itHPotmeter:
PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed );
- break;
+ break;
case itSLabel:
image=fntRender( item->fontid,0,item->width,"%s",item->label );
goto drawrenderedtext;
@@ -230,14 +229,14 @@ void mplMsgHandle( int msg,float param )
case evExit:
// IZE("evExit");
wsDoExit(); // sets wsTrue=False;
- exit_player( "Exit" );
+ exit_player( "Exit" );
break;
case evIconify:
- switch ( (int)param )
- {
- case 0: wsIconify( appMPlayer.mainWindow ); break;
- case 1: wsIconify( appMPlayer.subWindow ); break;
- }
+ switch ( (int)param )
+ {
+ case 0: wsIconify( appMPlayer.mainWindow ); break;
+ case 1: wsIconify( appMPlayer.subWindow ); break;
+ }
break;
case evFullScreen:
IZE("evFullS");
@@ -340,32 +339,32 @@ NoPause:
case evIncVolume: vo_x11_putkey( wsGrayMul ); break;
case evDecVolume: vo_x11_putkey( wsGrayDiv ); break;
case evMute: mplShMem->Mute=1; break;
- case evSetVolume:
+ case evSetVolume:
case evSetBalance: mplShMem->VolumeChanged=1; break;
case evNormalSize:
- if ( mplShMem->Playing )
- {
- appMPlayer.subWindow.isFullScreen=True;
- appMPlayer.subWindow.OldX=( wsMaxX - moviewidth ) / 2;
- appMPlayer.subWindow.OldY=( wsMaxY - movieheight ) / 2;
- appMPlayer.subWindow.OldWidth=moviewidth; appMPlayer.subWindow.OldHeight=movieheight;
- wsFullScreen( &appMPlayer.subWindow );
- mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
- }
- break;
- case evDoubleSize:
- if ( mplShMem->Playing )
- {
- appMPlayer.subWindow.isFullScreen=True;
- appMPlayer.subWindow.OldX=( wsMaxX - moviewidth * 2 ) / 2;
- appMPlayer.subWindow.OldY=( wsMaxY - movieheight * 2 ) / 2;
- appMPlayer.subWindow.OldWidth=moviewidth * 2; appMPlayer.subWindow.OldHeight=movieheight * 2;
- wsFullScreen( &appMPlayer.subWindow );
- mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
- }
- break;
+ if ( mplShMem->Playing )
+ {
+ appMPlayer.subWindow.isFullScreen=True;
+ appMPlayer.subWindow.OldX=( wsMaxX - moviewidth ) / 2;
+ appMPlayer.subWindow.OldY=( wsMaxY - movieheight ) / 2;
+ appMPlayer.subWindow.OldWidth=moviewidth; appMPlayer.subWindow.OldHeight=movieheight;
+ wsFullScreen( &appMPlayer.subWindow );
+ mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
+ }
+ break;
+ case evDoubleSize:
+ if ( mplShMem->Playing )
+ {
+ appMPlayer.subWindow.isFullScreen=True;
+ appMPlayer.subWindow.OldX=( wsMaxX - moviewidth * 2 ) / 2;
+ appMPlayer.subWindow.OldY=( wsMaxY - movieheight * 2 ) / 2;
+ appMPlayer.subWindow.OldWidth=moviewidth * 2; appMPlayer.subWindow.OldHeight=movieheight * 2;
+ wsFullScreen( &appMPlayer.subWindow );
+ mplResize( appMPlayer.subWindow.X,appMPlayer.subWindow.Y,moviewidth,movieheight );
+ }
+ break;
// --- timer events
case evHideMouseCursor:
@@ -374,10 +373,10 @@ NoPause:
case evRedraw:
mplMainRender=1;
wsPostRedisplay( &appMPlayer.mainWindow );
-// if ( !mplShMem->Playing )
-// wsPostRedisplay( &appMPlayer.subWindow );
+// if ( !mplShMem->Playing )
+// wsPostRedisplay( &appMPlayer.subWindow );
XFlush( wsDisplay );
- mplRedrawTimer=mplRedrawTimerConst;
+ mplRedrawTimer=mplRedrawTimerConst;
break;
case evGeneralTimer:
if ( mplMainAutoPlay )
@@ -397,96 +396,115 @@ NoPause:
}
}
+#define itPLMButton (itNULL - 1)
+#define itPRMButton (itNULL - 2)
+
void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
{
static int itemtype = 0;
- static int SelectedButton = -1;
+ int i;
wItem * item = NULL;
float value = 0.0f;
+
+ static int SelectedItem = -1;
+ int currentselected = -1;
+
wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
+
+ for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
+ if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
+ ( wgIsRect( X,Y,appMPlayer.Items[i].x,appMPlayer.Items[i].y,appMPlayer.Items[i].x+appMPlayer.Items[i].width,appMPlayer.Items[i].y+appMPlayer.Items[i].height ) ) )
+ { currentselected=i; break; }
+
switch ( Button )
{
case wsPRMouseButton:
mplShowMenu( RX,RY );
- msButton=wsPRMouseButton;
+ itemtype=itPRMButton;
break;
case wsRRMouseButton:
mplHideMenu( RX,RY );
- msButton=0;
break;
+
case wsPLMouseButton:
- sx=X; sy=Y;
- boxMoved=1;
- msButton=wsPLMouseButton;
- for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
+ sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton; // if move the main window
+ SelectedItem=currentselected;
+ if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window
+ boxMoved=0; mplMainRender=1; // No, not move the window, i'm pressed one button
+ item=&appMPlayer.Items[SelectedItem];
+ itemtype=item->type;
+ item->pressed=btnPressed;
+ item->used=1;
+ switch( item->type )
+ {
+ case itButton:
+ if ( ( SelectedItem > -1 ) &&
+ ( ( ( appMPlayer.Items[SelectedItem].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
+ ( ( appMPlayer.Items[SelectedItem].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
+ { appMPlayer.Items[SelectedItem].pressed=btnDisabled; }
+ break;
+ }
+ break;
+ case wsRLMouseButton:
+ boxMoved=0;
+ item=&appMPlayer.Items[SelectedItem];
+ item->pressed=btnReleased;
+ SelectedItem=-1;
+ if ( currentselected == - 1 ) { itemtype=0; break; }
+ value=0;
+ switch( itemtype )
+ {
+ case itPotmeter:
+ case itHPotmeter:
+ item->used=0;
+ btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
+ switch ( item->msg )
+ {
+ case evSetVolume:
+ mplShMem->VolumeChanged=1;
+ mplShMem->Volume=item->value;
+ break;
+ }
+ value=item->value;
+ break;
+ }
+ mplMsgHandle( item->msg,value );
+ mplMainRender=1;
+ itemtype=0;
+ break;
+
+// --- rolled mouse ... de szar :)))
+ case wsP5MouseButton: value=-2.5f; goto rollerhandled;
+ case wsP4MouseButton: value= 2.5f;
+rollerhandled:
+ item=&appMPlayer.Items[currentselected];
+ if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
{
- item=&appMPlayer.Items[i];
- if ( item->pressed != btnDisabled )
+ item->used=0;
+ item->value+=value;
+ btnModify( item->msg,item->value );
+ switch ( item->msg )
{
- switch( item->type )
- {
- case itButton:
- if ( wgIsRect( X,Y,
- item->x,item->y,
- item->x+item->width,item->y+item->height ) )
- {
- item->pressed=btnPressed;
- mplMainRender=1;
- SelectedButton=i;
- msButton=0;
- boxMoved=0;
- }
- if ( ( SelectedButton > -1 ) &&
- ( ( ( appMPlayer.Items[SelectedButton].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
- ( ( appMPlayer.Items[SelectedButton].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
- {
- appMPlayer.Items[SelectedButton].pressed=btnDisabled;
- SelectedButton=i;
- appMPlayer.Items[SelectedButton].pressed=btnPressed;
- }
- itemtype=itButton;
- break;
- case itPotmeter:
- if ( wgIsRect( X,Y,
- item->x,item->y,
- item->x+item->width,item->y+item->height ) )
- {
- item->pressed=btnPressed;
- item->used=1;
- mplMainRender=1;
- SelectedButton=i;
- boxMoved=0;
- msButton=itPotmeter;
- itemtype=itPotmeter;
- }
- break;
- case itHPotmeter:
- if ( wgIsRect( X,Y,
- item->x,item->y,
- item->x+item->width,item->y+item->height ) )
- {
- item->pressed=btnPressed;
- item->used=1;
- mplMainRender=1;
- SelectedButton=i;
- boxMoved=0;
- msButton=itHPotmeter;
- itemtype=itHPotmeter;
- }
- break;
- }
+ case evSetVolume:
+ mplShMem->VolumeChanged=1;
+ mplShMem->Volume=item->value;
+ break;
}
+ mplMsgHandle( item->msg,item->value );
+ mplMainRender=1;
}
break;
+
+// --- moving
case wsMoveMouse:
- item=&appMPlayer.Items[SelectedButton];
- switch ( msButton )
+ item=&appMPlayer.Items[SelectedItem];
+ switch ( itemtype )
{
- case wsPLMouseButton:
+ case itPLMButton:
wsMoveWindow( &appMPlayer.mainWindow,RX - abs( sx ),RY - abs( sy ) );
mplMainRender=0;
break;
- case wsPRMouseButton:
+ case itPRMButton:
mplMenuMouseHandle( X,Y,RX,RY );
break;
case itPotmeter:
@@ -495,49 +513,20 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
case itHPotmeter:
item->value=(float)( X - item->x ) / item->width * 100.0f;
potihandled:
- if ( item->value > 100.0f ) item->value=100.0f;
- if ( item->value < 0.0f ) item->value=0.0f;
- if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) )
- {
- mplShMem->VolumeChanged=1;
- mplShMem->Volume=item->value;
- }
- mplMsgHandle( item->msg,item->value );
+ if ( item->value > 100.0f ) item->value=100.0f;
+ if ( item->value < 0.0f ) item->value=0.0f;
+ switch ( item->msg )
+ {
+ case evSetVolume:
+ mplShMem->VolumeChanged=1;
+ mplShMem->Volume=item->value;
+ break;
+ }
+ mplMsgHandle( item->msg,item->value );
mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
break;
}
break;
- case wsRLMouseButton:
- msButton=0;
- boxMoved=0;
- item=&appMPlayer.Items[SelectedButton];
- item->pressed=btnReleased;
- switch( itemtype )
- {
- case itButton:
- if ( wgIsRect( X,Y,
- item->x,item->y,
- item->x+item->width,item->y+item->height ) ) value=0;
- break;
- case itPotmeter:
- case itHPotmeter:
- item->used=0;
- btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
- if ( ( item->msg == evSetVolume )||( item->msg == evSetBalance ) )
- {
- mplShMem->VolumeChanged=1;
- mplShMem->Volume=item->value;
- }
- value=item->value;
- break;
- }
- if ( SelectedButton != -1 ) mplMsgHandle( item->msg,value );
- SelectedButton=-1;
- mplMainRender=1;
- itemtype=0;
- break;
- case wsPMMouseButton: break;
- case wsRMMouseButton: break;
}
if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow );
}
@@ -556,14 +545,6 @@ void mplMainKeyHandle( int State,int Type,int Key )
case wsEscape: msg=evExit; break;
-// case wsUp: msg=evForward1min; break;
-// case wsDown: msg=evBackward1min; break;
-// case wsRight: msg=evForward10sec; break;
-// case wsLeft: msg=evBackward10sec; break;
-
-// case wsGrayMul: msg=evIncVolume; break;
-// case wsGrayDiv: msg=evDecVolume; break;
-
case wsEnter: msg=evPlay; break;
case wsSpace: msg=evPause; break;
case wsa:
@@ -582,7 +563,7 @@ void mplMainKeyHandle( int State,int Type,int Key )
case wsS: msg=evStop; break;
case wsp:
case wsP: msg=evPlayList; break;
- default: vo_x11_putkey( Key ); return;
+ default: vo_x11_putkey( Key ); return;
}
if ( ( msg != evNone )&&( Type == wsKeyPressed ) )
{
diff --git a/Gui/mplayer/sw.h b/Gui/mplayer/sw.h
index 8f0ca754da..f9a2d122f4 100644
--- a/Gui/mplayer/sw.h
+++ b/Gui/mplayer/sw.h
@@ -7,13 +7,13 @@ int SubVisible = 0;
void mplSubDraw( wsParamDisplay )
{
if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
-
+
if ( !appMPlayer.subWindow.Mapped ||
appMPlayer.subWindow.Visible == wsWindowNotVisible ) return;
if ( mplShMem->Playing )
- {
- vo_expose=1;
+ {
+ vo_expose=1;
mplSubRender=0;
}
@@ -22,12 +22,13 @@ void mplSubDraw( wsParamDisplay )
if ( appMPlayer.sub.Bitmap.Image ) wsPutImage( &appMPlayer.subWindow );
// XFlush( wsDisplay );
}
- appMPlayer.subWindow.State=0;
+ appMPlayer.subWindow.State=0;
}
void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
{
static int mplSubMoved = 0;
+ static int msButton = 0;
mplMouseTimer=mplMouseTimerConst;
wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
@@ -42,7 +43,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
mplHideMenu( RX,RY );
msButton=0;
break;
-// ---
+// ---
case wsPLMouseButton:
sx=X; sy=Y;
msButton=wsPLMouseButton;
@@ -64,18 +65,18 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
case wsRLMouseButton:
// if ( ( !mplSubMoved )&&( ( SubVisible++%2 ) ) ) wsMoveTopWindow( &appMPlayer.mainWindow );
if ( !mplSubMoved )
- {
- if( SubVisible++%2 )
- {
- wsMoveTopWindow( &appMPlayer.mainWindow );
- fprintf( stderr,"[sw] MAIN TOP\n" );
- }
- else
- {
- wsMoveTopWindow( &appMPlayer.subWindow );
- fprintf( stderr,"[sw] SUB TOP\n" );
- }
- }
+ {
+ if( SubVisible++%2 )
+ {
+ wsMoveTopWindow( &appMPlayer.mainWindow );
+ fprintf( stderr,"[sw] MAIN TOP\n" );
+ }
+ else
+ {
+ wsMoveTopWindow( &appMPlayer.subWindow );
+ fprintf( stderr,"[sw] SUB TOP\n" );
+ }
+ }
msButton=0;
mplSubMoved=0;
break;
diff --git a/Gui/wm/ws.c b/Gui/wm/ws.c
index 5c9d529eae..790f9d57f3 100644
--- a/Gui/wm/ws.c
+++ b/Gui/wm/ws.c
@@ -107,6 +107,7 @@ inline int wsSearch( Window win );
void wsWindowDecoration( wsTWindow * win,long d )
{
+//XUnmapWindow( wsDisplay,win->WindowID );
wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
if ( wsMotifHints != None )
{
@@ -117,6 +118,17 @@ void wsWindowDecoration( wsTWindow * win,long d )
XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
}
+//XMapWindow( wsDisplay,win->WindowID );
+// if ( d )
+// {
+// win->SizeHint.win_gravity=ForgetGravity;
+// }
+// else
+// {
+// win->SizeHint.win_gravity=StaticGravity;
+// }
+// win->SizeHint.flags=PWinGravity;
+// XSetWMSizeHints( wsDisplay,win->WindowID,&win->SizeHint,win->AtomWMSizeHint );
}
// ----------------------------------------------------------------------------------------------
@@ -350,6 +362,8 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
win->AtomDeleteWindow=XInternAtom( wsDisplay,"WM_DELETE_WINDOW",False );
win->AtomTakeFocus=XInternAtom( wsDisplay,"WM_TAKE_FOCUS",False );
win->AtomRolle=XInternAtom( wsDisplay,"WM_WINDOW_ROLE",False );
+ win->AtomWMSizeHint=XInternAtom( wsDisplay,"WM_SIZE_HINT",False );
+ win->AtomWMNormalHint=XInternAtom( wsDisplay,"WM_NORMAL_HINT",False );
win->AtomProtocols=XInternAtom( wsDisplay,"WM_PROTOCOLS",False );
{
char buf[32]; int i;
@@ -406,7 +420,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
wsClassHint.res_class="MPlayer";
XSetClassHint( wsDisplay,win->WindowID,&wsClassHint );
- win->SizeHint.flags=PPosition | PSize | PResizeInc; // | PBaseSize
+ win->SizeHint.flags=PPosition | PSize | PResizeInc | PWinGravity; // | PBaseSize
win->SizeHint.x=win->X;
win->SizeHint.y=win->Y;
win->SizeHint.width=win->Width;
@@ -427,6 +441,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
win->SizeHint.width_inc=1;
// win->SizeHint.base_width=win->Width;
// win->SizeHint.base_height=win->Height;
+ win->SizeHint.win_gravity=StaticGravity;
XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
win->WMHints.flags=InputHint | StateHint;
@@ -574,14 +589,14 @@ Bool wsEvents( Display * display,XEvent * Event,XPointer arg )
case UnmapNotify: i=wsWindowUnmapped; wsWindowList[l]->Mapped=wsNone; goto expose;
case FocusIn:
if ( wsWindowList[l]->Focused == wsFocused ) break;
- i=wsWindowFocusIn;
- wsWindowList[l]->Focused=wsFocused;
- goto expose;
+ i=wsWindowFocusIn;
+ wsWindowList[l]->Focused=wsFocused;
+ goto expose;
case FocusOut:
if ( wsWindowList[l]->Focused == wsNone ) break;
- i=wsWindowFocusOut;
- wsWindowList[l]->Focused=wsNone;
- goto expose;
+ i=wsWindowFocusOut;
+ wsWindowList[l]->Focused=wsNone;
+ goto expose;
case VisibilityNotify:
switch( Event->xvisibility.state )
{
@@ -648,11 +663,17 @@ buttonreleased:
wsWindowList[l]->MouseHandler( i,Event->xbutton.x,Event->xbutton.y,Event->xmotion.x_root,Event->xmotion.y_root );
break;
+ case GravityNotify:
+// #ifdef DEBUG
+ fprintf( stderr,"[ws] window ( 0x%x ) gravity: %d,%d\n",wsWindowList[l]->WindowID,Event->xgravity.x,Event->xgravity.y );
+// #endif
+ break;
+
case PropertyNotify:
-// break;
-// #ifdef DEBUG
+// break;
+// #ifdef DEBUG
// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",wsWindowList[l]->WindowID,XGetAtomName( wsDisplay,Event->xproperty.atom ),Event->xproperty.atom );
-// #endif
+// #endif
if ( Event->xproperty.atom == wsWindowList[l]->AtomRemote )
{
Atom type;
@@ -672,9 +693,9 @@ buttonreleased:
{
args[strlen( args ) - 1]=0;
wsWindowList[l]->RemoteHandler( args );
- #ifdef DEBUG
- fprintf( stderr,"[ws] args: '%s'\n",args );
- #endif
+ #ifdef DEBUG
+ fprintf( stderr,"[ws] args: '%s'\n",args );
+ #endif
args[strlen( args ) - 1]=1;
XFree( args );
}
@@ -850,9 +871,10 @@ void wsMoveWindow( wsTWindow * win,int x, int y )
default: win->Y=y; break;
}
- win->SizeHint.flags=PPosition;
+ win->SizeHint.flags=PPosition | PWinGravity;
win->SizeHint.x=win->X;
win->SizeHint.y=win->Y;
+ win->SizeHint.win_gravity=StaticGravity;
XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
XMoveWindow( wsDisplay,win->WindowID,win->X,win->Y );
@@ -867,7 +889,7 @@ void wsResizeWindow( wsTWindow * win,int sx, int sy )
win->Width=sx;
win->Height=sy;
- win->SizeHint.flags=PSize;
+ win->SizeHint.flags=PSize | PWinGravity;
win->SizeHint.width=win->Width;
win->SizeHint.height=win->Height;
if ( win->Property & wsMinSize )
@@ -882,6 +904,7 @@ void wsResizeWindow( wsTWindow * win,int sx, int sy )
win->SizeHint.max_width=win->Width;
win->SizeHint.max_height=win->Height;
}
+ win->SizeHint.win_gravity=StaticGravity;
XSetWMNormalHints( wsDisplay,win->WindowID,&win->SizeHint );
XResizeWindow( wsDisplay,win->WindowID,sx,sy );
if ( win->ReSize ) win->ReSize( win->X,win->Y,win->Width,win->Height );
@@ -897,9 +920,9 @@ void wsIconify( wsTWindow win )
// Move top the window.
// ----------------------------------------------------------------------------------------------
void wsMoveTopWindow( wsTWindow * win )
-{
-// XUnmapWindow( wsDisplay,win->WindowID ); XMapWindow( wsDisplay,win->WindowID );
- XRaiseWindow( wsDisplay,win->WindowID );
+{
+// XUnmapWindow( wsDisplay,win->WindowID ); XMapWindow( wsDisplay,win->WindowID );
+ XRaiseWindow( wsDisplay,win->WindowID );
}
// ----------------------------------------------------------------------------------------------
diff --git a/Gui/wm/ws.h b/Gui/wm/ws.h
index 15526a4090..0838a8b2ff 100644
--- a/Gui/wm/ws.h
+++ b/Gui/wm/ws.h
@@ -25,9 +25,13 @@
#define wsPLMouseButton 1
#define wsPMMouseButton 2
#define wsPRMouseButton 3
+#define wsP4MouseButton 4
+#define wsP5MouseButton 5
#define wsRLMouseButton 1 + 128
#define wsRMMouseButton 2 + 128
#define wsRRMouseButton 3 + 128
+#define wsR4MouseButton 4 + 128
+#define wsR5MouseButton 5 + 128
#define wsEnterWindow 253
#define wsLeaveWindow 254
#define wsMoveMouse 255
@@ -131,6 +135,8 @@ typedef struct
Atom AtomsProtocols[3];
Atom AtomLeaderClient;
Atom AtomRemote;
+ Atom AtomWMSizeHint;
+ Atom AtomWMNormalHint;
XShmSegmentInfo Shminfo;
unsigned char * ImageData;