diff --git a/ChangeLog b/ChangeLog index 1d28a587e..ae7a7e051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-05-12 Havoc Pennington + + * 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 * src/main.c (main): turn on --g-fatal-warnings if diff --git a/src/place.c b/src/place.c index 62337818b..bcf9371e6 100644 --- a/src/place.c +++ b/src/place.c @@ -19,8 +19,11 @@ * 02111-1307, USA. */ +#include + #include "place.h" #include "workspace.h" +#include "prefs.h" #include #include #include @@ -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) && diff --git a/src/window.c b/src/window.c index c0a27a5a2..0a0b16a7a 100644 --- a/src/window.c +++ b/src/window.c @@ -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)