Mercurial > pidgin
changeset 21006:f43d7aafe1f8
Use gtk_window_set_focus_on_map() to prevent focus on new conversation windows (hopefully only) when the new window was prompted by an external event. This seems to work pretty well, but I suppose those with higher expectations of their WM will be sure to tell me if this messes something up. References #3618.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Wed, 24 Oct 2007 03:29:33 +0000 |
parents | fcce0bf2a279 |
children | d55617a15301 96dee745ce14 |
files | pidgin/gtkconv.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkconv.c Tue Oct 23 21:52:55 2007 +0000 +++ b/pidgin/gtkconv.c Wed Oct 24 03:29:33 2007 +0000 @@ -8828,6 +8828,9 @@ GtkPositionType pos; GtkWidget *testidea; GtkWidget *menubar; +#if GTK_CHECK_VERSION(2,6,0) + GdkModifierType state; +#endif win = g_malloc0(sizeof(PidginWindow)); @@ -8835,6 +8838,10 @@ /* Create the window. */ win->window = pidgin_create_window(NULL, 0, "conversation", TRUE); +#if GTK_CHECK_VERSION(2,6,0) + if (!gtk_get_current_event_state(&state)) + gtk_window_set_focus_on_map(GTK_WINDOW(win->window), FALSE); +#endif pidgin_conv_restore_position(win); if (available_list == NULL) { @@ -8907,7 +8914,8 @@ g_signal_connect(G_OBJECT(win->window), "show", G_CALLBACK(winpidgin_ensure_onscreen), win->window); - if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs")) + if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs") + && !gtk_get_current_event_state(&state)) gtk_window_iconify(GTK_WINDOW(win->window)); #endif