summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-11-27 05:14:57 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-11-27 05:14:57 +0000
commit248487a63c33b66cc05018f0ca49f6c00e4d220d (patch)
treeafeb9636a7ce51c9462c3d80ca3506f2424ed3b5 /src
parent420c29dea98c52610bd74adcbc05973ddb465cdd (diff)
downloadmetacity-248487a63c33b66cc05018f0ca49f6c00e4d220d.tar.gz
metacity-248487a63c33b66cc05018f0ca49f6c00e4d220d.tar.bz2
change so that window can be offscreen to the bottom or the right, as long
2001-11-27 Havoc Pennington <hp@pobox.com> * src/window.c (constrain_position): change so that window can be offscreen to the bottom or the right, as long as a small top-left corner of the window remains onscreen. However, windows still can't go off the left or top.
Diffstat (limited to 'src')
-rw-r--r--src/window.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index 41b002d..0c47f96 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4777,6 +4777,9 @@ 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
@@ -4796,14 +4799,29 @@ constrain_position (MetaWindow *window,
se_x += offscreen_w;
if (offscreen_h > 0)
se_y += offscreen_h;
+#endif
-#if 0
- /* this is the old allow-offscreen-to-se constraint */
+#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?).
+ *
+ * Remember, we're constraining StaticGravity position.
+ */
if (window->frame)
{
-#define TITLEBAR_LENGTH_ONSCREEN 10
- se_x -= (fgeom->left_width + TITLEBAR_LENGTH_ONSCREEN);
- se_y -= fgeom->top_height;
+#define TITLEBAR_LENGTH_ONSCREEN 15
+ se_x -= TITLEBAR_LENGTH_ONSCREEN;
+ se_y -= 0;
+ }
+ else
+ {
+ /* for frameless windows, just require an arbitrary little
+ * chunk to be onscreen
+ */
+ se_x -= TITLEBAR_LENGTH_ONSCREEN;
+ se_y -= TITLEBAR_LENGTH_ONSCREEN;
}
#endif