ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] Working on "resize", problem one...


From: Mike Meyer
Subject: [RP] Working on "resize", problem one...
Date: Fri Nov 16 08:12:01 2001

First, there's a problem - buglet? - in the previous patch. The patch
for the patch is attached at the end. Basically, if you try and split
a frame into a part bigger than the original frame, it now reverts to
the old behavior instead of being very, very strange.

The plan on doing "resize" was to use the new split to shrink the
appropriate window(s), then remove the new ones.(*) I had one
particular configuration problem in mind, ans with the new split I can
now test it. The following short script creates that case, and sure
enough, it leaves a hole when you try it. The script should work on
the cvs version of rp, without the frames/etc. patch but with the
split patch.

#!/bin/sh
# thirds should be two-thirds of your monitors width.
thirds=1066
ratpoison -c "split -3" -c "vsplit $thirds" -c focusdown -c "vsplit -3" -c 
focusup -c focusright -c split -c focusdown -c vsplit -c focusright -c remove 
-c focusright -c focusdown -c remove

This should create something like so:

+--------+-------------------+
|        |                   |
|        |                   |
|        |                   |
|        +----------+--------|
|        |          |        |
|        |  The     |        |
|        |  hole    |        |
|        |          |        |
+--------+----------+        |
|                   |        |
|                   |        |
|                   |        |
+----------------------------+

Where the last remove happens in the hole, leaveing the other four
rectangles as 

Methinks me needs to think longs and hard about this. It's not clear
that this situation can't be created in stock rp, it would just be a
lot harder.

        <mike

*) I know, remove would have to be tweaked to provide a mechanism to
prevent returning to the original state.

--
Mike Meyer <address@hidden>                     http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?              A: Tell them your plans.

--- split.c.orig        Fri Nov 16 09:59:03 2001
+++ split.c     Fri Nov 16 09:57:46 2001
@@ -247,6 +247,7 @@
   if (way)
     {
       if (part < 0) part = -frame->height / part;
+      if (part > frame->height) part = frame->height / 2;
 
       new_frame->x = frame->x;
       new_frame->y = frame->y + frame->height - part;
@@ -258,6 +259,7 @@
   else
     {
       if (part < 0) part = -frame->width / part;
+      if (part > frame->width) part = frame->width / 2;
 
       new_frame->x = frame->x + frame->width - part;
       new_frame->y = frame->y;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]