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.
This commit is contained in:
Havoc Pennington 2001-11-27 05:14:57 +00:00 committed by Havoc Pennington
parent 420c29dea9
commit 248487a63c
2 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,10 @@
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.
2001-11-26 Havoc Pennington <hp@redhat.com> 2001-11-26 Havoc Pennington <hp@redhat.com>
* src/window.c (window_query_root_pointer): add error trap * src/window.c (window_query_root_pointer): add error trap

View File

@ -4778,6 +4778,9 @@ constrain_position (MetaWindow *window,
if (offscreen_h > 0) if (offscreen_h > 0)
nw_y -= offscreen_h; 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 /* Convert se_x, se_y to the most bottom-right position
* the window can occupy - don't allow offscreen * the window can occupy - don't allow offscreen
*/ */
@ -4796,14 +4799,29 @@ constrain_position (MetaWindow *window,
se_x += offscreen_w; se_x += offscreen_w;
if (offscreen_h > 0) if (offscreen_h > 0)
se_y += offscreen_h; se_y += offscreen_h;
#endif
#if 0 #if 1
/* this is the old allow-offscreen-to-se constraint */ /* 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) if (window->frame)
{ {
#define TITLEBAR_LENGTH_ONSCREEN 10 #define TITLEBAR_LENGTH_ONSCREEN 15
se_x -= (fgeom->left_width + TITLEBAR_LENGTH_ONSCREEN); se_x -= TITLEBAR_LENGTH_ONSCREEN;
se_y -= fgeom->top_height; 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 #endif