[maemo-commits] [maemo-commits] r8679 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Dec 8 14:53:56 EET 2006
Author: moimart
Date: 2006-12-08 14:53:55 +0200 (Fri, 08 Dec 2006)
New Revision: 8679

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/desktop-panel-window.c
Log:

	* libhildondesktop/desktop-panel-window.[ch]: Fixed partially dragging
	of window.
	* ChangeLog updated.



Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-12-08 12:24:23 UTC (rev 8678)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-12-08 12:53:55 UTC (rev 8679)
@@ -1,3 +1,8 @@
+2006-12-08  Moises Martinez  <moises.martinzes at nokia.com>
+
+	* libhildondesktop/desktop-panel-window.[ch]: Fixed partially dragging
+	of window.
+
 2006-12-07  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* libhildondesktop/hildon-desktop-panel.h,

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/desktop-panel-window.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/desktop-panel-window.c	2006-12-08 12:24:23 UTC (rev 8678)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/libhildondesktop/desktop-panel-window.c	2006-12-08 12:53:55 UTC (rev 8679)
@@ -490,24 +490,26 @@
 desktop_panel_win_set_orientation (DesktopPanelWindow *window,
 				   DPanelWinOrientation orientation)
 {
-  gboolean rotate = FALSE;
+  gboolean rotate = FALSE, change_position = FALSE;
 
-  if (orientation & DPANEL_ORIENTATION_HORIZONTAL &&
-      window->priv->orientation & DPANEL_ORIENTATION_VERTICAL)
+  if ((orientation & DPANEL_ORIENTATION_HORIZONTAL) && IS_VERTICAL (window))
   {
     rotate = TRUE;  
   }
-  else if (orientation & DPANEL_ORIENTATION_VERTICAL &&
-           window->priv->orientation & DPANEL_ORIENTATION_HORIZONTAL)
+  else if ((orientation & DPANEL_ORIENTATION_VERTICAL) && IS_HORIZONTAL (window))
   {
     rotate = TRUE;
-  }
+  } 
 
-  window->priv->orientation = orientation;
+  if (orientation != window->priv->orientation)
+    change_position = TRUE;
 
-  if (HILDON_DESKTOP_WINDOW (window)->container)
+  if (change_position)  
+    window->priv->orientation = orientation;
+
+  if (HILDON_DESKTOP_WINDOW (window)->container && rotate)
   {
-    if (window->priv->orientation & DPANEL_ORIENTATION_HORIZONTAL)
+    if IS_HORIZONTAL (window)
       g_object_set (G_OBJECT (HILDON_DESKTOP_WINDOW (window)->container),
 		    "orientation",
 		    GTK_ORIENTATION_HORIZONTAL,
@@ -520,7 +522,7 @@
   
   }
 
-  if (rotate)
+  if (change_position)
     gtk_widget_queue_resize (GTK_WIDGET (window));
 }
 
@@ -559,7 +561,7 @@
 
   CHECK_MULTISCREEN_HANDLER (window->priv->ms);
 
-  if (window->priv->orientation & DPANEL_ORIENTATION_HORIZONTAL)
+  if IS_HORIZONTAL (window)
     vborder = hborder = (3 * window->priv->geometry.height) >> 1;
   else
     vborder = hborder = (3 * window->priv->geometry.width)  >> 1;
@@ -568,7 +570,7 @@
   new_y = py - desktop_ms_get_y (window->priv->ms, screen, monitor);
   monitor_width  = desktop_ms_get_width (window->priv->ms, screen, monitor);
   monitor_height = desktop_ms_get_height (window->priv->ms, screen, monitor);
-
+  
   switch (window->priv->orientation)
   {
     case DPANEL_ORIENTATION_TOP:


More information about the maemo-commits mailing list