diff options
author | Elijah Newren <newren gmail com> | 2006-08-21 18:08:05 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2006-08-21 18:08:05 +0000 |
commit | 4c96afba71d917d46aacf625ef09327ab71dc388 (patch) | |
tree | 4613cdacc6077c6bd75e94a03d84c1e4b55250d2 /src | |
parent | 7ea55a1e5427a42bfb21434f579dd1512984477e (diff) | |
download | metacity-4c96afba71d917d46aacf625ef09327ab71dc388.tar.gz |
Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21 Elijah Newren <newren gmail com>
Fix several bugs with handling of fullscreen windows, causing them
to not actually be fullscreen. #343115 (and also #346927,
#350547, #351643, the recent additional WINE-related issue
mentioned on the mailing list, and probably others...)
* src/constraints.c (setup_constraint_info): if a window tries to
resize to fullscreen-size and it has a fullscreen function but
isn't actually marked as fullscreen then assist it by marking it
as such, (constrain_fully_onscreen, constrain_titlebar_visible):
ignore this constraint for fullscreen windows since such windows
have a separate specialized constraint
* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
remove the old window_is_fullscreen_size() hack for detecting
windows to treat as fullscreen since it doesn't work well with the
new constraints framework (i.e. we needed a slightly different
hack)
* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
of adding the window to the stack and moveresizing the window
since moveresizing can cause stack changes if the window's initial
size is fullscreen size, (meta_window_make_fullscreen,
meta_window_make_fullscreen_internal): split
meta_window_make_fullscreen() similar to meta_window_maximize() so
that constraints can make use of it
Diffstat (limited to 'src')
-rw-r--r-- | src/constraints.c | 19 | ||||
-rw-r--r-- | src/stack.c | 38 | ||||
-rw-r--r-- | src/window.c | 29 | ||||
-rw-r--r-- | src/window.h | 8 |
4 files changed, 46 insertions, 48 deletions
diff --git a/src/constraints.c b/src/constraints.c index 1638203f..5a85ae92 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -399,6 +399,23 @@ setup_constraint_info (ConstraintInfo *info, meta_workspace_get_onxinerama_region (cur_workspace, xinerama_info->number); + /* Workaround braindead legacy apps that don't know how to + * fullscreen themselves properly. + */ + if (meta_rectangle_equal (new, &xinerama_info->rect) && + window->has_fullscreen_func && + !window->fullscreen) + { + /* + meta_topic (META_DEBUG_GEOMETRY, + */ + meta_warning ( + "Treating resize request of legacy application %s as a " + "fullscreen request\n", + window->desc); + meta_window_make_fullscreen_internal (window); + } + /* Log all this information for debugging */ meta_topic (META_DEBUG_GEOMETRY, "Setting up constraint info:\n" @@ -1069,6 +1086,7 @@ constrain_fully_onscreen (MetaWindow *window, */ if (window->type == META_WINDOW_DESKTOP || window->type == META_WINDOW_DOCK || + window->fullscreen || !window->require_fully_onscreen || info->is_user_action) return TRUE; @@ -1110,6 +1128,7 @@ constrain_titlebar_visible (MetaWindow *window, */ if (window->type == META_WINDOW_DESKTOP || window->type == META_WINDOW_DOCK || + window->fullscreen || !window->require_titlebar_visible || !window->decorated || unconstrained_user_action) diff --git a/src/stack.c b/src/stack.c index ad6c038c..6202966e 100644 --- a/src/stack.c +++ b/src/stack.c @@ -197,42 +197,6 @@ meta_stack_thaw (MetaStack *stack) } static gboolean -window_is_fullscreen_size (MetaWindow *window) -{ - int i; - - if (meta_rectangle_could_fit_rect (&window->rect, &window->screen->rect)) - { - /* we use the work area since windows that try to - * position at 0,0 will get pushed down by menu panel - */ - MetaRectangle workarea; - - meta_window_get_work_area_current_xinerama (window, &workarea); - if (meta_rectangle_contains_rect (&window->rect, &workarea)) - return TRUE; - } - - i = 0; - while (i < window->screen->n_xinerama_infos) - { - if (meta_rectangle_could_fit_rect (&window->rect, - &window->screen->xinerama_infos[i].rect)) - { - MetaRectangle workarea; - - meta_window_get_work_area_current_xinerama (window, &workarea); - if (meta_rectangle_contains_rect (&window->rect, &workarea)) - return TRUE; - } - - ++i; - } - - return FALSE; -} - -static gboolean is_focused_foreach (MetaWindow *window, void *data) { @@ -283,7 +247,7 @@ get_standalone_layer (MetaWindow *window) if (window->wm_state_below) layer = META_LAYER_BOTTOM; - else if ((window->fullscreen || window_is_fullscreen_size (window)) && + else if (window->fullscreen && (focused_transient || window == window->display->expected_focus_window || window->display->expected_focus_window == NULL || diff --git a/src/window.c b/src/window.c index ecce821b..6dd16784 100644 --- a/src/window.c +++ b/src/window.c @@ -701,6 +701,16 @@ meta_window_new_with_attrs (MetaDisplay *display, meta_window_update_struts (window); + /* Must add window to stack before doing move/resize, since the + * window might have fullscreen size (i.e. should have been + * fullscreen'd; acrobat is one such braindead case; it withdraws + * and remaps its window whenever trying to become fullscreen...) + * and thus constraints may try to auto-fullscreen it which also + * means restacking it. + */ + meta_stack_add (window->screen->stack, + window); + /* Put our state back where it should be, * passing TRUE for is_configure_request, ICCCM says * initial map is handled same as configure request @@ -715,9 +725,6 @@ meta_window_new_with_attrs (MetaDisplay *display, window->size_hints.width, window->size_hints.height); - meta_stack_add (window->screen->stack, - window); - /* Now try applying saved stuff from the session */ { const MetaWindowSessionInfo *info; @@ -2359,7 +2366,7 @@ meta_window_unmake_above (MetaWindow *window) } void -meta_window_make_fullscreen (MetaWindow *window) +meta_window_make_fullscreen_internal (MetaWindow *window) { if (!window->fullscreen) { @@ -2379,12 +2386,20 @@ meta_window_make_fullscreen (MetaWindow *window) meta_window_raise (window); meta_stack_thaw (window->screen->stack); + recalc_window_features (window); + set_net_wm_state (window); + } +} + +void +meta_window_make_fullscreen (MetaWindow *window) +{ + if (!window->fullscreen) + { + meta_window_make_fullscreen_internal (window); /* move_resize with new constraints */ meta_window_queue_move_resize (window); - - recalc_window_features (window); - set_net_wm_state (window); } } diff --git a/src/window.h b/src/window.h index 4695945c..8da1af8c 100644 --- a/src/window.h +++ b/src/window.h @@ -404,10 +404,10 @@ void meta_window_unstick (MetaWindow *window); void meta_window_activate (MetaWindow *window, guint32 current_time); -void meta_window_activate_with_workspace (MetaWindow *window, - guint32 current_time, - MetaWorkspace *workspace); - +void meta_window_activate_with_workspace (MetaWindow *window, + guint32 current_time, + MetaWorkspace *workspace); +void meta_window_make_fullscreen_internal (MetaWindow *window); void meta_window_make_fullscreen (MetaWindow *window); void meta_window_unmake_fullscreen (MetaWindow *window); |