summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Lindqvist <bjornl@src.gnome.org>2006-03-29 16:05:23 +0000
committerBjörn Lindqvist <bjornl@src.gnome.org>2006-03-29 16:05:23 +0000
commit28aeacb247d065a50923a28e2fc3abd1ef718f8b (patch)
treecfd7fde0ac6512c9b56538e5ad651d9b3a9d020a
parentd75c170fef883320f85a603e3bf3cbe41a76d2dc (diff)
downloadmetacity-28aeacb247d065a50923a28e2fc3abd1ef718f8b.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog9
-rw-r--r--src/resizepopup.c30
-rw-r--r--src/resizepopup.h6
-rw-r--r--src/window.c18
4 files changed, 27 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 16bf7f4d..beac33f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-29 Björn Lindqvist <bjourne@gmail.com>
+
+ * src/resizepopup.c:
+ * src/resizepopup.h:
+ * src/window.c (meta_window_refresh_resize_popup):
+ Aggregate the x, y, width and height attributes of MetaResizePopup
+ to one MetaRectangle rect attribute and update code using the
+ MetaResizePopup struct. Fixes #335177.
+
2006-03-28 Elijah Newren <newren gmail com>
* MAINTAINERS: New file. #335026. ;-)
diff --git a/src/resizepopup.c b/src/resizepopup.c
index a20d4682..28303c38 100644
--- a/src/resizepopup.c
+++ b/src/resizepopup.c
@@ -41,10 +41,7 @@ struct _MetaResizePopup
gboolean showing;
int resize_gravity;
- int x;
- int y;
- int width;
- int height;
+ MetaRectangle rect;
int width_inc;
int height_inc;
int min_width;
@@ -133,8 +130,8 @@ update_size_window (MetaResizePopup *popup)
gtk_window_get_size (GTK_WINDOW (popup->size_window), &width, &height);
- x = popup->x + (popup->width - width) / 2;
- y = popup->y + (popup->height - height) / 2;
+ x = popup->rect.x + (popup->rect.width - width) / 2;
+ y = popup->rect.y + (popup->rect.height - height) / 2;
if (GTK_WIDGET_REALIZED (popup->size_window))
{
@@ -171,10 +168,7 @@ sync_showing (MetaResizePopup *popup)
void
meta_ui_resize_popup_set (MetaResizePopup *popup,
int resize_gravity,
- int x,
- int y,
- int width,
- int height,
+ MetaRectangle rect,
int base_width,
int base_height,
int min_width,
@@ -193,27 +187,21 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
need_update_size = FALSE;
- display_w = width - base_width;
+ display_w = rect.width - base_width;
if (width_inc > 0)
display_w /= width_inc;
- display_h = height - base_height;
+ display_h = rect.height - base_height;
if (height_inc > 0)
display_h /= height_inc;
-
- if (popup->x != x ||
- popup->y != y ||
- popup->width != width ||
- popup->height != height ||
+
+ if (!meta_rectangle_equal(&popup->rect, &rect) ||
display_w != popup->horizontal_size ||
display_h != popup->vertical_size)
need_update_size = TRUE;
popup->resize_gravity = resize_gravity;
- popup->x = x;
- popup->y = y;
- popup->width = width;
- popup->height = height;
+ popup->rect = rect;
popup->min_width = min_width;
popup->min_height = min_height;
popup->width_inc = width_inc;
diff --git a/src/resizepopup.h b/src/resizepopup.h
index 8f317d66..97c35ab9 100644
--- a/src/resizepopup.h
+++ b/src/resizepopup.h
@@ -23,6 +23,7 @@
#define META_RESIZEPOPUP_H
/* Don't include gtk.h or gdk.h here */
+#include "boxes.h"
#include "common.h"
#include <X11/Xlib.h>
#include <glib.h>
@@ -33,10 +34,7 @@ MetaResizePopup* meta_ui_resize_popup_new (Display *display,
void meta_ui_resize_popup_free (MetaResizePopup *popup);
void meta_ui_resize_popup_set (MetaResizePopup *popup,
int resize_gravity,
- int x,
- int y,
- int width,
- int height,
+ MetaRectangle rect,
int base_width,
int base_height,
int min_width,
diff --git a/src/window.c b/src/window.c
index ae5e1546..7438338d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4333,7 +4333,7 @@ meta_window_client_message (MetaWindow *window,
MetaDisplay *display;
display = window->display;
-
+
if (event->xclient.message_type ==
display->atom_net_close_window)
{
@@ -7197,7 +7197,7 @@ meta_window_refresh_resize_popup (MetaWindow *window)
if (window->display->grab_resize_popup != NULL)
{
int gravity;
- int x, y, width, height;
+ MetaRectangle rect;
MetaFrameGeometry fgeom;
if (window->frame)
@@ -7215,22 +7215,18 @@ meta_window_refresh_resize_popup (MetaWindow *window)
if (window->display->grab_wireframe_active)
{
- x = window->display->grab_wireframe_rect.x;
- y = window->display->grab_wireframe_rect.y;
- width = window->display->grab_wireframe_rect.width;
- height = window->display->grab_wireframe_rect.height;
+ rect = window->display->grab_wireframe_rect;
}
else
{
- meta_window_get_position (window, &x, &y);
- width = window->rect.width;
- height = window->rect.height;
+ meta_window_get_position (window, &rect.x, &rect.y);
+ rect.width = window->rect.width;
+ rect.height = window->rect.height;
}
meta_ui_resize_popup_set (window->display->grab_resize_popup,
gravity,
- x, y,
- width, height,
+ rect,
window->size_hints.base_width,
window->size_hints.base_height,
window->size_hints.min_width,