[mutter] window-props: use memcmp() to compare GtkBorder structs
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window-props: use memcmp() to compare GtkBorder structs
- Date: Fri, 13 Feb 2015 23:49:14 +0000 (UTC)
commit 11a9b4baa0aef0fa48dd0645c2da981ef6bd5d8e
Author: Cosimo Cecchi <cosimo endlessm com>
Date: Fri Feb 13 14:54:37 2015 -0800
window-props: use memcmp() to compare GtkBorder structs
Saves some code.
https://bugzilla.gnome.org/show_bug.cgi?id=744500
src/x11/window-props.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index 786524b..8836a1d 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -338,16 +338,6 @@ reload_icon_geometry (MetaWindow *window,
}
}
-static gboolean
-gtk_border_equal (GtkBorder *a,
- GtkBorder *b)
-{
- return (a->left == b->left &&
- a->right == b->right &&
- a->top == b->top &&
- a->bottom == b->bottom);
-}
-
static void
meta_window_set_custom_frame_extents (MetaWindow *window,
GtkBorder *extents,
@@ -355,7 +345,8 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
{
if (extents)
{
- if (window->has_custom_frame_extents && gtk_border_equal (&window->custom_frame_extents, extents))
+ if (window->has_custom_frame_extents &&
+ memcmp (&window->custom_frame_extents, extents, sizeof (GtkBorder)) == 0)
return;
window->has_custom_frame_extents = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]