when maximizing/fullscreening something with a grid, like a terminal,

2002-05-10  Havoc Pennington  <hp@pobox.com>

	* src/window.c (constrain_position): when maximizing/fullscreening
	something with a grid, like a terminal, center it in the
	maximization area in case it can't fill the whole area.
	#70554

	* src/main.c (main): use g_strerror() to get proper UTF-8.
This commit is contained in:
Havoc Pennington 2002-05-11 03:37:51 +00:00 committed by Havoc Pennington
parent 487c6cfaaa
commit 2679d3cf00
3 changed files with 33 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2002-05-10 Havoc Pennington <hp@pobox.com>
* src/window.c (constrain_position): when maximizing/fullscreening
something with a grid, like a terminal, center it in the
maximization area in case it can't fill the whole area.
#70554
* src/main.c (main): use g_strerror() to get proper UTF-8.
2002-05-10 Havoc Pennington <hp@pobox.com>
* src/keybindings.c (reload_modmap): put LockMask into the

View File

@ -84,10 +84,12 @@ main (int argc, char **argv)
act.sa_mask = empty_mask;
act.sa_flags = 0;
if (sigaction (SIGPIPE, &act, 0) < 0)
g_printerr ("Failed to register SIGPIPE handler: %s\n", strerror (errno));
g_printerr ("Failed to register SIGPIPE handler: %s\n",
g_strerror (errno));
#ifdef SIGXFSZ
if (sigaction (SIGXFSZ, &act, 0) < 0)
g_printerr ("Failed to register SIGXFSZ handler: %s\n", strerror (errno));
g_printerr ("Failed to register SIGXFSZ handler: %s\n",
g_strerror (errno));
#endif
if (g_getenv ("METACITY_VERBOSE"))

View File

@ -5057,6 +5057,16 @@ constrain_position (MetaWindow *window,
{
x = 0;
y = 0;
/* If the window's geometry gridding (e.g. for a terminal)
* prevents fullscreen, center the window within
* the screen area.
*/
x += (window->screen->width - window->rect.width -
(window->frame ? (fgeom->left_width + fgeom->right_width) : 0)) / 2;
y += (window->screen->height - window->rect.height -
(window->frame ? (fgeom->top_height + fgeom->bottom_height) : 0)) / 2;
}
else if (window->maximized)
{
@ -5067,6 +5077,16 @@ constrain_position (MetaWindow *window,
x += fgeom->left_width;
y += fgeom->top_height;
}
/* If the window's geometry gridding (e.g. for a terminal)
* prevents full maximization, center the window within
* the maximized area.
*/
x += (work_area.width - window->rect.width -
(window->frame ? (fgeom->left_width + fgeom->right_width) : 0)) / 2;
y += (work_area.height - window->rect.height -
(window->frame ? (fgeom->top_height + fgeom->bottom_height) : 0)) / 2;
}
else if (window->type != META_WINDOW_DESKTOP &&
window->type != META_WINDOW_DOCK)