summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-03-13 18:32:20 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2014-03-14 11:25:55 -0400
commit24e12053ea6b589fb1660f97b6df3488ddc308fd (patch)
treeddead1bb08a4ee9010ea4bb730a2e99e2091f5b8 /src
parent991c85f6a00be7cdc03b021d14b28b554d5e5b01 (diff)
downloadmutter-24e12053ea6b589fb1660f97b6df3488ddc308fd.tar.gz
window: Add a META_MAXIMIZE_BOTH maximization flag
Which has both directions set. This is a simple cleanup to remove the constant VERTICAL | HORIZONTAL all over the place. https://bugzilla.gnome.org/show_bug.cgi?id=726352
Diffstat (limited to 'src')
-rw-r--r--src/compositor/meta-window-actor.c2
-rw-r--r--src/core/core.c24
-rw-r--r--src/core/keybindings.c30
-rw-r--r--src/core/window.c28
-rw-r--r--src/meta/window.h4
5 files changed, 27 insertions, 61 deletions
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 61a6e4eb7..8f6cf4ef5 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -687,7 +687,7 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
/* Leaving out shadows for maximized and fullscreen windows is an effeciency
* win and also prevents the unsightly effect of the shadow of maximized
* window appearing on an adjacent window */
- if ((meta_window_get_maximized (priv->window) == (META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL)) ||
+ if ((meta_window_get_maximized (priv->window) == META_MAXIMIZE_BOTH) ||
meta_window_is_fullscreen (priv->window))
return FALSE;
diff --git a/src/core/core.c b/src/core/core.c
index 25c5bf6af..319020d49 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -322,8 +322,7 @@ meta_core_maximize (Display *xdisplay,
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
void
@@ -336,11 +335,9 @@ meta_core_toggle_maximize_vertically (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED_VERTICALLY (window))
- meta_window_unmaximize (window,
- META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);
else
- meta_window_maximize (window,
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_VERTICAL);
}
void
@@ -353,11 +350,9 @@ meta_core_toggle_maximize_horizontally (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED_HORIZONTALLY (window))
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
else
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL);
+ meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL);
}
void
@@ -370,11 +365,9 @@ meta_core_toggle_maximize (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED (window))
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
else
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
void
@@ -386,8 +379,7 @@ meta_core_unmaximize (Display *xdisplay,
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
void
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index f2c663186..83b2f7096 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2015,9 +2015,7 @@ process_mouse_move_resize_grab (MetaDisplay *display,
* moveresize now to get the position back to the original.
*/
if (window->shaken_loose || window->tile_mode == META_TILE_MAXIMIZED)
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
else if (window->tile_mode != META_TILE_NONE)
meta_window_tile (window);
else
@@ -2079,9 +2077,7 @@ process_keyboard_move_grab (MetaDisplay *display,
* now to get the position back to the original.
*/
if (window->shaken_loose)
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
else
meta_window_move_resize (display->grab_window,
TRUE,
@@ -2945,11 +2941,9 @@ handle_toggle_tiled (MetaDisplay *display,
: META_TILE_NONE;
if (window->saved_maximize)
- meta_window_maximize (window, META_MAXIMIZE_VERTICAL |
- META_MAXIMIZE_HORIZONTAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
else
- meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL |
- META_MAXIMIZE_HORIZONTAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
else if (meta_window_can_tile_side_by_side (window))
{
@@ -2975,13 +2969,9 @@ handle_toggle_maximized (MetaDisplay *display,
gpointer dummy)
{
if (META_WINDOW_MAXIMIZED (window))
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
else if (window->has_maximize_func)
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
static void
@@ -2993,9 +2983,7 @@ handle_maximize (MetaDisplay *display,
gpointer dummy)
{
if (window->has_maximize_func)
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
static void
@@ -3007,9 +2995,7 @@ handle_unmaximize (MetaDisplay *display,
gpointer dummy)
{
if (window->maximized_vertically || window->maximized_horizontally)
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
static void
diff --git a/src/core/window.c b/src/core/window.c
index 2ac5a10c9..d6fdb0a37 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1562,9 +1562,7 @@ meta_window_apply_session_info (MetaWindow *window,
if (window->has_maximize_func && info->maximized)
{
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
if (info->saved_rect_set)
{
@@ -3676,7 +3674,7 @@ meta_window_tile (MetaWindow *window)
return;
if (window->tile_mode == META_TILE_MAXIMIZED)
- directions = META_MAXIMIZE_VERTICAL | META_MAXIMIZE_HORIZONTAL;
+ directions = META_MAXIMIZE_BOTH;
else
directions = META_MAXIMIZE_VERTICAL;
@@ -8712,15 +8710,11 @@ menu_callback (MetaWindowMenu *menu,
break;
case META_MENU_OP_UNMAXIMIZE:
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
break;
case META_MENU_OP_MAXIMIZE:
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
break;
case META_MENU_OP_UNSHADE:
@@ -9237,10 +9231,7 @@ update_move (MetaWindow *window,
display->grab_anchor_root_x = x;
display->grab_anchor_root_y = y;
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
-
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
return;
}
@@ -9284,9 +9275,7 @@ update_move (MetaWindow *window,
window->user_rect.x = window->saved_rect.x;
window->user_rect.y = window->saved_rect.y;
- meta_window_unmaximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
+ meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
display->grab_initial_window_pos = work_area;
@@ -9294,10 +9283,7 @@ update_move (MetaWindow *window,
display->grab_anchor_root_y = y;
window->shaken_loose = FALSE;
- meta_window_maximize (window,
- META_MAXIMIZE_HORIZONTAL |
- META_MAXIMIZE_VERTICAL);
-
+ meta_window_maximize (window, META_MAXIMIZE_BOTH);
return;
}
}
diff --git a/src/meta/window.h b/src/meta/window.h
index ed444dd07..0a5145d2c 100644
--- a/src/meta/window.h
+++ b/src/meta/window.h
@@ -72,11 +72,13 @@ typedef enum
* MetaMaximizeFlags:
* @META_MAXIMIZE_HORIZONTAL: Horizontal
* @META_MAXIMIZE_VERTICAL: Vertical
+ * @META_MAXIMIZE_BOTH: Both
*/
typedef enum
{
META_MAXIMIZE_HORIZONTAL = 1 << 0,
- META_MAXIMIZE_VERTICAL = 1 << 1
+ META_MAXIMIZE_VERTICAL = 1 << 1,
+ META_MAXIMIZE_BOTH = (1 << 0 | 1 << 1),
} MetaMaximizeFlags;
#define META_TYPE_WINDOW (meta_window_get_type ())