don't run constrain_placement on windows we allow to go anywhere (docks,

2002-06-09  Havoc Pennington  <hp@pobox.com>

	* src/place.c (meta_window_place): don't run constrain_placement
	on windows we allow to go anywhere (docks, etc.). Fixes
	positioning of panel windows in certain cases.
This commit is contained in:
Havoc Pennington 2002-06-09 18:17:02 +00:00 committed by Havoc Pennington
parent 9bad861649
commit 8057a2f68a
3 changed files with 36 additions and 29 deletions

View File

@ -1,3 +1,9 @@
2002-06-09 Havoc Pennington <hp@pobox.com>
* src/place.c (meta_window_place): don't run constrain_placement
on windows we allow to go anywhere (docks, etc.). Fixes
positioning of panel windows in certain cases.
2002-06-09 Havoc Pennington <hp@pobox.com> 2002-06-09 Havoc Pennington <hp@pobox.com>
* src/frames.c (meta_frames_button_press_event): don't raise/focus * src/frames.c (meta_frames_button_press_event): don't raise/focus

View File

@ -257,6 +257,27 @@ meta_window_place (MetaWindow *window,
meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc); meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc);
switch (window->type)
{
/* Run placement algorithm on these. */
case META_WINDOW_NORMAL:
case META_WINDOW_DIALOG:
case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN:
break;
/* Assume the app knows best how to place these, no placement
* algorithm ever (other than "leave them as-is")
*/
case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK:
case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU:
case META_WINDOW_UTILITY:
goto done_no_constraints;
break;
}
if (meta_prefs_get_disable_workarounds ()) if (meta_prefs_get_disable_workarounds ())
{ {
switch (window->type) switch (window->type)
@ -291,7 +312,7 @@ meta_window_place (MetaWindow *window,
{ {
meta_topic (META_DEBUG_PLACEMENT, meta_topic (META_DEBUG_PLACEMENT,
"Not placing non-normal non-dialog window with PPosition set\n"); "Not placing non-normal non-dialog window with PPosition set\n");
goto done; goto done_no_constraints;
} }
break; break;
} }
@ -305,30 +326,9 @@ meta_window_place (MetaWindow *window,
{ {
meta_topic (META_DEBUG_PLACEMENT, meta_topic (META_DEBUG_PLACEMENT,
"Not placing window with PPosition or USPosition set\n"); "Not placing window with PPosition or USPosition set\n");
goto done; goto done_no_constraints;
} }
} }
switch (window->type)
{
/* Run placement algorithm on these. */
case META_WINDOW_NORMAL:
case META_WINDOW_DIALOG:
case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN:
break;
/* Assume the app knows best how to place these, no placement
* algorithm ever (other than "leave them as-is")
*/
case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK:
case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU:
case META_WINDOW_UTILITY:
goto done;
break;
}
if ((window->type == META_WINDOW_DIALOG || if ((window->type == META_WINDOW_DIALOG ||
window->type == META_WINDOW_MODAL_DIALOG) && window->type == META_WINDOW_MODAL_DIALOG) &&
@ -440,7 +440,8 @@ meta_window_place (MetaWindow *window,
done: done:
constrain_placement (window, fgeom, x, y, &x, &y); constrain_placement (window, fgeom, x, y, &x, &y);
done_no_constraints:
*new_x = x; *new_x = x;
*new_y = y; *new_y = y;
} }

View File

@ -5108,12 +5108,12 @@ constrain_size (MetaWindow *window,
} }
static void static void
constrain_position (MetaWindow *window, constrain_position (MetaWindow *window,
MetaFrameGeometry *fgeom, MetaFrameGeometry *fgeom,
int x, int x,
int y, int y,
int *new_x, int *new_x,
int *new_y) int *new_y)
{ {
/* frame member variables should NEVER be used in here, only /* frame member variables should NEVER be used in here, only
* MetaFrameGeometry * MetaFrameGeometry