summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-11-08 08:57:08 +0000
committerElijah Newren <newren@src.gnome.org>2005-11-08 08:57:08 +0000
commit6c13db359da586905da00be30197c1fe0f7a3c76 (patch)
treec45b4cde30d99645a5275738ae618897c9e05ba6
parente0872e3ba64fb9457328ca6540382c752664382c (diff)
downloadmetacity-6c13db359da586905da00be30197c1fe0f7a3c76.tar.gz
get basic edge resistance to work with resizing too. I'm so cool. :-)
2005-11-08 Elijah Newren <newren@gmail.com> * src/window.c (update_resize): get basic edge resistance to work with resizing too. I'm so cool. :-)
-rw-r--r--ChangeLog5
-rw-r--r--src/window.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 176432e3..64a5d20c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-11-08 Elijah Newren <newren@gmail.com>
+ * src/window.c (update_resize): get basic edge resistance to work
+ with resizing too. I'm so cool. :-)
+
+2005-11-08 Elijah Newren <newren@gmail.com>
+
Very basic edge resistance stuff starting to work. Only for
moves, debugging threshold ridiculously huge for easier testing,
snap-moving disabled, yadda yadda yadda IT ISN'T READY YET.
diff --git a/src/window.c b/src/window.c
index 730462b1..229dc1ed 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6755,6 +6755,27 @@ update_resize (MetaWindow *window,
}
else
{
+ MetaRectangle old_outer, new_outer;
+ int new_outer_width, new_outer_height;
+
+ /* Do any edge resistance/snapping */
+ meta_window_get_outer_rect (window, &old_outer);
+ new_outer_width = old_outer.width + (new_w - old.width);
+ new_outer_height = old_outer.height + (new_h - old.height);
+ meta_rectangle_resize_with_gravity (&old_outer,
+ &new_outer,
+ gravity,
+ new_outer_width,
+ new_outer_height);
+
+ if (meta_display_apply_edge_resistance (window->display,
+ &old_outer,
+ &new_outer))
+ {
+ new_w = old.width + (new_outer.width - old_outer.width);
+ new_h = old.height + (new_outer.height - old_outer.height);
+ }
+
/* We don't need to update unless the specified width and height
* are actually different from what we had before.
*/