diff options
author | Elijah Newren <newren@gmail.com> | 2005-11-02 03:16:46 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2005-11-02 03:16:46 +0000 |
commit | b0b2e261e9ff65461e8333696ac0ab46d6d5ea01 (patch) | |
tree | d1316a01a12ab6731c83c9c9c735c5345ad0ce2f | |
parent | 460ff4bd50f1dfd3a9fb948601bde4c083b43ed5 (diff) | |
download | metacity-b0b2e261e9ff65461e8333696ac0ab46d6d5ea01.tar.gz |
Add more ideas mostly relating to edge resistance just to ensure I don't
2005-11-01 Elijah Newren <newren@gmail.com>
* constraints-ideas.txt: Add more ideas mostly relating to edge
resistance just to ensure I don't forget them, make sure I don't
forget the important edge resistance and documentation things to
cover
* src/boxes.c (edges_overlap, rectangle_and_edge_intersection):
some basic code simplifications and a couple more comments
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | constraints-ideas.txt | 35 | ||||
-rw-r--r-- | src/boxes.c | 41 |
3 files changed, 62 insertions, 24 deletions
@@ -1,3 +1,13 @@ +2005-11-01 Elijah Newren <newren@gmail.com> + + * constraints-ideas.txt: Add more ideas mostly relating to edge + resistance just to ensure I don't forget them, make sure I don't + forget the important edge resistance and documentation things to + cover + + * src/boxes.c (edges_overlap, rectangle_and_edge_intersection): + some basic code simplifications and a couple more comments + 2005-10-31 Elijah Newren <newren@gmail.com> Add routines to find all the "screen edges" (where struts are diff --git a/constraints-ideas.txt b/constraints-ideas.txt index 72e62f34..a9adc83f 100644 --- a/constraints-ideas.txt +++ b/constraints-ideas.txt @@ -64,6 +64,39 @@ Short-term (I hope...) TODO list/reminders: timeout-resistance be much larger for the screen edges, (e) it may be difficult determining where the screen edges are + - Various extra random ideas + - Could make edge resistance infinite if move/resize was + click-on-titlebar-area activated (or perhaps just if the + grab_anchor_root_(x|y) is in the titlebar area?) + - Could get rid of the big comment at the beginning of + meta_rectangle_get_minimal_spanning_set_for_region() + - checking for obscured edges could make use of boxes.c:split_edge() + - when timeout fires, edge-resistance for _any_ edge should be disabled + until the mouse moves at least <threshold> pixels (from + last_motion_(x|y) or edge resisted x,y?) + X check if test_find_onscreen_edges() passes when struts are disjoint + X change edges_overlap() to not depend on type (allow undefined type; + just check thicknesses) + + - Important edge resistance points + - Both moving and resizing + - Real edges, not workarea + - Screen vs. xinerama vs. window edges + - 0-distance magnetism + resistance + - pixel-distance, timeouts (mouse only), build-up (keyboard only) + - ignore unseen edges + - cache edges + - put all this functionality into on common location + + - Important documentation points + - All fields of ConstraintsInfo struct + - Inner vs Outer window + - meta_window_move_resize_internal() and other changes + - priority structure + - basic function addition + - spanning rects + - boxes.[ch] & testboxes.c + - Need to clean out lots of FIXMEs in the code. - Need to do the titlebar offscreen checking, partial maximization, etc. @@ -255,7 +288,7 @@ Bugs to fix: 122670 - jerky/random resizing of windows via keyboard (drop extra events -- not really needed) 81704 - edge magnetism/resistance/snapping/etc. - 151842 - maximize to fill feature... + 151842 - maximize to fill feature (gripe: patch doesn't do maximal grow) 302456 - dragging offscreen too restrictive 308521 - better alt-middle-drag resizing diff --git a/src/boxes.c b/src/boxes.c index 31d8f5a1..e313cafa 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -1191,23 +1191,20 @@ static gboolean edges_overlap (const MetaEdge *edge1, const MetaEdge *edge2) { - switch (edge1->side_type) + if (edge1->rect.width == 0 && edge2->rect.width == 0) { - case META_DIRECTION_LEFT: - case META_DIRECTION_RIGHT: - return (edge2->side_type == META_DIRECTION_LEFT || - edge2->side_type == META_DIRECTION_RIGHT) && - meta_rectangle_vert_overlap (&edge1->rect, &edge2->rect) && + return meta_rectangle_vert_overlap (&edge1->rect, &edge2->rect) && edge1->rect.x == edge2->rect.x; - case META_DIRECTION_TOP: - case META_DIRECTION_BOTTOM: - return (edge2->side_type == META_DIRECTION_TOP || - edge2->side_type == META_DIRECTION_BOTTOM) && - meta_rectangle_horiz_overlap (&edge1->rect, &edge2->rect) && + } + else if (edge1->rect.height == 0 && edge2->rect.height == 0) + { + return meta_rectangle_horiz_overlap (&edge1->rect, &edge2->rect) && edge1->rect.y == edge2->rect.y; } - - g_assert (0 == 1); + else + { + return FALSE; + } } static gboolean @@ -1220,23 +1217,21 @@ rectangle_and_edge_intersection (const MetaRectangle *rect, MetaRectangle *result = &overlap->rect; gboolean intersect = TRUE; - overlap->edge_type = edge->edge_type; - overlap->side_type = edge->side_type; - + /* We don't know how to set these, so set them to invalid values */ + overlap->edge_type = -1; + overlap->side_type = -1; + + /* Figure out what the intersection is */ result->x = MAX (rect->x, rect2->x); result->y = MAX (rect->y, rect2->y); result->width = MIN (BOX_RIGHT (*rect), BOX_RIGHT (*rect2)) - result->x; result->height = MIN (BOX_BOTTOM (*rect), BOX_BOTTOM (*rect2)) - result->y; - /* Find out if we didn't get any intersections; have to do it this way since + /* Find out if the intersection is empty; have to do it this way since * edges have a thickness of 0 */ - if (((edge->side_type == META_DIRECTION_TOP || - edge->side_type == META_DIRECTION_BOTTOM) && - (result->width <= 0 || result->height < 0)) || - ((edge->side_type == META_DIRECTION_LEFT || - edge->side_type == META_DIRECTION_RIGHT) && - (result->width < 0 || result->height <= 0))) + if ((result->width < 0 || result->height < 0) || + (result->width == 0 && result->height == 0)) { result->width = 0; result->height = 0; |