Aug. 12th, 2009

elfs: (Default)

For reasons I won’t go into, I’ve had to re-activate my “professional” login on my laptop.  In order to distinguish it from the Elf user, which uses Enlightenment, I use Gnome when at the office.  And one thing I absolutely loathe about Metacity, the Gnome window manager, is that when you’re flipping between workspaces, you cannot roll from the last workspace to the first, or vice versa.  You must flip all the way back.

This patch, to the file workspace.c, changes that:

--- workspace.c~        2005-07-13 10:06:21.000000000 -0700
+++ workspace.c 2006-01-06 21:11:36.000000000 -0800
@@ -758,13 +758,13 @@
     }

   if (layout.current_col < 0)
-    layout.current_col = 0;
-  if (layout.current_col >= layout.cols)
     layout.current_col = layout.cols - 1;
+  if (layout.current_col >= layout.cols)
+    layout.current_col = 0;
   if (layout.current_row < 0)
-    layout.current_row = 0;
-  if (layout.current_row >= layout.rows)
     layout.current_row = layout.rows - 1;
+  if (layout.current_row >= layout.rows)
+    layout.current_row = 0;

   i = layout.grid[layout.current_row * layout.cols + layout.current_col];

Why this isn’t implemented by default is beyond me. This patch has worked it Metacity 2.x since the beginning, and works great with Metacity 2.24.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com

Profile

elfs: (Default)
Elf Sternberg

February 2026

S M T W T F S
1234567
891011121314
151617181920 21
22232425262728

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 1st, 2026 06:01 pm
Powered by Dreamwidth Studios