Bug#319740: libwnck: virtual workspace size not used when computing size of pager.

Roger Gammans roger at julia.computer-surgery.co.uk
Sun Jul 24 13:30:43 UTC 2005


Package: libwnck
Severity: normal

If a window manager that supports virtual desktops (such as
enlightenment) is used with this package the size of the pager used is
wrong.

My usual configuration is a virtual desktop 4xthe wdith of my actuall
screen. And then 4 workspaces.

The gnome workspace switcher when configured to show the workspaces in
four rows , and in show content mode  is incredibally narrow as it computes
it aspect ratio based on the aspect ratio of the screen, not the virtual 
desktops.

The following patch is a simplistic attempt to fix this that seems to
work for me.

--- libwnck-2.8.1/libwnck/pager.c	2004-10-05 11:30:34.000000000 +0100
+++ libwnck-2.8.1-3/libwnck/pager.c	2005-07-24 12:19:30.000000000 +0100
@@ -267,7 +267,7 @@
   int size;
   int n_rows;
   int focus_width;
-  
+  WnckWorkspace *space;
   pager = WNCK_PAGER (widget);
   
   n_spaces = wnck_screen_get_workspace_count (pager->priv->screen);
@@ -275,9 +275,21 @@
   g_assert (pager->priv->n_rows > 0);
   spaces_per_row = (n_spaces + pager->priv->n_rows - 1) / pager->priv->n_rows;
  
+
+  space = wnck_screen_get_workspace(pager->priv->screen,0);
+  if (space) {
+	screen_aspect =
+        	(double) wnck_workspace_get_width (space) /
+	        (double) wnck_workspace_get_height (space);
+  } else {
+	  screen_aspect =
+        	(double) wnck_screen_get_width (pager->priv->screen) /
+	        (double) wnck_screen_get_height (pager->priv->screen);
+  }
+
+  
   if (pager->priv->orientation == GTK_ORIENTATION_VERTICAL)
     {
-      screen_aspect = (double) gdk_screen_height () / (double) gdk_screen_width ();
 
       /* TODO: Handle WNCK_PAGER_DISPLAY_NAME for this case */
 
@@ -300,10 +312,6 @@
     }
   else
     {
-      screen_aspect =
-        (double) wnck_screen_get_width (pager->priv->screen) /
-        (double) wnck_screen_get_height (pager->priv->screen);
-      
       if (pager->priv->show_all_workspaces)
 	{
 	  size = pager->priv->workspace_size;

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux julia 2.6.0-test9-1-386 #1 Sun Oct 26 22:32:52 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C






More information about the Pkg-gnome-maintainers mailing list