move pposition/usposition honoring code into here, instead of putting it

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

	* src/place.c (meta_window_place): move pposition/usposition
	honoring code into here, instead of putting it in window.c.
	Makes focusing new windows work, and cleans things up a bit.
	#81585
This commit is contained in:
Havoc Pennington 2002-05-13 00:03:17 +00:00 committed by Havoc Pennington
parent 973662d5c3
commit 5151c5102d
3 changed files with 63 additions and 52 deletions

View File

@ -1,3 +1,10 @@
2002-05-12 Havoc Pennington <hp@pobox.com>
* src/place.c (meta_window_place): move pposition/usposition
honoring code into here, instead of putting it in window.c.
Makes focusing new windows work, and cleans things up a bit.
#81585
2002-05-12 Havoc Pennington <hp@pobox.com>
* src/main.c (main): turn on --g-fatal-warnings if

View File

@ -19,8 +19,11 @@
* 02111-1307, USA.
*/
#include <config.h>
#include "place.h"
#include "workspace.h"
#include "prefs.h"
#include <gdk/gdkregion.h>
#include <math.h>
#include <stdlib.h>
@ -251,7 +254,59 @@ meta_window_place (MetaWindow *window,
* placement coordinates.
*/
meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc);
meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc);
if (meta_prefs_get_disable_workarounds ())
{
switch (window->type)
{
/* Only accept USPosition on normal windows because the app is full
* of shit claiming the user set -geometry for a dialog or dock
*/
case META_WINDOW_NORMAL:
if (window->size_hints.flags & USPosition)
{
/* don't constrain with placement algorithm */
meta_topic (META_DEBUG_PLACEMENT,
"Honoring USPosition for %s instead of using placement algorithm\n", window->desc);
goto done;
}
break;
/* Ignore even USPosition on dialogs, splashscreen */
case META_WINDOW_DIALOG:
case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN:
break;
/* Assume the app knows best how to place these. */
case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK:
case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU:
case META_WINDOW_UTILITY:
if (window->size_hints.flags & PPosition)
{
meta_topic (META_DEBUG_PLACEMENT,
"Not placing non-normal non-dialog window with PPosition set\n");
goto done;
}
break;
}
}
else
{
/* workarounds enabled */
if ((window->size_hints.flags & PPosition) ||
(window->size_hints.flags & USPosition))
{
meta_topic (META_DEBUG_PLACEMENT,
"Not placing window with PPosition or USPosition set\n");
goto done;
}
}
if ((window->type == META_WINDOW_DIALOG ||
window->type == META_WINDOW_MODAL_DIALOG) &&

View File

@ -573,57 +573,6 @@ meta_window_new (MetaDisplay *display, Window xwindow,
meta_workspace_add_window (space, window);
}
if (meta_prefs_get_disable_workarounds ())
{
switch (window->type)
{
/* Only accept USPosition on normal windows because the app is full
* of shit claiming the user set -geometry for a dialog or dock
*/
case META_WINDOW_NORMAL:
if (window->size_hints.flags & USPosition)
{
/* don't constrain with placement algorithm */
window->placed = TRUE;
meta_topic (META_DEBUG_PLACEMENT,
"Honoring USPosition for %s instead of using placement algorithm\n", window->desc);
}
break;
/* Ignore even USPosition on dialogs, splashscreen */
case META_WINDOW_DIALOG:
case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN:
break;
/* Assume the app knows best how to place these. */
case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK:
case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU:
case META_WINDOW_UTILITY:
if (window->size_hints.flags & PPosition)
{
window->placed = TRUE;
meta_topic (META_DEBUG_PLACEMENT,
"Not placing non-normal non-dialog window with PPosition set\n");
}
break;
}
}
else
{
/* workarounds enabled */
if ((window->size_hints.flags & PPosition) ||
(window->size_hints.flags & USPosition))
{
window->placed = TRUE;
meta_topic (META_DEBUG_PLACEMENT,
"Not placing window with PPosition or USPosition set\n");
}
}
if (window->type == META_WINDOW_DESKTOP ||
window->type == META_WINDOW_DOCK)