# HG changeset patch # User Daniel Atallah # Date 1193196573 0 # Node ID f43d7aafe1f81ba7035591f5618de1f24081890e # Parent fcce0bf2a279d4e6d52a3e11a6b3d872721f55ce 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. diff -r fcce0bf2a279 -r f43d7aafe1f8 pidgin/gtkconv.c --- 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