[mutter] window: Remove unnecessary checks
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Remove unnecessary checks
- Date: Mon, 21 Mar 2011 21:01:04 +0000 (UTC)
commit c9e941254011a01a84fb60ec78f29f4b80b238f9
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Mar 21 21:43:46 2011 +0100
window: Remove unnecessary checks
For tiling, we check whether the pointer is near the edges of
the monitor where the pointer is located, so checking that the
pointer is within the bounds of the monitor is unnecessary and
confusing.
src/core/window.c | 30 +++++++++++-------------------
1 files changed, 11 insertions(+), 19 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index e15eefb..c9566bc 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8124,18 +8124,14 @@ update_move (MetaWindow *window,
if (meta_window_can_tile_side_by_side (window))
{
- if (y >= monitor->rect.y &&
- y < (monitor->rect.y + monitor->rect.height))
- {
- /* check if cursor is near an edge of the work area */
- if (x >= monitor->rect.x && x < (work_area.x + shake_threshold))
- window->tile_mode = META_TILE_LEFT;
- else if (x >= work_area.x + work_area.width - shake_threshold &&
- x < (monitor->rect.x + monitor->rect.width))
- window->tile_mode = META_TILE_RIGHT;
- else
- window->tile_mode = META_TILE_NONE;
- }
+ /* check if cursor is near an edge of the work area */
+ if (x >= monitor->rect.x && x < (work_area.x + shake_threshold))
+ window->tile_mode = META_TILE_LEFT;
+ else if (x >= work_area.x + work_area.width - shake_threshold &&
+ x < (monitor->rect.x + monitor->rect.width))
+ window->tile_mode = META_TILE_RIGHT;
+ else
+ window->tile_mode = META_TILE_NONE;
}
else
window->tile_mode = META_TILE_NONE;
@@ -8149,13 +8145,9 @@ update_move (MetaWindow *window,
*/
if (window->tile_mode == META_TILE_NONE && meta_window_can_tile_maximized (window))
{
- if (x >= monitor->rect.x &&
- x < (monitor->rect.x + monitor->rect.width))
- {
- /* check if cursor is on the top edge of the monitor*/
- if (y >= monitor->rect.y && y <= work_area.y)
- window->tile_mode = META_TILE_MAXIMIZED;
- }
+ /* check if cursor is on the top edge of the monitor*/
+ if (y >= monitor->rect.y && y <= work_area.y)
+ window->tile_mode = META_TILE_MAXIMIZED;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]