dynamic viewports



Below is a patch to fix a couple of issues with dynamic viewports, and
provide a bit more documentation for it in man/sawfish.texi.  With
respect to documentation, if more/different docs are needed let me know,
as I don't really know what I'm doing.  ;)

The first issue is fairly minor: if infinite-desktop is used (or
something else that moves viewports by increments less than screen size)
the viewport boundaries will migrate.  For example, if I start with an
xterm at 0,0 (upper left) and then move the viewport 1/2 screen to the
left the xterm will no longer be at 0,0.  No big deal so far, the
problem is that I'm not able to restore the original screen layout by,
e.g., using move-viewport-* commands.  With this patch the
move-viewport-* commands will now snap back to the original grid of
viewport boundaries, restoring the original screen layout, just as
they do if you're not using dynamic viewports.

The second issue is more annoying, and unfortunately I haven't figured
out a way to fix it that doesn't change behavior for folks *not* using
dynamic viewports.  The problem shows up if you do this (while dynamic
viewports are enabled)

 - With no windows open, create a window on desktop 1
 - Switch to desktop 2, create a second window.
 - Back on desktop one, move several (8, say) viewports away, create a
   third window.
 - Go back to the first window, destroy it.  Then return to window #3.

At this point the viewport dimensions on both desktops will be small.
The problem is that if you switch to desktop 2 you'll suddenly be eight
viewports away from where you want to be, and if you go to the window in
desktop 2 and then switch back to desktop 1 you'll once again be eight
viewports away from where you want to be.

To fix this problem the patch below makes viewports local to a desktop.
Switching viewports works by shifting the window locations around, and
the way it currently works in trunk is that all windows are moved, even
those on other desktops.  This patch adds hooks for desktop switching to
store viewport offsets and dimensions and restore them, and doesn't move
windows not in the current desktop.

The upshot for those not using dynamic viewports is that if you're in vp
1,1 on desktop 1, switch to desktop 2 and you'll be in vp 0,0.  You can
switch viewports all you want, and when you go back to desktop 1 you'll
once again be in vp 1,1.


-- 
Jeremy Hankins <nowan nowan org>
PGP fingerprint: 748F 4D16 538E 75D6 8333  9E10 D212 B5ED 37D0 0A03


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]