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 82337 - Viewport navigation bug
Viewport navigation bug
Status: RESOLVED FIXED
Product: Sawfish
Classification: Deprecated
Component: Window Manager
pre-1.3.x
Other other
: High major
: 1.5.x
Assigned To: John Harper
sawfish QA Team
Depends on: 89373
Blocks:
 
 
Reported: 2002-05-20 11:24 UTC by Christian Fredrik Kalager Schaller
Modified: 2009-08-16 15:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A simple way to get 2D-navigation with sawfish workspaces (870 bytes, text/plain)
2002-06-24 00:12 UTC, Peter Toneby
  Details
Re-vamped grid-based workspace switching functions (3.81 KB, text/plain)
2002-07-02 04:26 UTC, Michael Toomim
  Details
A version that supports send-window-to-workspace-<down,up,left,right> (5.90 KB, patch)
2002-07-02 06:30 UTC, Michael Toomim
none Details | Review
This version reads pager values dynamically (6.63 KB, text/plain)
2002-07-03 06:02 UTC, Michael Toomim
  Details
Final version, ready for inclusion (8.24 KB, text/plain)
2002-07-31 07:53 UTC, Michael Toomim
  Details
modified final version (8.81 KB, text/plain)
2002-08-03 19:36 UTC, John Harper
  Details

Description Christian Fredrik Kalager Schaller 2002-05-20 11:24:59 UTC
Adding this bug to get it tracked in bugzilla. Not sure what it is about
actually :)

On Sat, 2002-05-18 at 03:19, Havoc Pennington wrote:
> 
> Luis Villa <louie@ximian.com> writes: 
> > And I see that we never did file the directionality issue for viewport
> > navigation, at least not that I've marked to 2.0.0. If someone files
> > that, please add the keyword. Thanks.
> 
> I already fixed it except that I'm having to pull teeth to get it in
> the WM spec, and it needs implementing in Sawfish.
> 
> Havoc
Comment 1 Luis Villa 2002-05-20 12:54:28 UTC
John: to clarify this bug a little, in case you haven't been reading
the lists: the biggest remaining issue with the dropping of viewports
(as far as list feedback goes) appears to be the lack of ability to
navigate  workspaces in a 2D fashion- i.e., to specify up/down
movement as well as right/left. We're really hoping you can add this
before the 2.0.0 release :) Thanks...
Comment 2 John Harper 2002-05-20 16:59:16 UTC
Related to bug 75613.

I don't have time for adding sawfish features at the moment.

It should be easy enough to write a new lisp module that adds four new
commands to switch workspace using logical directions.
Comment 3 Wayne Schuller 2002-06-03 01:48:16 UTC
Obviously this is not going to happen for 2.0.0. It will require lots
of testing, especially to make sure deskguide/libwnck is happy with it.

Looking at bug 75613 I see HP is trying to get discussions going to
get this done properly as a wm standard.

Luis: can we punt this to 2.0.x?

It is a great feature for 'expert' users (I personally love it), but
not a core feature.

Comment 4 Havoc Pennington 2002-06-03 01:59:14 UTC
The proposed standard is currently implemented by libwnck, also.

If you know lisp and how to write a sawfish module, then this should
be a matter of maybe 1 hour of hacking, and be pretty safe in terms of
not introducing new bugs.
Comment 5 Luis Villa 2002-06-03 15:32:03 UTC
Well, it is 2.0.0 because it was 'promised' to desktop-devel during
the mega-thread on this subject. For all intents and purposes it is
punted anyway since John won't fix it and no one else can/will. We
definitely won't be holding up the release for it, so in that sense it
really isn't 2.0.0 anyway.
Comment 6 Luis Villa 2002-06-06 21:53:34 UTC
Punting, officially. 
Comment 7 Rui Miguel Seabra 2002-06-10 10:37:14 UTC
It should be noted that unless you can specify a direction (vertical
or horizontal) where you do not want to flip edges, it will be very
hard to reach panels that lie on the edge of the screen.

Because of their usefull different behaviours, I made a 6x1x2 area
(masking as if it was a 6x2 desktop) so I could have panels on top and
bottom, and use change viewport when the mouse reached the horizontal
edges, but not vertically (which would create a hell reaching the panels).

If the general idea is of not having two different ideas but trying to
merge them, then you need to handle such differences.

