diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2013-06-20 15:25:33 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2013-06-20 15:25:33 -0300 |
commit | cebf33d7109e0157a80f34d6136e212f0a28d274 (patch) | |
tree | a6464302c970f72581105b50ff0896e1f56def3d /community/pidgin-libnotify/pidgin-libnotify-getfocus.patch | |
parent | 1a65caeb80e2cc8c7b39262d72255124d0c8614e (diff) | |
parent | 5cb95ceee39e4691f768ea2fef60b8a106e92209 (diff) |
Merge branch 'master' of gparabola:abslibre-mips64el
Diffstat (limited to 'community/pidgin-libnotify/pidgin-libnotify-getfocus.patch')
-rw-r--r-- | community/pidgin-libnotify/pidgin-libnotify-getfocus.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/community/pidgin-libnotify/pidgin-libnotify-getfocus.patch b/community/pidgin-libnotify/pidgin-libnotify-getfocus.patch new file mode 100644 index 000000000..db45829d9 --- /dev/null +++ b/community/pidgin-libnotify/pidgin-libnotify-getfocus.patch @@ -0,0 +1,69 @@ +--- src/pidgin-libnotify.c 2013-05-07 17:38:31.397261982 +0200 ++++ src2/pidgin-libnotify.c 2013-05-07 17:43:43.787904584 +0200 +@@ -169,6 +169,49 @@ pixbuf_from_buddy_icon (PurpleBuddyIcon + return icon; + } + ++/* Taken from pidgin-hotkeys to get focus on conversation window */ ++static void ++hacky_active_window(GtkWidget *window) ++{ ++ GdkScreen *screen; ++ GdkWindow *root; ++ GdkDisplay *display; ++ Display *xdisplay; ++ Window xroot; ++ XEvent xev; ++ static Atom _net_active_window = None; ++ ++ screen = gtk_widget_get_screen(window); ++ root = gdk_screen_get_root_window(screen); ++ display = gdk_screen_get_display(screen); ++ ++ xdisplay = GDK_DISPLAY_XDISPLAY(display); ++ xroot = GDK_WINDOW_XWINDOW(root); ++ ++ if (_net_active_window == None) ++ _net_active_window = XInternAtom(xdisplay, ++ "_NET_ACTIVE_WINDOW", ++ False); ++ ++ xev.xclient.type = ClientMessage; ++ xev.xclient.serial = 0; ++ xev.xclient.send_event = True; ++ xev.xclient.window = GDK_WINDOW_XWINDOW(window->window); ++ xev.xclient.message_type = _net_active_window; ++ xev.xclient.format = 32; ++ xev.xclient.data.l[0] = 1; /* requestor type; we're an app, I guess */ ++ xev.xclient.data.l[1] = CurrentTime; ++ xev.xclient.data.l[2] = None; /* "currently active window", supposedly */ ++ xev.xclient.data.l[3] = 0; ++ xev.xclient.data.l[4] = 0; ++ ++ XSendEvent(xdisplay, ++ xroot, False, ++ SubstructureRedirectMask | SubstructureNotifyMask, ++ &xev); ++} ++ ++ + static void + action_cb (NotifyNotification *notification, + gchar *action, gpointer user_data) +@@ -194,6 +237,16 @@ action_cb (NotifyNotification *notificat + buddy->name); + } + conv->ui_ops->present (conv); ++ ++ /* get the focus on the new conversation window */ ++ { ++ GtkWindow *gtkwindow; ++ ++ gtkwindow = GTK_WINDOW(pidgin_conv_get_window(PIDGIN_CONVERSATION(conv))->window); ++ /*gtk_window_present(gtkwindow);*/ ++ hacky_active_window(GTK_WIDGET(gtkwindow)); ++ } ++ + + notify_notification_close (notification, NULL); + } |