After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 152661 - Switching to window in direction
Switching to window in direction
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Thomas Thurman
Metacity maintainers list
Depends on:
Blocks: 155456
 
 
Reported: 2004-09-14 19:38 UTC by Johan Svedberg
Modified: 2010-01-20 15:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Perl script to move in a direction from the current window (3.77 KB, text/plain)
2009-01-30 01:02 UTC, Thomas Thurman
Details
Version of perl script honoring current desktop (4.07 KB, text/plain)
2009-01-30 17:24 UTC, Daniel Gryniewicz
Details

Description Johan Svedberg 2004-09-14 19:38:22 UTC
One thing I miss in Metacity which I had in FVWM is the ability to switch to a
window in <direction>, where <direction> is (up|down|left|right). This is
already possible for workspaces in Metacity, so wouldn't it be logical to
support it for windows aswell?
Comment 1 Elijah Newren 2004-09-14 19:59:11 UTC
Yeah, we could user Super-Hyper-Ctrl-Alt-Arrow for the keybinding!  ;-)
Comment 2 Calum Benson 2009-01-28 12:57:54 UTC
There are so many other ways to access a window that's already on the same workspace, though.  What are the use cases for which the requested feature would be more efficient to use than the existing methods?
Comment 3 Patryk Zawadzki 2009-01-28 14:05:25 UTC
If such an option could really be useful then perhaps it would be really useful to be able to use arrows once inside alt+tab interface and mark this one as wontfix?
Comment 4 Daniel Gryniewicz 2009-01-28 16:36:55 UTC
This is actually immensely useful, and the one reason I can't use metacity on my main development box.  They way it works is this:

I have a number of xterms of various sizes tiled across a number of desktops. By default in Gnome (and metacity), I can switch between desktops linearly, and between windows on desktop linearly.  This means that if I want to get to desktop 8 and I'm on desktop 4 (I use 9 desktops...), I have to move through 4 or 5  desktops (4->5->6->7->8 or 4->3->2->1->9->8).  Simiarly, if I have 6 terms on a desktop (not uncommon...) I have to move through them linearly.

However, I can lay out my desktops in 2D.  This means that to get from 4 to 8 above, it's 2 moves (right and down).  Similarly, if I have 6 terms, I can move from any one to any other in only 2 moves (3 if I can't wrap).

Much more importantly than number of keystrokes, however, is the difference in mentality that this allows.  With a 2D desktop and directional window switching, I can lay out my desktops in 2D, lay my windows out tiled (ie, non-overlapping) in 2D on each desktop, and the result is that I can use pure spacial memory for finding everything open on a huge virtual desktop.  I can easily have 20 or 30 windows open total (again, not uncommon for me) on a single monitor, and find them all quickly and easily.  That cannot be done (at least by me) in metacity, because I cannot use spacial memory to find things.

Please consider adding this feature, or at least making it possible for devilspie to add such a feature.  This would allow me to run metacity again, rather than fvwm or awesome, on my development machines.
Comment 5 Thomas Thurman 2009-01-30 01:02:29 UTC
Created attachment 127506 [details]
Perl script to move in a direction from the current window

But it already is possible for devilspie to have such a feature.  In fact, anyone can write a script to do it-- here's one I just threw together.  Install X11::Protocol ("sudo cpan X11::Protocol"), put this script in your path as "metacity-direction", open gconf-editor, and set four appropriate keybindings to "metacity-direction e", "metacity-direction s", "metacity-direction w", and "metacity-direction n".
Comment 6 Thomas Thurman 2009-01-30 01:18:33 UTC
I think that makes this FIXED.
Comment 7 Daniel Gryniewicz 2009-01-30 17:24:59 UTC
Created attachment 127558 [details]
Version of perl script honoring current desktop

That's almost exactly what I want, thanks.  The only problem is that it selects windows not on the current workspace, moving them to the current workspace.

This version only selects from windows on the current workspace.  As far as I'm concerned, this is now fixed.
Comment 8 naziirr 2010-01-17 15:36:48 UTC
I tried both versions of the fix script, and they both fail in the exact same way:

$ ./metacity-direction.pl w
Desktop: 0
Protocol error: bad 5 (Atom); Sequence Number 16
 Opcode (17, 0) = GetAtomName
 Bad resource 0 (0x0)
 at ./metacity-direction.pl line 44

(Daniel's script fails on line 44 while Thomas's fails on line 43)

(FWIW, I run Ubuntu 9.10)

I desperately need this feature. I have several xterms open, and it's really tough to navigate between them. thanks!
Comment 9 naziirr 2010-01-19 12:15:26 UTC
guys, any idea about the script bug ?

or do you have any idea how can I achieve this differently with MetaCity ?

I'd hate to move to another window manager just because of such a simple feature need... 

thank you
Comment 10 naziirr 2010-01-20 14:59:53 UTC
ok, i'm happy to say i got it working now.
probably something in my configuration is just non standard.
anyway, it's a great great script,
i have it now bounded with 4 movements keys,
and i'm very happy.

thank you all for the great support.
Comment 11 Thomas Thurman 2010-01-20 15:32:13 UTC
Sorry I didn't get to this in time!  I'm glad it's working for you now.

(If you ever do move to another window manager, the script should work there as well.)