A 2D layout is nice and commonly used, but it doesn't harm to be able
to chose which direction will flip edges in a given set of workspaces,
so you can have usability on the panels.
Comment 8 Peter Toneby 2002-06-24 00:12:02 UTC
Created attachment 9416 [details]
A simple way to get 2D-navigation with sawfish workspaces
Comment 9 Peter Toneby 2002-06-24 00:15:54 UTC
Sigh, stupid bugzilla...
Anyhow, the .jl-file above is not very much tested, and for some
reason the docstrings doesn't show up in sawfish-ui. But it works for
me (tm).

But I do prefer viewports... they are much nicer...
Comment 10 Luis Villa 2002-06-26 04:00:25 UTC
well a patch. dang. Cool :)  [Adding keyword, not just spam :) 
Comment 11 John Harper 2002-06-30 20:18:07 UTC
The patch is kind of simplistic (e.g. moves past end of row onto start
of next row), and doesn't hook up to the wm-spec geometry (is there
such a thing? I haven't been paying attention)

it's not a million miles from what is needed though
Comment 12 Michael Toomim 2002-07-01 21:05:56 UTC
To be complete, there should also probably be equivalent
move-window-to-workspace-<up,down,left,right> functions.
Comment 13 Luis Villa 2002-07-01 21:43:31 UTC
Peter: adding you to the cc: list so that you see John's last comments.
Comment 14 Michael Toomim 2002-07-02 04:26:08 UTC
Created attachment 9572 [details]
Re-vamped grid-based workspace switching functions
Comment 15 Michael Toomim 2002-07-02 04:38:09 UTC
I took peter's file and:

- Made it work for workspace switcher applets on vertical (as well as
horizontal) panels 
- Kept the workspace from wrapping from the right side to the left
- Refactored; beginnings of a "workspace-grid" abstraction

It now has two customize variables (number of workspace switcher rows,
workspace-switcher orientation) that need to be replaced with that
wm-spec thing you guys are talking about.

(newbie question: What does triaged mean?)
Comment 16 Luis Villa 2002-07-02 04:58:49 UTC
triaged, in the current GNOME case, basically means 'luis has looked
at it and made sure all possible fields are set as well as possible.' 
Comment 17 Michael Toomim 2002-07-02 06:30:37 UTC
Created attachment 9578 [details] [review]
A version that supports send-window-to-workspace-<down,up,left,right>
Comment 18 Michael Toomim 2002-07-03 06:02:50 UTC
Created attachment 9601 [details]
This version reads pager values dynamically
Comment 19 Michael Toomim 2002-07-03 06:15:16 UTC
I started reading values from (get-x-property 'root
'_NET_DESKTOP_LAYOUT), instead of using customize variables.  This
takes care of the last of John's complaints.

However, the value that I get from that expression to be inconsistent
with spec described in Havoc's proposed patch (from the wm-spec list).

The x property A) doesn't reflect the horizontal/vertical orientation
of my workspace-switcher, but rather always reports "horizontal"

and B) has the x and y values switched.

For instance, if I have a pager on a horizontal panel like:

  1 2 3

I get the array [0 1 0] instead of [0 0 1]...

And if I have the vertical panel:

  1
  2
  3

it returns the array [0 1 0], which I think should be [1 0 1].  My
interpretation of the wm-spec is that this tuple is [orientation width
height].  Am I reading the right correctly?  Is the spec implemented?

I'm using the gnome2 release packages from debian experimental.
Comment 20 Michael Toomim 2002-07-03 20:56:55 UTC
Sorry, I meant [1 1 0] where I said [1 0 1].

