1
0
Fork 0

delete (meta_window_new): add getting initial workspace to the batch

2002-11-21  Havoc Pennington  <hp@pobox.com>

	* src/window.c (update_initial_workspace): delete
	(meta_window_new): add getting initial workspace to the batch
	property get call

	* src/window-props.c (meta_display_init_window_prop_hooks): add
	net_wm_desktop and win_workspace support
This commit is contained in:
Havoc Pennington 2002-11-21 05:02:38 +00:00 committed by Havoc Pennington
parent 6557627d8f
commit 5452a0ecac
3 changed files with 71 additions and 43 deletions

View file

@ -1,3 +1,12 @@
2002-11-21 Havoc Pennington <hp@pobox.com>
* src/window.c (update_initial_workspace): delete
(meta_window_new): add getting initial workspace to the batch
property get call
* src/window-props.c (meta_display_init_window_prop_hooks): add
net_wm_desktop and win_workspace support
2002-11-20 Havoc Pennington <hp@pobox.com>
* src/window-props.c (set_icon_title): remove unused variable

View file

@ -329,6 +329,61 @@ reload_wm_icon_name (MetaWindow *window,
}
}
static void
init_net_wm_desktop (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_CARDINAL;
value->atom = display->atom_net_wm_desktop;
}
static void
reload_net_wm_desktop (MetaWindow *window,
MetaPropValue *value)
{
if (value->type != META_PROP_VALUE_INVALID)
{
window->initial_workspace_set = TRUE;
window->initial_workspace = value->v.cardinal;
meta_topic (META_DEBUG_PLACEMENT,
"Read initial workspace prop %d for %s\n",
window->initial_workspace, window->desc);
}
}
static void
init_win_workspace (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_CARDINAL;
value->atom = display->atom_win_workspace;
}
static void
reload_win_workspace (MetaWindow *window,
MetaPropValue *value)
{
if (value->type != META_PROP_VALUE_INVALID)
{
meta_topic (META_DEBUG_PLACEMENT,
"Read legacy GNOME workspace prop %d for %s\n",
(int) value->v.cardinal, window->desc);
if (window->initial_workspace_set)
{
meta_topic (META_DEBUG_PLACEMENT,
"Ignoring legacy GNOME workspace prop %d for %s as we already set initial workspace\n",
(int) value->v.cardinal, window->desc);
}
else
{
window->initial_workspace_set = TRUE;
window->initial_workspace = value->v.cardinal;
}
}
}
#define N_HOOKS 22
@ -436,13 +491,13 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
++i;
hooks[i].property = display->atom_net_wm_desktop;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
hooks[i].init_func = init_net_wm_desktop;
hooks[i].reload_func = reload_net_wm_desktop;
++i;
hooks[i].property = display->atom_win_workspace;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
hooks[i].init_func = init_win_workspace;
hooks[i].reload_func = reload_win_workspace;
++i;
hooks[i].property = display->atom_net_wm_strut;

View file

@ -83,7 +83,6 @@ static void update_transient_for (MetaWindow *window);
static void update_sm_hints (MetaWindow *window);
static void update_role (MetaWindow *window);
static void update_net_wm_type (MetaWindow *window);
static void update_initial_workspace (MetaWindow *window);
static void update_icon (MetaWindow *window);
static void redraw_icon (MetaWindow *window);
static void update_struts (MetaWindow *window);
@ -158,7 +157,7 @@ meta_window_new (MetaDisplay *display,
GSList *tmp;
MetaWorkspace *space;
gulong existing_wm_state;
#define N_INITIAL_PROPS 6
#define N_INITIAL_PROPS 8
Atom initial_props[N_INITIAL_PROPS];
int i;
@ -438,6 +437,8 @@ meta_window_new (MetaDisplay *display,
initial_props[i++] = XA_WM_NAME;
initial_props[i++] = display->atom_net_wm_icon_name;
initial_props[i++] = XA_WM_ICON_NAME;
initial_props[i++] = display->atom_net_wm_desktop;
initial_props[i++] = display->atom_win_workspace;
g_assert (N_INITIAL_PROPS == i);
meta_window_reload_properties (window, initial_props, N_INITIAL_PROPS);
@ -455,7 +456,6 @@ meta_window_new (MetaDisplay *display,
update_sm_hints (window); /* must come after transient_for */
update_role (window);
update_net_wm_type (window);
update_initial_workspace (window);
update_icon (window);
if (window->initially_iconic)
@ -4881,42 +4881,6 @@ update_net_wm_type (MetaWindow *window)
recalc_window_type (window);
}
static void
update_initial_workspace (MetaWindow *window)
{
gulong val = 0;
window->initial_workspace_set = FALSE;
/* Fall back to old WM spec hint if net_wm_desktop is missing, this
* is just to be nice when restarting from old Sawfish basically,
* should nuke it eventually
*/
if (meta_prop_get_cardinal (window->display,
window->xwindow,
window->display->atom_net_wm_desktop,
&val))
{
window->initial_workspace_set = TRUE;
window->initial_workspace = val;
meta_topic (META_DEBUG_PLACEMENT,
"Read initial workspace prop %d for %s\n",
window->initial_workspace, window->desc);
}
else if (meta_prop_get_cardinal (window->display,
window->xwindow,
window->display->atom_win_workspace,
&val))
{
window->initial_workspace_set = TRUE;
window->initial_workspace = val;
meta_topic (META_DEBUG_PLACEMENT,
"Read legacy GNOME workspace prop %d for %s\n",
window->initial_workspace, window->desc);
}
}
static void
update_icon (MetaWindow *window)
{