[PATCH 4/6] cairo-util: Don't show a resize cursor on edges when we're maximized

Jasper St. Pierre jstpierre at mecheye.net
Mon Apr 28 08:19:30 PDT 2014


This is substantially confusing to users, namely me.
---
 shared/cairo-util.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/shared/cairo-util.c b/shared/cairo-util.c
index a1568ff..a77d0b6 100644
--- a/shared/cairo-util.c
+++ b/shared/cairo-util.c
@@ -487,11 +487,14 @@ enum theme_location
 theme_get_location(struct theme *t, int x, int y,
 				int width, int height, int flags)
 {
+	int maximized;
 	int vlocation, hlocation, location;
 	const int grip_size = 8;
 	int margin, top_margin;
 
-	margin = (flags & THEME_FRAME_MAXIMIZED) ? 0 : t->margin;
+	maximized = (flags & THEME_FRAME_MAXIMIZED);
+
+	margin = maximized ? 0 : t->margin;
 
 	if (flags & THEME_FRAME_NO_TITLE)
 		top_margin = t->width;
@@ -500,22 +503,22 @@ theme_get_location(struct theme *t, int x, int y,
 
 	if (x < margin)
 		hlocation = THEME_LOCATION_EXTERIOR;
-	else if (x < margin + grip_size)
+	else if (!maximized && x < margin + grip_size)
 		hlocation = THEME_LOCATION_RESIZING_LEFT;
 	else if (x < width - margin - grip_size)
 		hlocation = THEME_LOCATION_INTERIOR;
-	else if (x < width - margin)
+	else if (!maximized && x < width - margin)
 		hlocation = THEME_LOCATION_RESIZING_RIGHT;
 	else
 		hlocation = THEME_LOCATION_EXTERIOR;
 
 	if (y < margin)
 		vlocation = THEME_LOCATION_EXTERIOR;
-	else if (y < margin + grip_size)
+	else if (!maximized && y < margin + grip_size)
 		vlocation = THEME_LOCATION_RESIZING_TOP;
 	else if (y < height - margin - grip_size)
 		vlocation = THEME_LOCATION_INTERIOR;
-	else if (y < height - margin)
+	else if (!maximized && y < height - margin)
 		vlocation = THEME_LOCATION_RESIZING_BOTTOM;
 	else
 		vlocation = THEME_LOCATION_EXTERIOR;
-- 
1.9.0



More information about the wayland-devel mailing list