changeset 33993:57d711d3dcca

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.
author ib
date Thu, 08 Sep 2011 11:11:02 +0000
parents 4dda3e85b298
children 8e5680eccf54
files gui/interface.c gui/ui/actions.c gui/ui/main.c gui/ui/menu.c gui/ui/playbar.c gui/ui/sub.c gui/wm/ws.c gui/wm/ws.h
diffstat 8 files changed, 19 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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)
--- 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:
--- 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;
--- 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;
   }
 
--- 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?
--- 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;
--- 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);