mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
make it static
2002-10-01 Havoc Pennington <hp@pobox.com> * src/screen.c (meta_screen_resize_func): make it static * src/stack.c (get_standalone_layer): put above/below windows in an appropriate layer. * src/screen.c (set_supported_hint): say we support above/below * src/display.h (struct _MetaDisplay): add _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW atoms * src/window.c (meta_window_client_message): handle above/below state messages (set_net_wm_state): handler above/below state (update_net_wm_state): handle above/below states
This commit is contained in:
parent
791ab07bd4
commit
94b6dde6bb
17
ChangeLog
17
ChangeLog
@ -1,3 +1,20 @@
|
||||
2002-10-01 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/screen.c (meta_screen_resize_func): make it static
|
||||
|
||||
* src/stack.c (get_standalone_layer): put above/below windows
|
||||
in an appropriate layer.
|
||||
|
||||
* src/screen.c (set_supported_hint): say we support above/below
|
||||
|
||||
* src/display.h (struct _MetaDisplay): add _NET_WM_STATE_ABOVE,
|
||||
_NET_WM_STATE_BELOW atoms
|
||||
|
||||
* src/window.c (meta_window_client_message): handle above/below
|
||||
state messages
|
||||
(set_net_wm_state): handler above/below state
|
||||
(update_net_wm_state): handle above/below states
|
||||
|
||||
2002-10-01 Mark McLoughlin <mark@skynet.ie>
|
||||
|
||||
* src/screen.c: (meta_screen_new): default to
|
||||
|
@ -221,6 +221,8 @@ meta_display_open (const char *name)
|
||||
"_NET_WM_ACTION_MAXIMIZE_VERT",
|
||||
"_NET_WM_ACTION_CHANGE_DESKTOP",
|
||||
"_NET_WM_ACTION_CLOSE",
|
||||
"_NET_WM_STATE_ABOVE",
|
||||
"_NET_WM_STATE_BELOW"
|
||||
};
|
||||
Atom atoms[G_N_ELEMENTS(atom_names)];
|
||||
|
||||
@ -350,6 +352,8 @@ meta_display_open (const char *name)
|
||||
display->atom_net_wm_action_maximize_vert = atoms[72];
|
||||
display->atom_net_wm_action_change_desktop = atoms[73];
|
||||
display->atom_net_wm_action_close = atoms[74];
|
||||
display->atom_net_wm_state_above = atoms[75];
|
||||
display->atom_net_wm_state_below = atoms[76];
|
||||
|
||||
/* Offscreen unmapped window used for _NET_SUPPORTING_WM_CHECK,
|
||||
* created in screen_new
|
||||
|
@ -147,6 +147,8 @@ struct _MetaDisplay
|
||||
Atom atom_net_wm_action_maximize_vert;
|
||||
Atom atom_net_wm_action_change_desktop;
|
||||
Atom atom_net_wm_action_close;
|
||||
Atom atom_net_wm_state_above;
|
||||
Atom atom_net_wm_state_below;
|
||||
|
||||
/* This is the actual window from focus events,
|
||||
* not the one we last set
|
||||
|
@ -84,7 +84,7 @@ set_wm_check_hint (MetaScreen *screen)
|
||||
static int
|
||||
set_supported_hint (MetaScreen *screen)
|
||||
{
|
||||
#define N_SUPPORTED 42
|
||||
#define N_SUPPORTED 44
|
||||
#define N_WIN_SUPPORTED 1
|
||||
Atom atoms[N_SUPPORTED];
|
||||
|
||||
@ -130,6 +130,8 @@ set_supported_hint (MetaScreen *screen)
|
||||
atoms[39] = screen->display->atom_net_wm_action_maximize_vert;
|
||||
atoms[40] = screen->display->atom_net_wm_action_change_desktop;
|
||||
atoms[41] = screen->display->atom_net_wm_action_close;
|
||||
atoms[42] = screen->display->atom_net_wm_state_above;
|
||||
atoms[43] = screen->display->atom_net_wm_state_below;
|
||||
|
||||
XChangeProperty (screen->display->xdisplay, screen->xroot,
|
||||
screen->display->atom_net_supported,
|
||||
@ -1520,7 +1522,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
|
||||
*c = cols;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
meta_screen_resize_func (MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
void *user_data)
|
||||
|
@ -191,7 +191,10 @@ get_standalone_layer (MetaWindow *window)
|
||||
|
||||
case META_WINDOW_DOCK:
|
||||
/* still experimenting here */
|
||||
layer = META_LAYER_DOCK;
|
||||
if (window->wm_state_below)
|
||||
layer = META_LAYER_BOTTOM;
|
||||
else
|
||||
layer = META_LAYER_DOCK;
|
||||
break;
|
||||
|
||||
case META_WINDOW_SPLASHSCREEN:
|
||||
@ -205,6 +208,8 @@ get_standalone_layer (MetaWindow *window)
|
||||
layer = META_LAYER_FOCUSED_WINDOW;
|
||||
else if (window->fullscreen)
|
||||
layer = META_LAYER_FULLSCREEN;
|
||||
else if (window->wm_state_above)
|
||||
layer = META_LAYER_TOP;
|
||||
else
|
||||
layer = META_LAYER_NORMAL;
|
||||
break;
|
||||
|
40
src/window.c
40
src/window.c
@ -389,6 +389,8 @@ meta_window_new (MetaDisplay *display, Window xwindow,
|
||||
window->skip_pager = FALSE;
|
||||
window->wm_state_skip_taskbar = FALSE;
|
||||
window->wm_state_skip_pager = FALSE;
|
||||
window->wm_state_above = FALSE;
|
||||
window->wm_state_below = FALSE;
|
||||
|
||||
window->res_class = NULL;
|
||||
window->res_name = NULL;
|
||||
@ -1063,6 +1065,16 @@ set_net_wm_state (MetaWindow *window)
|
||||
data[i] = window->display->atom_net_wm_state_hidden;
|
||||
++i;
|
||||
}
|
||||
if (window->wm_state_above)
|
||||
{
|
||||
data[i] = window->display->atom_net_wm_state_above;
|
||||
++i;
|
||||
}
|
||||
if (window->wm_state_below)
|
||||
{
|
||||
data[i] = window->display->atom_net_wm_state_below;
|
||||
++i;
|
||||
}
|
||||
|
||||
meta_verbose ("Setting _NET_WM_STATE with %d atoms\n", i);
|
||||
|
||||
@ -3440,6 +3452,26 @@ meta_window_client_message (MetaWindow *window,
|
||||
|
||||
set_net_wm_state (window);
|
||||
}
|
||||
|
||||
if (first == display->atom_net_wm_state_above ||
|
||||
second == display->atom_net_wm_state_above)
|
||||
{
|
||||
window->wm_state_above =
|
||||
(action == _NET_WM_STATE_ADD) ||
|
||||
(action == _NET_WM_STATE_TOGGLE && !window->wm_state_above);
|
||||
|
||||
set_net_wm_state (window);
|
||||
}
|
||||
|
||||
if (first == display->atom_net_wm_state_below ||
|
||||
second == display->atom_net_wm_state_below)
|
||||
{
|
||||
window->wm_state_below =
|
||||
(action == _NET_WM_STATE_ADD) ||
|
||||
(action == _NET_WM_STATE_TOGGLE && !window->wm_state_below);
|
||||
|
||||
set_net_wm_state (window);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -4363,6 +4395,8 @@ update_net_wm_state (MetaWindow *window)
|
||||
window->wm_state_modal = FALSE;
|
||||
window->wm_state_skip_taskbar = FALSE;
|
||||
window->wm_state_skip_pager = FALSE;
|
||||
window->wm_state_above = FALSE;
|
||||
window->wm_state_below = FALSE;
|
||||
|
||||
if (meta_prop_get_atom_list (window->display, window->xwindow,
|
||||
window->display->atom_net_wm_state,
|
||||
@ -4387,7 +4421,11 @@ update_net_wm_state (MetaWindow *window)
|
||||
window->wm_state_skip_pager = TRUE;
|
||||
else if (atoms[i] == window->display->atom_net_wm_state_fullscreen)
|
||||
window->fullscreen = TRUE;
|
||||
|
||||
else if (atoms[i] == window->display->atom_net_wm_state_above)
|
||||
window->wm_state_above = TRUE;
|
||||
else if (atoms[i] == window->display->atom_net_wm_state_below)
|
||||
window->wm_state_below = TRUE;
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,10 @@ struct _MetaWindow
|
||||
/* Computed whether to skip taskbar or not */
|
||||
guint skip_taskbar : 1;
|
||||
guint skip_pager : 1;
|
||||
|
||||
/* TRUE if client set these */
|
||||
guint wm_state_above : 1;
|
||||
guint wm_state_below : 1;
|
||||
|
||||
/* this flag tracks receipt of focus_in focus_out and
|
||||
* determines whether we draw the focus
|
||||
|
Loading…
Reference in New Issue
Block a user