1
Description: Force focus of the window when selected from the indicator
2
Bug: https://bugs.launchpad.net/bugs/442389
4
=== modified file 'libempathy-gtk/empathy-ui-utils.c'
5
Index: empathy-2.33.1/libempathy-gtk/empathy-ui-utils.c
6
===================================================================
7
--- empathy-2.33.1.orig/libempathy-gtk/empathy-ui-utils.c 2011-02-02 11:22:39.271459005 -0500
8
+++ empathy-2.33.1/libempathy-gtk/empathy-ui-utils.c 2011-02-02 11:22:49.651459020 -0500
13
+/* Really raise the window, even if the window manager doesn't agree */
15
+really_activate_window (GtkWindow *window)
21
+ g_return_if_fail (GTK_IS_WINDOW (window));
23
+ screen = GDK_SCREEN_XSCREEN (gtk_widget_get_screen (GTK_WIDGET (window)));
24
+ timestamp = GDK_CURRENT_TIME;
26
+ xev.xclient.type = ClientMessage;
27
+ xev.xclient.serial = 0;
28
+ xev.xclient.send_event = True;
29
+ xev.xclient.display = GDK_DISPLAY ();
30
+ xev.xclient.window = GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window);
31
+ xev.xclient.message_type = gdk_x11_get_xatom_by_name ("_NET_ACTIVE_WINDOW");
32
+ xev.xclient.format = 32;
33
+ xev.xclient.data.l[0] = 2; /* Pager client type */
34
+ xev.xclient.data.l[1] = timestamp;
35
+ xev.xclient.data.l[2] = 0;
36
+ xev.xclient.data.l[3] = 0;
37
+ xev.xclient.data.l[4] = 0;
39
+ gdk_error_trap_push ();
40
+ XSendEvent (GDK_DISPLAY (),
41
+ RootWindowOfScreen (screen),
43
+ SubstructureRedirectMask | SubstructureNotifyMask,
45
+ gdk_error_trap_pop ();
48
/* Takes care of moving the window to the current workspace. */
50
empathy_window_present_with_time (GtkWindow *window,
53
gtk_window_set_skip_taskbar_hint (window, FALSE);
54
gtk_window_deiconify (window);
55
+ really_activate_window (window);
59
Index: empathy-2.33.1/src/empathy-event-manager.c
60
===================================================================
61
--- empathy-2.33.1.orig/src/empathy-event-manager.c 2011-02-02 11:22:44.251459011 -0500
62
+++ empathy-2.33.1/src/empathy-event-manager.c 2011-02-02 11:22:49.651459020 -0500
64
#include <libempathy-gtk/empathy-images.h>
65
#include <libempathy-gtk/empathy-contact-dialogs.h>
66
#include <libempathy-gtk/empathy-sound.h>
67
+#include <libempathy-gtk/empathy-ui-utils.h>
69
#include <libido/idomessagedialog.h>
70
#include <libempathy-gtk/empathy-ui-utils.h>
73
if (event->approval->dialog != NULL)
75
- gtk_window_present (GTK_WINDOW (event->approval->dialog));
76
+ empathy_window_present (GTK_WINDOW (event->approval->dialog));