diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/screen.c | 76 |
2 files changed, 68 insertions, 15 deletions
@@ -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 @@ -132,7 +137,7 @@ default. 2003-01-08 Havoc Pennington <hp@pobox.com> - + * src/metacity.schemas.in: assign Alt+F12 to shade window, per #102658 diff --git a/src/screen.c b/src/screen.c index 3dcefb5c..2f65aa90 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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,24 +2229,67 @@ meta_screen_apply_startup_properties (MetaScreen *screen, SnStartupSequence *sequence; startup_id = meta_window_get_startup_id (window); - if (startup_id == NULL) - return; + meta_topic (META_DEBUG_STARTUP, + "Applying startup props to %s id \"%s\"\n", + window->desc, + startup_id ? startup_id : "(none)"); + sequence = NULL; - tmp = screen->startup_sequences; - while (tmp != NULL) + if (startup_id == NULL) { - const char *id; + tmp = screen->startup_sequences; + while (tmp != NULL) + { + const char *wmclass; - id = sn_startup_sequence_get_id (tmp->data); + wmclass = sn_startup_sequence_get_wmclass (tmp->data); - if (strcmp (id, startup_id) == 0) - { - sequence = tmp->data; - break; + 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; } + } - tmp = tmp->next; + if (startup_id == NULL) + return; + + if (sequence == NULL) + { + tmp = screen->startup_sequences; + while (tmp != NULL) + { + const char *id; + + id = sn_startup_sequence_get_id (tmp->data); + + if (strcmp (id, startup_id) == 0) + { + sequence = tmp->data; + break; + } + + tmp = tmp->next; + } } if (sequence != NULL) |