quartz: make test_resize () conform to coding style

This commit is contained in:
Kristian Rietveld
2011-11-06 09:33:50 +01:00
committed by Kristian Rietveld
parent 9f45c37be7
commit e5ccae5782

View File

@@ -1074,11 +1074,12 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
{
GdkWindowImplQuartz *toplevel_impl;
gboolean lion;
/* Resizing only begins if an NSLeftMouseButton event is received in
* the resizing area. Handle anything else.
*/
if ([event type] != NSLeftMouseDown)
return FALSE;
return FALSE;
toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
if ([toplevel_impl->toplevel showsResizeIndicator])
@@ -1096,14 +1097,13 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
* is too important to not make functional.
*/
frame = [toplevel_impl->view bounds];
if (x > frame.size.width - GRIP_WIDTH
&& x < frame.size.width
&& y > frame.size.height - GRIP_HEIGHT
&& y < frame.size.height)
{
return TRUE;
}
if (x > frame.size.width - GRIP_WIDTH &&
x < frame.size.width &&
y > frame.size.height - GRIP_HEIGHT &&
y < frame.size.height)
return TRUE;
}
/* If we're on Lion and within 5 pixels of an edge,
* then assume that the user wants to resize, and
* return NULL to let Quartz get on with it. We check
@@ -1111,14 +1111,12 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
* This extra check is in case the user starts
* dragging before GDK recognizes the grab.
*/
lion = gdk_quartz_osx_version() >= GDK_OSX_LION;
lion = gdk_quartz_osx_version () >= GDK_OSX_LION;
if (lion && (x < GDK_LION_RESIZE ||
x > toplevel->width - GDK_LION_RESIZE ||
y > toplevel->height - GDK_LION_RESIZE))
{
return TRUE;
}
x > toplevel->width - GDK_LION_RESIZE ||
y > toplevel->height - GDK_LION_RESIZE))
return TRUE;
return FALSE;
}
@@ -1228,8 +1226,9 @@ gdk_event_translate (GdkEvent *event,
window = find_window_for_ns_event (nsevent, &x, &y, &x_root, &y_root);
if (!window)
return FALSE;
/* Quartz handles resizing on its own, so we want to stay out of the way. */
if (test_resize(nsevent, window, x, y))
if (test_resize (nsevent, window, x, y))
return FALSE;
/* Apply any window filters. */