add a "fullscreen" semantic type; if a window requests the screen size
2001-08-19 Havoc Pennington <hp@pobox.com> * 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.
This commit is contained in:
parent
04e09d4c56
commit
f562e65d5f
5 changed files with 48 additions and 14 deletions
|
@ -1,3 +1,12 @@
|
|||
2001-08-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* 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 <hp@pobox.com>
|
||||
|
||||
* src/screen.c (set_supported_hint): we support _NET_WM_ICON
|
||||
|
|
|
@ -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;
|
||||
|
|
13
src/stack.h
13
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
|
||||
|
|
31
src/window.c
31
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue