Index: gui/ui/main.c
===================================================================
--- gui/ui/main.c	(revision 36780)
+++ gui/ui/main.c	(working copy)
@@ -98,6 +98,9 @@
  static int     SelectedItem = -1;
         int     currentselected = -1;
 
+ static double  last_pot_angle;
+ static int     pot_stop;
+
  for ( i=0;i <= guiApp.IndexOfMainItems;i++ )
   if ( ( guiApp.mainItems[i].pressed != btnDisabled )&&
        ( isInside( X,Y,guiApp.mainItems[i].x,guiApp.mainItems[i].y,guiApp.mainItems[i].x+guiApp.mainItems[i].width,guiApp.mainItems[i].y+guiApp.mainItems[i].height ) ) )
@@ -133,6 +136,17 @@
                   { item->pressed=btnDisabled; }
                  break;
            }*/
+          switch( itemtype )
+           {
+            case itPotmeter:
+                 {
+                   double dx = X - item->x - item->width / 2;
+                   double dy = Y - item->y - item->height / 2;
+                   last_pot_angle = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+                   pot_stop = 0;
+                 }
+                 break;
+           }
           break;
    case wsRLMouseButton:
           boxMoved=False;
@@ -147,6 +161,22 @@
           switch( itemtype )
            {
             case itPotmeter:
+                 if (pot_stop) { itemtype=0; return; }
+                 {
+                   double dx = X - item->x - item->width / 2;
+                   double dy = Y - item->y - item->height / 2;
+                   double a;
+                   if ( dx == 0 && dy == 0 ) { itemtype=0; return; }
+                   // CW angle, 0..1, 0 at center/bottom
+                   a = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+                   // gap around 0 on the circle for unambiguous boundaries and to ease hitting them
+                   a = FFMAX( a,  1/60.0 );
+                   a = FFMIN( a, 59/60.0 );
+                   btnModify( item->message, ((a - 1/60.0) / (58/60.0)) * 100.0 );
+                 }
+                 uiEvent( item->message,item->value );
+                 value=item->value;
+                 break;
             case itHPotmeter:
                  btnModify( item->message,(float)( X - item->x ) / item->width * 100.0 );
 		 uiEvent( item->message,item->value );
@@ -194,7 +224,24 @@
                  if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
                  break;
             case itPotmeter:
-                 item->value=(float)( X - item->x ) / item->width * 100.0;
+                 {
+                   double dx = X - item->x - item->width / 2;
+                   double dy = Y - item->y - item->height / 2;
+                   double a;
+                   if ( dx == 0 && dy == 0 ) break;
+                   // CW angle, 0..1, 0 at center/bottom
+                   a = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+                   // stop rotating when crossing 0 until crossing in opposite direction
+                   if (last_pot_angle < 0.25 && a > 0.75) pot_stop = pot_stop == 1 ? 0 : -1;
+                   if (last_pot_angle > 0.75 && a < 0.25) pot_stop = pot_stop == -1 ? 0 : 1;
+                   last_pot_angle = a;
+                   if (pot_stop < 0) a = 0.0;
+                   if (pot_stop > 0) a = 1.0;
+                   // gap around 0 on the circle according to 'wsRLMouseButton'
+                   a = FFMAX( a,  1/60.0 );
+                   a = FFMIN( a, 59/60.0 );
+                   item->value = ((a - 1/60.0) / (58/60.0)) * 100.0;
+                 }
                  goto potihandled;
             case itVPotmeter:
                  item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0;


Index: gui/ui/playbar.c
===================================================================
--- gui/ui/playbar.c	(revision 36780)
+++ gui/ui/playbar.c	(working copy)
@@ -126,6 +126,9 @@
  static int     SelectedItem = -1;
 	int     currentselected = -1;
 
+ static double  last_pot_angle;
+ static int     pot_stop;
+
  for ( i=0;i <= guiApp.IndexOfPlaybarItems;i++ )
    if ( ( guiApp.playbarItems[i].pressed != btnDisabled )&&
       ( isInside( X,Y,guiApp.playbarItems[i].x,guiApp.playbarItems[i].y,guiApp.playbarItems[i].x+guiApp.playbarItems[i].width,guiApp.playbarItems[i].y+guiApp.playbarItems[i].height ) ) )
@@ -161,6 +164,17 @@
 		 { item->pressed=btnDisabled; }
 	       break;
 	 }
+	switch( itemtype )
+	 {
+	  case itPotmeter:
+	       {
+	         double dx = X - item->x - item->width / 2;
+	         double dy = Y - item->y - item->height / 2;
+	         last_pot_angle = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+	         pot_stop = 0;
+	       }
+	       break;
+	 }
 
 	break;
    case wsRLMouseButton:
@@ -176,6 +190,22 @@
 	switch( itemtype )
 	 {
 	  case itPotmeter:
+	       if (pot_stop) { itemtype=0; return; }
+	       {
+	         double dx = X - item->x - item->width / 2;
+	         double dy = Y - item->y - item->height / 2;
+	         double a;
+	         if ( dx == 0 && dy == 0 ) { itemtype=0; return; }
+	         // CW angle, 0..1, 0 at center/bottom
+	         a = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+	         // gap around 0 on the circle for unambiguous boundaries and to ease hitting them
+	         a = FFMAX( a,  1/60.0 );
+	         a = FFMIN( a, 59/60.0 );
+	         btnModify( item->message, ((a - 1/60.0) / (58/60.0)) * 100.0 );
+	       }
+	       uiEvent( item->message,item->value );
+	       value=item->value;
+	       break;
 	  case itHPotmeter:
 	       btnModify( item->message,(float)( X - item->x ) / item->width * 100.0 );
 	       uiEvent( item->message,item->value );
@@ -215,7 +245,24 @@
 	       if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
 	       break;
 	  case itPotmeter:
-	       item->value=(float)( X - item->x ) / item->width * 100.0;
+	       {
+	         double dx = X - item->x - item->width / 2;
+	         double dy = Y - item->y - item->height / 2;
+	         double a;
+	         if ( dx == 0 && dy == 0 ) break;
+	         // CW angle, 0..1, 0 at center/bottom
+	         a = (atan2(dx, -dy) + M_PI) / (2*M_PI);
+	         // stop rotating when crossing 0 until crossing in opposite direction
+	         if (last_pot_angle < 0.25 && a > 0.75) pot_stop = pot_stop == 1 ? 0 : -1;
+	         if (last_pot_angle > 0.75 && a < 0.25) pot_stop = pot_stop == -1 ? 0 : 1;
+	         last_pot_angle = a;
+	         if (pot_stop < 0) a = 0.0;
+	         if (pot_stop > 0) a = 1.0;
+	         // gap around 0 on the circle according to 'wsRLMouseButton'
+	         a = FFMAX( a,  1/60.0 );
+	         a = FFMIN( a, 59/60.0 );
+	         item->value = ((a - 1/60.0) / (58/60.0)) * 100.0;
+	       }
 	       goto potihandled;
 	  case itVPotmeter:
 	       item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0;
