core/place: Reformat place.c
This commit only reformats place.c, starting off uncrustify's output, no functional change is intended. It mostly aligns comments, as well as properly space out math, follow current formatter enforced guidelines and fix alignment on a rogue bracket. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4202>
This commit is contained in:
parent
5d07e69461
commit
7c5005b9b0
@ -40,6 +40,11 @@
|
||||
#include "x11/window-x11-private.h"
|
||||
#endif
|
||||
|
||||
/* arbitrary-ish threshold, honors user attempts to manually cascade. */
|
||||
#define CASCADE_FUZZ 15
|
||||
/* space between top-left corners of cascades */
|
||||
#define CASCADE_INTERVAL 50
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_LEFT,
|
||||
@ -141,10 +146,6 @@ find_next_cascade (MetaWindow *window,
|
||||
* position, we move on.
|
||||
*/
|
||||
|
||||
/* arbitrary-ish threshold, honors user attempts to
|
||||
* manually cascade.
|
||||
*/
|
||||
#define CASCADE_FUZZ 15
|
||||
x_threshold = CASCADE_FUZZ;
|
||||
y_threshold = CASCADE_FUZZ;
|
||||
|
||||
@ -216,7 +217,6 @@ find_next_cascade (MetaWindow *window,
|
||||
cascade_x = cascade_origin_x;
|
||||
cascade_y = MAX (0, work_area.y);
|
||||
|
||||
#define CASCADE_INTERVAL 50 /* space between top-left corners of cascades */
|
||||
cascade_stage += 1;
|
||||
if (ltr)
|
||||
cascade_x += CASCADE_INTERVAL * cascade_stage;
|
||||
@ -294,21 +294,21 @@ find_most_freespace (MetaWindow *window,
|
||||
|
||||
/* Find out which side of the focus_window can show the most of the window */
|
||||
side = META_LEFT;
|
||||
max_area = left*max_height;
|
||||
if (right*max_height > max_area)
|
||||
max_area = left * max_height;
|
||||
if (right * max_height > max_area)
|
||||
{
|
||||
side = META_RIGHT;
|
||||
max_area = right*max_height;
|
||||
max_area = right * max_height;
|
||||
}
|
||||
if (top*max_width > max_area)
|
||||
if (top * max_width > max_area)
|
||||
{
|
||||
side = META_TOP;
|
||||
max_area = top*max_width;
|
||||
max_area = top * max_width;
|
||||
}
|
||||
if (bottom*max_width > max_area)
|
||||
if (bottom * max_width > max_area)
|
||||
{
|
||||
side = META_BOTTOM;
|
||||
max_area = bottom*max_width;
|
||||
max_area = bottom * max_width;
|
||||
}
|
||||
|
||||
/* Give up if there's no where to put it (i.e. focus window is maximized) */
|
||||
@ -478,7 +478,8 @@ rectangle_overlaps_some_window (MtkRectangle *rect,
|
||||
}
|
||||
|
||||
static gint
|
||||
leftmost_cmp (gconstpointer a, gconstpointer b)
|
||||
leftmost_cmp (gconstpointer a,
|
||||
gconstpointer b)
|
||||
{
|
||||
MetaWindow *aw = (gpointer) a;
|
||||
MetaWindow *bw = (gpointer) b;
|
||||
@ -507,7 +508,8 @@ rightmost_cmp (gconstpointer a,
|
||||
}
|
||||
|
||||
static gint
|
||||
topmost_cmp (gconstpointer a, gconstpointer b)
|
||||
topmost_cmp (gconstpointer a,
|
||||
gconstpointer b)
|
||||
{
|
||||
MetaWindow *aw = (gpointer) a;
|
||||
MetaWindow *bw = (gpointer) b;
|
||||
@ -898,7 +900,7 @@ meta_window_place (MetaWindow *window,
|
||||
/* "visually" center window over parent, leaving twice as
|
||||
* much space below as on top.
|
||||
*/
|
||||
y += (parent_frame_rect.height - frame_rect.height)/3;
|
||||
y += (parent_frame_rect.height - frame_rect.height) / 3;
|
||||
|
||||
meta_topic (META_DEBUG_PLACEMENT,
|
||||
"Centered window %s over transient parent",
|
||||
@ -977,7 +979,7 @@ meta_window_place (MetaWindow *window,
|
||||
/* No good fit? Fall back to cascading... */
|
||||
find_next_cascade (window, windows, x, y, &x, &y);
|
||||
|
||||
done_check_denied_focus:
|
||||
done_check_denied_focus:
|
||||
/* If the window is being denied focus and isn't a transient of the
|
||||
* focus window, we do NOT want it to overlap with the focus window
|
||||
* if at all possible. This is guaranteed to only be called if the
|
||||
@ -1019,7 +1021,7 @@ meta_window_place (MetaWindow *window,
|
||||
find_most_freespace (window, focus_window, x, y, &x, &y);
|
||||
}
|
||||
|
||||
done:
|
||||
done:
|
||||
*new_x = x;
|
||||
*new_y = y;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user