# HG changeset patch # User ib # Date 1315480262 0 # Node ID 57d711d3dccaf74076fe6f4dae21cc7f598c0d0d # Parent 4dda3e85b298e38435d1f96471474f4819e7d9f6 Change parameter b of wsMoveWindow(). Make it Bool, rename it abs and reverse its meaning. The parameter now indicates whether x and y shall be handled as real, absolute position values or as possibly mock ones. diff -r 4dda3e85b298 -r 57d711d3dcca gui/interface.c --- a/gui/interface.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/interface.c Thu Sep 08 11:11:02 2011 +0000 @@ -742,7 +742,7 @@ if (!guiApp.subWindow.isFullScreen) wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight); - wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y); + wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y); if (!guiApp.subWindow.Mapped) wsVisibleWindow(&guiApp.subWindow, wsShowWindow); @@ -752,7 +752,7 @@ uiEventHandling(evFullScreen, 0); if (guiWinID >= 0) - wsMoveWindow(&guiApp.mainWindow, False, 0, guiInfo.VideoHeight); + wsMoveWindow(&guiApp.mainWindow, True, 0, guiInfo.VideoHeight); break; @@ -797,7 +797,7 @@ if (!guiApp.subWindow.isFullScreen) { wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight); - wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y); + wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y); } if (!guiApp.subWindow.Mapped) diff -r 4dda3e85b298 -r 57d711d3dcca gui/ui/actions.c --- a/gui/ui/actions.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/ui/actions.c Thu Sep 08 11:11:02 2011 +0000 @@ -160,7 +160,7 @@ if (!guiApp.subWindow.isFullScreen && !guiInfo.Playing) { wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height); - wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y); + wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y); } if (guiApp.sub.Bitmap.Image) diff -r 4dda3e85b298 -r 57d711d3dcca gui/ui/main.c --- a/gui/ui/main.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/ui/main.c Thu Sep 08 11:11:02 2011 +0000 @@ -338,7 +338,7 @@ uiFullScreen(); } wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 ); - wsMoveWindow( &guiApp.subWindow, False, + wsMoveWindow( &guiApp.subWindow, True, ( wsMaxX - guiInfo.VideoWidth/2 )/2 + wsOrgX, ( wsMaxY - guiInfo.VideoHeight/2 )/2 + wsOrgY ); btnSet( evFullScreen,btnReleased ); @@ -352,7 +352,7 @@ uiFullScreen(); } wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 ); - wsMoveWindow( &guiApp.subWindow, False, + wsMoveWindow( &guiApp.subWindow, True, ( wsMaxX - guiInfo.VideoWidth*2 )/2 + wsOrgX, ( wsMaxY - guiInfo.VideoHeight*2 )/2 + wsOrgY ); btnSet( evFullScreen,btnReleased ); @@ -366,7 +366,7 @@ uiFullScreen(); } wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight ); - wsMoveWindow( &guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y ); + wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y ); btnSet( evFullScreen,btnReleased ); break; } else if ( !guiApp.subWindow.isFullScreen ) break; @@ -377,7 +377,7 @@ if ( !guiApp.subWindow.isFullScreen ) { wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight ); - wsMoveWindow( &guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y ); + wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y ); } } if ( guiApp.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed ); @@ -523,7 +523,7 @@ switch ( itemtype ) { case itPLMButton: - wsMoveWindow( &guiApp.mainWindow,False,RX - abs( sx ),RY - abs( sy ) ); + wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); uiMainRender=0; break; case itPRMButton: diff -r 4dda3e85b298 -r 57d711d3dcca gui/ui/menu.c --- a/gui/ui/menu.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/ui/menu.c Thu Sep 08 11:11:02 2011 +0000 @@ -107,7 +107,7 @@ menuItem = 0; - wsMoveWindow( &guiApp.menuWindow,False,x,y ); + wsMoveWindow( &guiApp.menuWindow,True,x,y ); wsRaiseWindowTop( wsDisplay,guiApp.menuWindow.WindowID ); wsSetLayer( wsDisplay,guiApp.menuWindow.WindowID,1 ); menuRender=1; diff -r 4dda3e85b298 -r 57d711d3dcca gui/ui/playbar.c --- a/gui/ui/playbar.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/ui/playbar.c Thu Sep 08 11:11:02 2011 +0000 @@ -83,7 +83,7 @@ uiPlaybarFade=0; vo_mouse_autohide=0; } - wsMoveWindow( &guiApp.playbarWindow,False,x,playbarLength ); + wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); break; case 2: // fade out playbarLength+=10; @@ -95,7 +95,7 @@ wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow ); return; } - wsMoveWindow( &guiApp.playbarWindow,False,x,playbarLength ); + wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); break; } diff -r 4dda3e85b298 -r 57d711d3dcca gui/ui/sub.c --- a/gui/ui/sub.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/ui/sub.c Thu Sep 08 11:11:02 2011 +0000 @@ -87,7 +87,7 @@ mplSubMoved=1; if ( !guiApp.subWindow.isFullScreen ) { - wsMoveWindow( &guiApp.subWindow,False,RX - sx,RY - sy ); + wsMoveWindow( &guiApp.subWindow,True,RX - sx,RY - sy ); guiApp.sub.x = guiApp.subWindow.X; guiApp.sub.y = guiApp.subWindow.Y; // NOTE TO MYSELF: dragging the title bar goes unnoticed? diff -r 4dda3e85b298 -r 57d711d3dcca gui/wm/ws.c --- a/gui/wm/ws.c Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/wm/ws.c Thu Sep 08 11:11:02 2011 +0000 @@ -1042,9 +1042,12 @@ // ---------------------------------------------------------------------------------------------- // Move window to x, y. // ---------------------------------------------------------------------------------------------- -void wsMoveWindow(wsTWindow *win, int b, int x, int y) +void wsMoveWindow(wsTWindow *win, Bool abs, int x, int y) { - if (b) { + if (abs) { + win->X = x; + win->Y = y; + } else { switch (x) { case -1: win->X = (wsMaxX / 2) - (win->Width / 2) + wsOrgX; @@ -1072,9 +1075,6 @@ win->Y = y; break; } - } else { - win->X = x; - win->Y = y; } win->SizeHint.flags = PPosition | PWinGravity; diff -r 4dda3e85b298 -r 57d711d3dcca gui/wm/ws.h --- a/gui/wm/ws.h Thu Sep 08 10:43:11 2011 +0000 +++ b/gui/wm/ws.h Thu Sep 08 11:11:02 2011 +0000 @@ -229,7 +229,7 @@ // ---------------------------------------------------------------------------------------------- void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label); void wsDestroyWindow(wsTWindow *win); -void wsMoveWindow(wsTWindow *win, int b, int x, int y); +void wsMoveWindow(wsTWindow *win, Bool abs, int x, int y); void wsResizeWindow(wsTWindow *win, int sx, int sy); void wsIconify(wsTWindow win); void wsRaiseWindowTop(Display *dsp, Window win);