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
This commit is contained in:
Havoc Pennington 2002-04-29 21:29:51 +00:00 committed by Havoc Pennington
parent e8267b20fe
commit cd40cc9edb
2 changed files with 20 additions and 35 deletions

View File

@ -1,3 +1,10 @@
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> 2002-04-29 Havoc Pennington <hp@redhat.com>
* src/display.c (event_callback): always raise windows on focus * src/display.c (event_callback): always raise windows on focus

View File

@ -4900,14 +4900,20 @@ constrain_position (MetaWindow *window,
int se_x, se_y; int se_x, se_y;
int offscreen_w, offscreen_h; int offscreen_w, offscreen_h;
/* find furthest northwest point the window can occupy, /* (FIXME instead of TITLEBAR_LENGTH_ONSCREEN, get the actual
* to disallow moving titlebar off the top or left * size of the menu control?).
*/ */
#define TITLEBAR_LENGTH_ONSCREEN 36
/* find furthest northwest point the window can occupy */
nw_x = work_area.x; nw_x = work_area.x;
nw_y = work_area.y; nw_y = work_area.y;
if (window->frame) 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; nw_y += fgeom->top_height;
} }
@ -4936,40 +4942,11 @@ constrain_position (MetaWindow *window,
if (offscreen_h > 0) if (offscreen_h > 0)
nw_y -= offscreen_h; nw_y -= offscreen_h;
#if 0 /* Limit movement off the right/bottom.
/* 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?).
*
* Remember, we're constraining StaticGravity position. * Remember, we're constraining StaticGravity position.
*/ */
if (window->frame) if (window->frame)
{ {
#define TITLEBAR_LENGTH_ONSCREEN 15
se_x -= TITLEBAR_LENGTH_ONSCREEN; se_x -= TITLEBAR_LENGTH_ONSCREEN;
se_y -= 0; se_y -= 0;
} }
@ -4981,7 +4958,6 @@ constrain_position (MetaWindow *window,
se_x -= TITLEBAR_LENGTH_ONSCREEN; se_x -= TITLEBAR_LENGTH_ONSCREEN;
se_y -= TITLEBAR_LENGTH_ONSCREEN; se_y -= TITLEBAR_LENGTH_ONSCREEN;
} }
#endif
/* If we have a micro-screen or huge frames maybe nw/se got /* If we have a micro-screen or huge frames maybe nw/se got
* swapped * swapped
@ -5023,6 +4999,8 @@ constrain_position (MetaWindow *window,
if (y != nw_y) if (y != nw_y)
y = nw_y; y = nw_y;
} }
#undef TITLEBAR_LENGTH_ONSCREEN
} }
*new_x = x; *new_x = x;