From e694f071443fb80255d80103f7d50f14fb4f0a93 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 8 Jun 2002 06:29:19 +0000 Subject: [PATCH] Yeah I know maximization is broken, I'm too tired to fix it. Probably 2002-06-08 Havoc Pennington Yeah I know maximization is broken, I'm too tired to fix it. Probably because of the change to update_struts() that was supposed to fix the 100% CPU bug. * src/place.c (meta_window_place): don't run docks and things through the placement algorithm. Thought it might fix metacity-window-demo but it didn't. * src/window.c (constrain_size): only get work area when needed (meta_window_new): init the do_not_cover field --- ChangeLog | 13 +++++++++++++ src/place.c | 21 +++++++++++++++++++++ src/window.c | 8 +++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97e784f2b..4ba9e25e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-06-08 Havoc Pennington + + Yeah I know maximization is broken, I'm too tired to fix it. + Probably because of the change to update_struts() that was + supposed to fix the 100% CPU bug. + + * src/place.c (meta_window_place): don't run docks and things + through the placement algorithm. Thought it might fix + metacity-window-demo but it didn't. + + * src/window.c (constrain_size): only get work area when needed + (meta_window_new): init the do_not_cover field + 2002-06-08 Havoc Pennington * src/screen.c (meta_screen_get_xinerama_for_window): diff --git a/src/place.c b/src/place.c index f8ea82b4c..b3aaac6bc 100644 --- a/src/place.c +++ b/src/place.c @@ -308,6 +308,27 @@ meta_window_place (MetaWindow *window, goto done; } } + + 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 || window->type == META_WINDOW_MODAL_DIALOG) && diff --git a/src/window.c b/src/window.c index d9a238a7b..1a7373571 100644 --- a/src/window.c +++ b/src/window.c @@ -400,6 +400,7 @@ meta_window_new (MetaDisplay *display, Window xwindow, window->type_atom = None; window->has_struts = FALSE; + window->do_not_cover = FALSE; window->left_strut = 0; window->right_strut = 0; window->top_strut = 0; @@ -4977,13 +4978,10 @@ constrain_size (MetaWindow *window, int delta; double min_aspect, max_aspect; int minw, minh, maxw, maxh, fullw, fullh; - MetaRectangle work_area; /* frame member variables should NEVER be used in here */ #define FLOOR(value, base) ( ((int) ((value) / (base))) * (base) ) - - meta_window_get_work_area (window, TRUE, &work_area); /* Get the allowed size ranges, considering maximized, etc. */ if (window->fullscreen) @@ -5006,6 +5004,10 @@ constrain_size (MetaWindow *window, } else { + MetaRectangle work_area; + + meta_window_get_work_area (window, TRUE, &work_area); + fullw = work_area.width; fullh = work_area.height; }