# HG changeset patch
# User Darren Salt <[EMAIL PROTECTED]>
# Date 1171646350 0
# Node ID 59aa89e26e7638348f5d8fc64c35c05ba15a90f9
# Parent  fc3da9a16f16d839f27ead7fadae3068ffb153f5
Fixed toolbar positioning with multiple monitors in a non-rectangular layout.
This may require the enabling of an option such as radeon(4)'s
MergedNonRectangular" option.

diff -r 59aa89e26e7638348f5d8fc64c35c05ba15a90f9 -r 
fc3da9a16f16d839f27ead7fadae3068ffb153f5 ChangeLog
--- a/ChangeLog Fri Feb 16 17:19:10 2007 +0000
+++ b/ChangeLog Tue Feb 13 09:34:41 2007 +0100
@@ -40,6 +40,9 @@ 0.5.900:2007/??/??
          the View menu.
        * Tweaked and re-rendered the splash and logo images.
        * Allow blanking if the video window is hidden, iconised or shaded.
+       * Fixed toolbar positioning with multiple monitors arranged to make a
+         non-rectangular display. (This may require the enabling of an option
+         such as radeon(4)'s "MergedNonRectangular" option.)
 
 0.5.11:        2007/02/01
        [dsalt]
diff -r 59aa89e26e7638348f5d8fc64c35c05ba15a90f9 -r 
fc3da9a16f16d839f27ead7fadae3068ffb153f5 src/noskin_window.c
--- a/src/noskin_window.c       Fri Feb 16 17:19:10 2007 +0000
+++ b/src/noskin_window.c       Tue Feb 13 09:34:41 2007 +0100
@@ -375,29 +375,34 @@ gboolean window_wm_toolbar_snap (void)
   gdk_window_get_frame_extents (app->window, &appframe);
   gdk_window_get_frame_extents (wm_toolbar->window, &tbframe);
 
+  GdkRectangle monitor;
+  gdk_screen_get_monitor_geometry (((GtkWindow *)app)->screen,
+                                  gdk_screen_get_monitor_at_window
+                                    (((GtkWindow *)app)->screen, app->window),
+                                  &monitor);
+
   /* centre horizontally wrt video window */
   x = appframe.x + (appframe.width - tbframe.width) / 2;
   /* ensure fully on-screen unless the video window isn't fully on-screen */
   if (appframe.width >= tbframe.width)
   {
-    if (x < 0)
-      x = MIN (0, appframe.x + appframe.width - tbframe.width);
-    else if (x + tbframe.width >
-            (y = gdk_screen_get_width (((GtkWindow *)app)->screen)))
-      x = MAX (y - tbframe.width, appframe.x);
+    if (x < monitor.x)
+      x = MIN (monitor.x, appframe.x + appframe.width - tbframe.width);
+    else if (x + tbframe.width > monitor.x + monitor.width)
+      x = MAX (monitor.x + monitor.width - tbframe.width, appframe.x);
   }
   else
   {
-    if (x < 0)
-      x = MIN (0, appframe.x);
-    else if (x + tbframe.width >
-            (y = gdk_screen_get_width (((GtkWindow *)app)->screen)))
-      x = MAX (y - tbframe.width, appframe.x + appframe.width - tbframe.width);
+    if (x < monitor.x)
+      x = MIN (monitor.x, appframe.x);
+    else if (x + tbframe.width > monitor.x + monitor.width)
+      x = MAX (monitor.x + monitor.width - tbframe.width,
+              appframe.x + appframe.width - tbframe.width);
   }
 
   /* position just below the video window, or above if insufficient space */
   y = appframe.y + appframe.height;
-  if (y + tbframe.height > gdk_screen_get_height (((GtkWindow *)app)->screen))
+  if (y + tbframe.height > monitor.y + monitor.height)
     y = appframe.y - tbframe.height;
 
   /* reposition if needed */

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to