window: Set custom frame extents to 0 if we don't have any

This is just a quick code cleanup.
This commit is contained in:
Jasper St. Pierre 2014-06-26 11:13:09 -04:00
parent c562657f1e
commit a615f93060

View File

@ -4091,8 +4091,6 @@ meta_window_client_rect_to_frame_rect (MetaWindow *window,
frame_rect->height += borders.visible.top + borders.visible.bottom; frame_rect->height += borders.visible.top + borders.visible.bottom;
} }
else else
{
if (window->has_custom_frame_extents)
{ {
const GtkBorder *extents = &window->custom_frame_extents; const GtkBorder *extents = &window->custom_frame_extents;
frame_rect->x += extents->left; frame_rect->x += extents->left;
@ -4102,7 +4100,6 @@ meta_window_client_rect_to_frame_rect (MetaWindow *window,
if (frame_rect->height != G_MAXINT) if (frame_rect->height != G_MAXINT)
frame_rect->height -= extents->top + extents->bottom; frame_rect->height -= extents->top + extents->bottom;
} }
}
} }
/** /**
@ -4135,8 +4132,6 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window,
client_rect->height -= borders.visible.top + borders.visible.bottom; client_rect->height -= borders.visible.top + borders.visible.bottom;
} }
else else
{
if (window->has_custom_frame_extents)
{ {
const GtkBorder *extents = &window->custom_frame_extents; const GtkBorder *extents = &window->custom_frame_extents;
client_rect->x -= extents->left; client_rect->x -= extents->left;
@ -4144,7 +4139,6 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window,
client_rect->width += extents->left + extents->right; client_rect->width += extents->left + extents->right;
client_rect->height += extents->top + extents->bottom; client_rect->height += extents->top + extents->bottom;
} }
}
} }
/** /**
@ -7958,6 +7952,7 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
else else
{ {
window->has_custom_frame_extents = FALSE; window->has_custom_frame_extents = FALSE;
memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
} }
meta_window_queue (window, META_QUEUE_MOVE_RESIZE); meta_window_queue (window, META_QUEUE_MOVE_RESIZE);