small code snippet to fix startup sequences that set legacy class/name

2003-01-08  Havoc Pennington  <hp@pobox.com>

	* src/screen.c (meta_screen_apply_startup_properties): small code
	snippet to fix startup sequences that set legacy class/name
This commit is contained in:
Havoc Pennington 2003-01-23 01:53:18 +00:00 committed by Havoc Pennington
parent e868a001f9
commit 5169a06dd0
2 changed files with 70 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2003-01-08 Havoc Pennington <hp@pobox.com>
* src/screen.c (meta_screen_apply_startup_properties): small code
snippet to fix startup sequences that set legacy class/name
2003-01-22 Havoc Pennington <hp@redhat.com>
* src/async-getprop.c (async_get_property_handler): do not read

View File

@ -2,7 +2,7 @@
/*
* Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
*
@ -2182,9 +2182,14 @@ meta_screen_sn_event (SnMonitorEvent *event,
{
case SN_MONITOR_EVENT_INITIATED:
{
const char *wmclass;
wmclass = sn_startup_sequence_get_wmclass (sequence);
meta_topic (META_DEBUG_STARTUP,
"Received startup initiated for %s\n",
sn_startup_sequence_get_id (sequence));
"Received startup initiated for %s wmclass %s\n",
sn_startup_sequence_get_id (sequence),
wmclass ? wmclass : "(unset)");
add_sequence (screen, sequence);
}
break;
@ -2224,10 +2229,52 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
SnStartupSequence *sequence;
startup_id = meta_window_get_startup_id (window);
meta_topic (META_DEBUG_STARTUP,
"Applying startup props to %s id \"%s\"\n",
window->desc,
startup_id ? startup_id : "(none)");
sequence = NULL;
if (startup_id == NULL)
{
tmp = screen->startup_sequences;
while (tmp != NULL)
{
const char *wmclass;
wmclass = sn_startup_sequence_get_wmclass (tmp->data);
if (wmclass != NULL &&
((window->res_class &&
strcmp (wmclass, window->res_class) == 0) ||
(window->res_name &&
strcmp (wmclass, window->res_name) == 0)))
{
sequence = tmp->data;
g_assert (window->startup_id == NULL);
window->startup_id = g_strdup (sn_startup_sequence_get_id (sequence));
startup_id = window->startup_id;
meta_topic (META_DEBUG_STARTUP,
"Ending legacy sequence %s due to window %s\n",
sn_startup_sequence_get_id (sequence),
window->desc);
sn_startup_sequence_complete (sequence);
break;
}
tmp = tmp->next;
}
}
if (startup_id == NULL)
return;
sequence = NULL;
if (sequence == NULL)
{
tmp = screen->startup_sequences;
while (tmp != NULL)
{
@ -2243,6 +2290,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
tmp = tmp->next;
}
}
if (sequence != NULL)
{