diff --git a/ChangeLog b/ChangeLog index 9852cb0fb..38eac77cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-08-19 Havoc Pennington + + * src/window.c: add a "fullscreen" semantic type; if a window + requests the screen size exactly, and is undecorated, and is not a + desktop window, we consider it a fullscreen window and keep it on + top. + + Totally untested. + 2001-08-19 Havoc Pennington * src/screen.c (set_supported_hint): we support _NET_WM_ICON diff --git a/src/stack.c b/src/stack.c index 91e7e372f..b0bd94d55 100644 --- a/src/stack.c +++ b/src/stack.c @@ -262,6 +262,10 @@ compute_layer (MetaWindow *window) window->layer = META_LAYER_DOCK; break; + case META_WINDOW_FULLSCREEN: + window->layer = META_LAYER_FULLSCREEN; + break; + default: window->layer = META_LAYER_NORMAL; break; diff --git a/src/stack.h b/src/stack.h index e9ad4e464..d126b644d 100644 --- a/src/stack.h +++ b/src/stack.h @@ -32,12 +32,13 @@ typedef struct _MetaStackOp MetaStackOp; /* These MUST be in the order of stacking */ typedef enum { - META_LAYER_DESKTOP = 0, - META_LAYER_BOTTOM = 1, - META_LAYER_NORMAL = 2, - META_LAYER_TOP = 3, - META_LAYER_DOCK = 4, - META_LAYER_LAST = 5 + META_LAYER_DESKTOP = 0, + META_LAYER_BOTTOM = 1, + META_LAYER_NORMAL = 2, + META_LAYER_TOP = 3, + META_LAYER_DOCK = 4, + META_LAYER_FULLSCREEN = 5, + META_LAYER_LAST = 6 } MetaStackLayer; struct _MetaStack diff --git a/src/window.c b/src/window.c index 591582b4d..2848d6438 100644 --- a/src/window.c +++ b/src/window.c @@ -286,7 +286,7 @@ meta_window_new (MetaDisplay *display, Window xwindow, window->calc_placement = FALSE; window->unmaps_pending = 0; - + window->mwm_decorated = TRUE; window->mwm_has_close_func = TRUE; window->mwm_has_minimize_func = TRUE; @@ -1287,7 +1287,7 @@ meta_window_move_resize_internal (MetaWindow *window, int pos_dx; int pos_dy; int frame_size_dx; - int frame_size_dy; + int frame_size_dy; { int oldx, oldy; @@ -1297,7 +1297,7 @@ meta_window_move_resize_internal (MetaWindow *window, is_configure_request ? " (configure request)" : "", oldx, oldy, window->rect.width, window->rect.height); } - + if (window->frame) meta_frame_calc_geometry (window->frame, &fgeom); @@ -3817,6 +3817,13 @@ recalc_window_type (MetaWindow *window) window->wm_state_modal) window->type = META_WINDOW_MODAL_DIALOG; + if (window->type == META_WINDOW_NORMAL && + !window->mwm_decorated && + (window->rect.x == 0 && window->rect.y == 0 && + window->rect.width == window->screen->width && + window->rect.height == window->screen->height)) + window->type = META_WINDOW_FULLSCREEN; + meta_verbose ("Calculated type %d for %s, old type %d\n", window->type, window->desc, old_type); @@ -3853,7 +3860,8 @@ recalc_window_features (MetaWindow *window) /* Semantic category overrides the MWM hints */ if (window->type == META_WINDOW_DESKTOP || - window->type == META_WINDOW_DOCK) + window->type == META_WINDOW_DOCK || + window->type == META_WINDOW_FULLSCREEN) { window->decorated = FALSE; window->has_close_func = FALSE; @@ -3910,8 +3918,19 @@ constrain_size (MetaWindow *window, #define FLOOR(value, base) ( ((int) ((value) / (base))) * (base) ) /* Get the allowed size ranges, considering maximized, etc. */ - fullw = window->screen->active_workspace->workarea.width; - fullh = window->screen->active_workspace->workarea.height; + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK || + window->type == META_WINDOW_FULLSCREEN) + { + fullw = window->screen->width; + fullh = window->screen->height; + } + else + { + fullw = window->screen->active_workspace->workarea.width; + fullh = window->screen->active_workspace->workarea.height; + } + if (window->frame) { fullw -= fgeom->left_width + fgeom->right_width; diff --git a/src/window.h b/src/window.h index a70649dbb..d3bbf9e3d 100644 --- a/src/window.h +++ b/src/window.h @@ -36,7 +36,8 @@ typedef enum META_WINDOW_DIALOG, META_WINDOW_MODAL_DIALOG, META_WINDOW_TOOLBAR, - META_WINDOW_MENU + META_WINDOW_MENU, + META_WINDOW_FULLSCREEN } MetaWindowType; struct _MetaWindow @@ -116,7 +117,7 @@ struct _MetaWindow guint delete_window : 1; /* Globally active / No input */ guint input : 1; - + /* MWM hints about features of window */ guint mwm_decorated : 1; guint mwm_has_close_func : 1;