mirror of
https://github.com/brl/mutter.git
synced 2025-02-11 10:54:09 +00:00
tiling: add side_by_side suffix to tile code
The meta_window_can_tile function and META_WINDOW_TILED macro are pretty side-by-side tiling specific, so rename them. https://bugzilla.gnome.org/show_bug.cgi?id=630548
This commit is contained in:
parent
0d27c9600f
commit
aa3a4a48e4
@ -796,7 +796,7 @@ constrain_maximization (MetaWindow *window,
|
|||||||
|
|
||||||
/* Determine whether constraint applies; exit if it doesn't */
|
/* Determine whether constraint applies; exit if it doesn't */
|
||||||
if ((!window->maximized_horizontally && !window->maximized_vertically) ||
|
if ((!window->maximized_horizontally && !window->maximized_vertically) ||
|
||||||
META_WINDOW_TILED (window))
|
META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Calculate target_size = maximized size of (window + frame) */
|
/* Calculate target_size = maximized size of (window + frame) */
|
||||||
@ -880,7 +880,7 @@ constrain_tiling (MetaWindow *window,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Determine whether constraint applies; exit if it doesn't */
|
/* Determine whether constraint applies; exit if it doesn't */
|
||||||
if (!META_WINDOW_TILED (window))
|
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Calculate target_size - as the tile previews need this as well, we
|
/* Calculate target_size - as the tile previews need this as well, we
|
||||||
@ -968,7 +968,8 @@ constrain_size_increments (MetaWindow *window,
|
|||||||
|
|
||||||
/* Determine whether constraint applies; exit if it doesn't */
|
/* Determine whether constraint applies; exit if it doesn't */
|
||||||
if (META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
|
if (META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
|
||||||
META_WINDOW_TILED (window) || info->action_type == ACTION_MOVE)
|
META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
|
||||||
|
info->action_type == ACTION_MOVE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Determine whether constraint is already satisfied; exit if it is */
|
/* Determine whether constraint is already satisfied; exit if it is */
|
||||||
@ -1099,7 +1100,8 @@ constrain_aspect_ratio (MetaWindow *window,
|
|||||||
constraints_are_inconsistent = minr > maxr;
|
constraints_are_inconsistent = minr > maxr;
|
||||||
if (constraints_are_inconsistent ||
|
if (constraints_are_inconsistent ||
|
||||||
META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
|
META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
|
||||||
META_WINDOW_TILED (window) || info->action_type == ACTION_MOVE)
|
META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
|
||||||
|
info->action_type == ACTION_MOVE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Determine whether constraint is already satisfied; exit if it is. We
|
/* Determine whether constraint is already satisfied; exit if it is. We
|
||||||
|
@ -1776,7 +1776,7 @@ meta_screen_tile_preview_update_timeout (gpointer data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window
|
if (window
|
||||||
&& !META_WINDOW_TILED (window)
|
&& !META_WINDOW_TILED_SIDE_BY_SIDE (window)
|
||||||
&& window->tile_mode != META_TILE_NONE)
|
&& window->tile_mode != META_TILE_NONE)
|
||||||
{
|
{
|
||||||
MetaRectangle tile_rect;
|
MetaRectangle tile_rect;
|
||||||
|
@ -409,11 +409,11 @@ struct _MetaWindowClass
|
|||||||
(w)->maximized_vertically)
|
(w)->maximized_vertically)
|
||||||
#define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically)
|
#define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically)
|
||||||
#define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally)
|
#define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally)
|
||||||
#define META_WINDOW_TILED(w) ((w)->maximized_vertically && \
|
#define META_WINDOW_TILED_SIDE_BY_SIDE(w) ((w)->maximized_vertically && \
|
||||||
!(w)->maximized_horizontally && \
|
!(w)->maximized_horizontally && \
|
||||||
(w)->tile_mode != META_TILE_NONE)
|
(w)->tile_mode != META_TILE_NONE)
|
||||||
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen)
|
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen)
|
||||||
#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED(w) && !(w)->fullscreen && !(w)->shaded)
|
#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED_SIDE_BY_SIDE(w) && !(w)->fullscreen && !(w)->shaded)
|
||||||
#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
|
#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
|
||||||
(((w)->size_hints.min_width < (w)->size_hints.max_width) || \
|
(((w)->size_hints.min_width < (w)->size_hints.max_width) || \
|
||||||
((w)->size_hints.min_height < (w)->size_hints.max_height)))
|
((w)->size_hints.min_height < (w)->size_hints.max_height)))
|
||||||
|
@ -2972,7 +2972,7 @@ ensure_size_hints_satisfied (MetaRectangle *rect,
|
|||||||
static void
|
static void
|
||||||
meta_window_save_rect (MetaWindow *window)
|
meta_window_save_rect (MetaWindow *window)
|
||||||
{
|
{
|
||||||
if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED (window) || window->fullscreen))
|
if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen))
|
||||||
{
|
{
|
||||||
/* save size/pos as appropriate args for move_resize */
|
/* save size/pos as appropriate args for move_resize */
|
||||||
if (!window->maximized_horizontally)
|
if (!window->maximized_horizontally)
|
||||||
@ -3014,7 +3014,7 @@ force_save_user_window_placement (MetaWindow *window)
|
|||||||
static void
|
static void
|
||||||
save_user_window_placement (MetaWindow *window)
|
save_user_window_placement (MetaWindow *window)
|
||||||
{
|
{
|
||||||
if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED (window) || window->fullscreen))
|
if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen))
|
||||||
{
|
{
|
||||||
MetaRectangle user_rect;
|
MetaRectangle user_rect;
|
||||||
|
|
||||||
@ -3218,7 +3218,7 @@ meta_window_tile (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_window_can_tile (MetaWindow *window)
|
meta_window_can_tile_side_by_side (MetaWindow *window)
|
||||||
{
|
{
|
||||||
const MetaMonitorInfo *monitor;
|
const MetaMonitorInfo *monitor;
|
||||||
MetaRectangle tile_area;
|
MetaRectangle tile_area;
|
||||||
@ -7800,7 +7800,7 @@ update_move (MetaWindow *window,
|
|||||||
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
|
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
|
||||||
|
|
||||||
if (meta_prefs_get_edge_tiling () &&
|
if (meta_prefs_get_edge_tiling () &&
|
||||||
meta_window_can_tile (window))
|
meta_window_can_tile_side_by_side (window))
|
||||||
{
|
{
|
||||||
const MetaMonitorInfo *monitor;
|
const MetaMonitorInfo *monitor;
|
||||||
MetaRectangle work_area;
|
MetaRectangle work_area;
|
||||||
@ -7834,12 +7834,12 @@ update_move (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ((META_WINDOW_MAXIMIZED (window) && ABS (dy) >= shake_threshold) ||
|
if ((META_WINDOW_MAXIMIZED (window) && ABS (dy) >= shake_threshold) ||
|
||||||
(META_WINDOW_TILED (window) && (MAX (ABS (dx), ABS (dy)) >= shake_threshold)))
|
(META_WINDOW_TILED_SIDE_BY_SIDE (window) && (MAX (ABS (dx), ABS (dy)) >= shake_threshold)))
|
||||||
{
|
{
|
||||||
double prop;
|
double prop;
|
||||||
|
|
||||||
/* Shake loose */
|
/* Shake loose */
|
||||||
window->shaken_loose = !META_WINDOW_TILED (window);
|
window->shaken_loose = !META_WINDOW_TILED_SIDE_BY_SIDE (window);
|
||||||
window->tile_mode = META_TILE_NONE;
|
window->tile_mode = META_TILE_NONE;
|
||||||
|
|
||||||
/* move the unmaximized window to the cursor */
|
/* move the unmaximized window to the cursor */
|
||||||
@ -7936,7 +7936,7 @@ update_move (MetaWindow *window,
|
|||||||
meta_window_get_client_root_coords (window, &old);
|
meta_window_get_client_root_coords (window, &old);
|
||||||
|
|
||||||
/* Don't allow movement in the maximized directions or while tiled */
|
/* Don't allow movement in the maximized directions or while tiled */
|
||||||
if (window->maximized_horizontally || META_WINDOW_TILED (window))
|
if (window->maximized_horizontally || META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
new_x = old.x;
|
new_x = old.x;
|
||||||
if (window->maximized_vertically)
|
if (window->maximized_vertically)
|
||||||
new_y = old.y;
|
new_y = old.y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user