Wow, there were a lot of typos in that post.
Comment 21 Havoc Pennington 2002-07-25 04:58:06 UTC
Hmm, here is the metacity code, which (I think) works, or it appears
to work for me anyhow:

 if (meta_prop_get_cardinal_list (screen->display,
                                   screen->xroot,
                                  
screen->display->atom_net_desktop_layout,
                                   &list, &n_items))
    {
      if (n_items == 3)
        {
          int cols, rows;
          
          switch (list[0])
            {
            case _NET_WM_ORIENTATION_HORZ:
              screen->vertical_workspaces = FALSE;
              break;
            case _NET_WM_ORIENTATION_VERT:
              screen->vertical_workspaces = TRUE;
              break;
            default:
              meta_warning ("Someone set a weird orientation in
_NET_DESKTOP_LAYOUT\n");
              break;
            }

          rows = list[1];
          cols = list[2];

Maybe the pager is broken? Let's look at the libwnck code...

void
_wnck_set_desktop_layout (Screen *xscreen,
                          int     rows,
                          int     columns)
{
  gulong data[3];

  data[0] = _NET_WM_ORIENTATION_HORZ;
  data[1] = rows;
  data[2] = columns;
  
  _wnck_error_trap_push ();

  XChangeProperty (gdk_display,
                   RootWindowOfScreen (xscreen),
		   _wnck_atom_get ("_NET_DESKTOP_LAYOUT"),
		   XA_CARDINAL, 32, PropModeReplace,
		   (guchar *)&data, 3);

  _wnck_error_trap_pop ();
}

That looks kind of suspicious, it always sets horizontal. And then 
if you look at pager.c it has a variable named n_rows always passed 
to this function first, that can be either rows or columns depending 
on orientation.

So, short answer, looks like libwnck is hosed.
Comment 22 Luis Villa 2002-07-26 01:30:42 UTC
So should I be reassigning to libwnck then, havoc?
Comment 23 Havoc Pennington 2002-07-26 02:12:37 UTC
no I think this would be a new bug against libwnck, this bug was for
the sawfish bit.
Comment 24 Michael Toomim 2002-07-29 19:54:03 UTC
I created a new bug for the libwnck problem (bug 89373) and made this
one depend on it.
Comment 25 Michael Toomim 2002-07-31 07:53:37 UTC
Created attachment 10141 [details]
Final version, ready for inclusion
Comment 26 Michael Toomim 2002-07-31 07:57:03 UTC
I just attached another version of the patch.  I think it's finished.

John, can this be merged into sawfish?
Comment 27 Peter Toneby 2002-08-01 11:47:35 UTC
I'm still missing interactivly moving windows up/down/left/right, they
just move to the next/previous workspace. But I have no idea if it's
possible doing this in rep only...
Comment 28 Michael Toomim 2002-08-01 16:39:56 UTC
Are you talking about edge-flipping?  If so, you want bug 75613.
Comment 29 John Harper 2002-08-03 19:34:55 UTC
Michael: thanks, that patch looks excellent. I made a few cosmetic
changes (replaced defun by define and define-command, removed uses of
defsubst, changed the swap macro) and will attach the result

Perhaps you could look it over and test it? Then I'll commit it.
Comment 30 John Harper 2002-08-03 19:36:32 UTC
Created attachment 10241 [details]
modified final version
Comment 31 Michael Toomim 2002-08-05 04:08:06 UTC
I am on vacation until the 12th or 13th, and won't be able to check 
it out until then.  If gnome is going to have a release before then, 
could you (or somebody else) test it instead?  The changes you 
describe sound fine.  I haven't quite figured out what accent of 
scheme/emacs lisp one is supposed to use yet. :)
Comment 32 Michael Toomim 2002-08-13 05:06:01 UTC
John: Tested out your modifications.  They look good, and work fine.

One issue: you renamed the "view-workspace-<direction>" commands to
"workspace-<direction>", but didn't modify the export clause:

    (export view-workspace-up
	    view-workspace-down
	    view-workspace-right
	    view-workspace-left

Should the "view-" be removed from these?

Strangely, I find that the "workspace-<direction>" commands are
available to the user from the sawfish configurator despite this
typo... shouldn't they be hidden behind the define-structure?

Also, now that bug 89373 has been fixed, this section can be removed:

	      ;; Swap layout again because of libwnck bug
	      (swap cols rows)

... as well as all other comments mentioning gnome2 workarounds.
Comment 33 John Harper 2002-08-13 05:37:43 UTC
doh, well spotted. I'll fix the export clause.

Yes, it's normal that the commands still work, the export controls
whether the functions are exported, but the calls to define-command
"publish" command names pointing to the internal functions

I removed that one "swap" line. I'll commit it later, then look at the
edge-flipping changes. Thanks again.
Comment 34 Luis Villa 2002-08-15 02:01:08 UTC
w00t. :) Obviously, this won't be fixed in time for 2.0.1, so I'm
removing that keyword, but if we could get a release whenever it is
fixed, that would be cool. :) 
Comment 35 Michael Toomim 2002-08-17 03:56:43 UTC
John, we gotta re-insert the "swap" line temporarily.  The patch for
bug 89373 wasn't a complete fix.

I doubt it will take too long for someone to fix it completely,
though, and let us remove the swap again... so you might want to leave
that operation in a mental write-back buffer for a little bit...
Comment 36 John Harper 2002-08-18 21:15:17 UTC
OK, I added that line back and committed the new file