From 191baa3c7650a1d68e077cfe2895d9a39f4ea4bb Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Sun, 29 Oct 2006 20:30:18 +0000 Subject: [PATCH] Fix strict focus mode by picking up on res_class. Fixes #361054, strict 2006-10-30 Dan Mick * src/window.c: (__window_is_terminal): Fix strict focus mode by picking up on res_class. Fixes #361054, strict focus mode still not working; should look for res_class, not res_name --- ChangeLog | 6 ++++++ src/window.c | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03f1a317a..cf657d804 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-30 Dan Mick + + * src/window.c: (__window_is_terminal): Fix strict focus + mode by picking up on res_class. Fixes #361054, strict focus + mode still not working; should look for res_class, not res_name + 2006-10-16 Elijah Newren * NEWS: 2.17.1 release. diff --git a/src/window.c b/src/window.c index 61170f48e..9cc6d0186 100644 --- a/src/window.c +++ b/src/window.c @@ -1750,32 +1750,37 @@ intervening_user_event_occurred (MetaWindow *window) gboolean __window_is_terminal (MetaWindow *window) { - if (window == NULL || window->res_name == NULL) + if (window == NULL || window->res_class == NULL) return FALSE; + /* + * Compare res_class, which is not user-settable, and thus theoretically + * a more-reliable indication of term-ness. + */ + /* gnome-terminal -- if you couldn't guess */ - if (strcmp (window->res_name, "gnome-terminal") == 0) + if (strcmp (window->res_class, "Gnome-terminal") == 0) return TRUE; /* xterm, rxvt, aterm */ - else if (strcmp (window->res_name, "XTerm") == 0) + else if (strcmp (window->res_class, "XTerm") == 0) return TRUE; /* konsole, KDE's terminal program */ - else if (strcmp (window->res_name, "Konsole") == 0) + else if (strcmp (window->res_class, "Konsole") == 0) return TRUE; /* rxvt-unicode */ - else if (strcmp (window->res_name, "URxvt") == 0) + else if (strcmp (window->res_class, "URxvt") == 0) return TRUE; /* eterm */ - else if (strcmp (window->res_name, "Eterm") == 0) + else if (strcmp (window->res_class, "Eterm") == 0) return TRUE; /* KTerm -- some terminal not KDE based; so not like Konsole */ - else if (strcmp (window->res_name, "KTerm") == 0) + else if (strcmp (window->res_class, "KTerm") == 0) return TRUE; /* Multi-gnome-terminal */ - else if (strcmp (window->res_name, "Multi-gnome-terminal") == 0) + else if (strcmp (window->res_class, "Multi-gnome-terminal") == 0) return TRUE; /* mlterm ("multi lingual terminal emulator on X") */ - else if (strcmp (window->res_name, "mlterm") == 0) + else if (strcmp (window->res_class, "mlterm") == 0) return TRUE; return FALSE;