summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-04-29 21:29:51 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-04-29 21:29:51 +0000
commitcd40cc9edbb236e1101c8e887a333f85dab29678 (patch)
tree5d6e18a56eca87d7b29485a9a509d18aa9aed30f
parente8267b20feacc9179f9ab7cc66df111cc284fb28 (diff)
downloadmetacity-cd40cc9edbb236e1101c8e887a333f85dab29678.tar.gz
require 36 pixels onscreen so you typically get a sliver of titlebar,
2002-04-29 Havoc Pennington <hp@redhat.com> * src/window.c (TITLEBAR_LENGTH_ONSCREEN): require 36 pixels onscreen so you typically get a sliver of titlebar, suggested by tigert. Should still fix this to consider actual theme geometry. (constrain_position): change to allow movement off the left
-rw-r--r--ChangeLog7
-rw-r--r--src/window.c48
2 files changed, 20 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index a8172071..829f9a77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2002-04-29 Havoc Pennington <hp@redhat.com>
+ * src/window.c (TITLEBAR_LENGTH_ONSCREEN): require 36 pixels
+ onscreen so you typically get a sliver of titlebar, suggested by
+ tigert. Should still fix this to consider actual theme geometry.
+ (constrain_position): change to allow movement off the left
+
+2002-04-29 Havoc Pennington <hp@redhat.com>
+
* src/display.c (event_callback): always raise windows on focus
click, regardless of focus mode.
diff --git a/src/window.c b/src/window.c
index e27f61ac..7c092fd8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4899,15 +4899,21 @@ constrain_position (MetaWindow *window,
int nw_x, nw_y;
int se_x, se_y;
int offscreen_w, offscreen_h;
-
- /* find furthest northwest point the window can occupy,
- * to disallow moving titlebar off the top or left
+
+ /* (FIXME instead of TITLEBAR_LENGTH_ONSCREEN, get the actual
+ * size of the menu control?).
*/
+
+#define TITLEBAR_LENGTH_ONSCREEN 36
+
+ /* find furthest northwest point the window can occupy */
nw_x = work_area.x;
nw_y = work_area.y;
if (window->frame)
{
- nw_x += fgeom->left_width;
+ /* Must keep TITLEBAR_LENGTH_ONSCREEN onscreen when moving left */
+ nw_x -= fgeom->left_width + window->rect.width + fgeom->right_width - TITLEBAR_LENGTH_ONSCREEN;
+ /* Can't move off the top */
nw_y += fgeom->top_height;
}
@@ -4935,41 +4941,12 @@ constrain_position (MetaWindow *window,
nw_x -= offscreen_w;
if (offscreen_h > 0)
nw_y -= offscreen_h;
-
-#if 0
- /* This is the old don't-allow-off-screen-at-all constraint */
- /* Convert se_x, se_y to the most bottom-right position
- * the window can occupy - don't allow offscreen
- */
- se_x -= window->rect.width;
- se_y -= window->rect.height;
- if (window->frame)
- {
- se_x -= fgeom->right_width;
- se_y -= fgeom->bottom_height;
- }
-
- /* If the window is larger than screen, allow it to move, as for
- * nw_x nw_y
- */
- if (offscreen_w > 0)
- se_x += offscreen_w;
- if (offscreen_h > 0)
- se_y += offscreen_h;
-#endif
-
-#if 1
- /* Require the top-left corner of the frame to be onscreen,
- * so people can't lose the menu control. (FIXME
- * instead of TITLEBAR_LENGTH_ONSCREEN, get the actual size
- * of the menu control?).
- *
+ /* Limit movement off the right/bottom.
* Remember, we're constraining StaticGravity position.
*/
if (window->frame)
{
-#define TITLEBAR_LENGTH_ONSCREEN 15
se_x -= TITLEBAR_LENGTH_ONSCREEN;
se_y -= 0;
}
@@ -4981,7 +4958,6 @@ constrain_position (MetaWindow *window,
se_x -= TITLEBAR_LENGTH_ONSCREEN;
se_y -= TITLEBAR_LENGTH_ONSCREEN;
}
-#endif
/* If we have a micro-screen or huge frames maybe nw/se got
* swapped
@@ -5023,6 +4999,8 @@ constrain_position (MetaWindow *window,
if (y != nw_y)
y = nw_y;
}
+
+#undef TITLEBAR_LENGTH_ONSCREEN
}
*new_x = x;