summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constraints.c19
-rw-r--r--src/stack.c38
-rw-r--r--src/window.c29
-rw-r--r--src/window.h8
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);