GNOME Bugzilla – Bug 311863
virtual desktop (think 'viewport') size not used when computing size of pager
Last modified: 2005-12-19 18:34:38 UTC
Hi, Roger Gammans reported in Debian bug http://bugs.debian.org/319740 that he experiences issues with the computing of the pager size. He proposes the following patch: --- 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; I'll suggest he subscribes to this report. Bye,
Please attach patches using the "create an attachment" feature of bugzilla, so that the patch tracking reports will pick it up...
Created attachment 53231 [details] [review] compute size of pager with virtual workspace size
I think the patch makes sense; it was fixing the fact that virtual desktop size is not equal to screen size when using viewports. One minor nitpick, though; instead of space = wnck_screen_get_workspace(pager->priv->screen,0); it should be space = wnck_screen_get_workspace (pager->priv->screen, 0); (look closely at the spacing).
I committed a slightly modifier version (to handle vertical panels).