summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gardiner <obz@gentoo.org>2003-10-08 09:25:14 +0000
committerMike Gardiner <obz@gentoo.org>2003-10-08 09:25:14 +0000
commit26bdd37ec5a9ad0196d665dccd85de4c527f50ce (patch)
treec246413a2db06d226c00ffd51bca01c04879ad28 /x11-libs/libwnck/files
parentnewdepend test tweak (diff)
downloadgentoo-2-26bdd37ec5a9ad0196d665dccd85de4c527f50ce.tar.gz
gentoo-2-26bdd37ec5a9ad0196d665dccd85de4c527f50ce.tar.bz2
gentoo-2-26bdd37ec5a9ad0196d665dccd85de4c527f50ce.zip
Patch for pager/desktop switcher behaviour
Diffstat (limited to 'x11-libs/libwnck/files')
-rw-r--r--x11-libs/libwnck/files/libwnck-2.4.0.1-pager.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/x11-libs/libwnck/files/libwnck-2.4.0.1-pager.patch b/x11-libs/libwnck/files/libwnck-2.4.0.1-pager.patch
new file mode 100644
index 000000000000..851fb64bc29c
--- /dev/null
+++ b/x11-libs/libwnck/files/libwnck-2.4.0.1-pager.patch
@@ -0,0 +1,60 @@
+diff -ru -X excl.list libwnck-trunk.clean/libwnck/pager.c libwnck-work/libwnck/pager.c
+--- libwnck-trunk.clean/libwnck/pager.c 2003-04-04 17:07:39.000000000 +0200
++++ libwnck-work/libwnck/pager.c 2003-09-23 23:12:52.000000000 +0200
+@@ -1149,14 +1149,53 @@
+
+ if (space)
+ {
+- wnck_workspace_activate (space);
++#define MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS 1
++#if MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS
++ int screen_width, screen_height;
++#else /* MOVE_VIEWPORT_CENTERED_ON_PONTER */
++ int screen_width, screen_height, max_x, max_y;
++#endif
++
++ /* Don't switch the desktop if we're already there */
++ if (space != wnck_screen_get_active_workspace (pager->priv->screen))
++ wnck_workspace_activate (space);
+
+ /* EWMH only lets us move the viewport for the active workspace,
+ * but we just go ahead and hackily assume that the activate
+ * just above takes effect prior to moving the viewport
+ */
+- wnck_screen_move_viewport (pager->priv->screen,
+- viewport_x, viewport_y);
++ screen_width = wnck_screen_get_width (pager->priv->screen);
++ screen_height = wnck_screen_get_height (pager->priv->screen);
++#if MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS
++ /* Transform the pointer location to viewport origin, assuming
++ * that we want the nearest "regular" viewport containing the
++ * pointer.
++ */
++ viewport_x = (viewport_x / screen_width) * screen_width;
++ viewport_y = (viewport_y / screen_height) * screen_height;
++#else /* MOVE_VIEWPORT_CENTERED_ON_PONTER */
++ /* Transform the pointer location to viewport origin, assuming
++ * that we want the pointer centered in the viewport.
++ * Keep the viewport entirely on the desktop.
++ */
++ max_x = wnck_workspace_get_width (space) - screen_width;
++ max_y = wnck_workspace_get_height (space) - screen_height;
++ viewport_x -= screen_width / 2;
++ if (viewport_x < 0)
++ viewport_x = 0;
++ else if (viewport_x > max_x)
++ viewport_x = max_x;
++ viewport_y -= screen_height / 2;
++ if (viewport_y < 0)
++ viewport_y = 0;
++ else if (viewport_y > max_y)
++ viewport_y = max_y;
++#endif
++
++ if (wnck_workspace_get_viewport_x(space) != viewport_x ||
++ wnck_workspace_get_viewport_y(space) != viewport_y)
++ wnck_screen_move_viewport (pager->priv->screen,
++ viewport_x, viewport_y);
+
+ if (pager->priv->drag_window)
+ wnck_window_activate (pager->priv->drag_window);