/pidgin/main: ab309f382135: Remove deprecated call to gdk_window...
Elliott Sales de Andrade
qulogic at pidgin.im
Thu Aug 16 02:29:04 EDT 2012
Changeset: ab309f3821351d7d922a2ccc2df823afc860d53c
Author: Elliott Sales de Andrade <qulogic at pidgin.im>
Date: 2012-08-15 21:40 -0400
Branch: default
URL: http://hg.pidgin.im/pidgin/main/rev/ab309f382135
Description:
Remove deprecated call to gdk_window_at_pointer.
As it turns out, I don't think this function did what it seems to
suggest from its name. The original function called gdk_window_at_pointer
with the input x and y, but that function *returns* x and y. Hence, the
input location was never really used.
diffstat:
pidgin/gtkconv.c | 14 ++++++++++----
pidgin/gtkconvwin.h | 2 +-
pidgin/plugins/perl/common/GtkConvWin.xs | 5 -----
3 files changed, 11 insertions(+), 10 deletions(-)
diffs (70 lines):
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -9100,7 +9100,7 @@ notebook_motion_cb(GtkWidget *widget, Gd
gboolean to_right = FALSE;
/* Get the window that the cursor is over. */
- dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root);
+ dest_win = pidgin_conv_window_get_at_event((GdkEvent *)e);
if (dest_win == NULL) {
dnd_hints_hide_all();
@@ -9396,7 +9396,7 @@ notebook_release_cb(GtkWidget *widget, G
dnd_hints_hide_all();
- dest_win = pidgin_conv_window_get_at_xy(e->x_root, e->y_root);
+ dest_win = pidgin_conv_window_get_at_event((GdkEvent *)e);
conv = pidgin_conv_window_get_active_conversation(win);
@@ -10401,13 +10401,19 @@ pidgin_conv_window_has_focus(PidginWindo
}
PidginWindow *
-pidgin_conv_window_get_at_xy(int x, int y)
+pidgin_conv_window_get_at_event(GdkEvent *event)
{
PidginWindow *win;
GdkWindow *gdkwin;
GList *l;
-
+ int x, y;
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gdkwin = gdk_device_get_window_at_position(gdk_event_get_device(event),
+ &x, &y);
+#else
gdkwin = gdk_window_at_pointer(&x, &y);
+#endif
if (gdkwin)
gdkwin = gdk_window_get_toplevel(gdkwin);
diff --git a/pidgin/gtkconvwin.h b/pidgin/gtkconvwin.h
--- a/pidgin/gtkconvwin.h
+++ b/pidgin/gtkconvwin.h
@@ -119,7 +119,7 @@ PidginConversation *pidgin_conv_window_g
PurpleConversation *pidgin_conv_window_get_active_conversation(const PidginWindow *win);
gboolean pidgin_conv_window_is_active_conversation(const PurpleConversation *conv);
gboolean pidgin_conv_window_has_focus(PidginWindow *win);
-PidginWindow *pidgin_conv_window_get_at_xy(int x, int y);
+PidginWindow *pidgin_conv_window_get_at_event(GdkEvent *event);
GList *pidgin_conv_window_get_gtkconvs(PidginWindow *win);
guint pidgin_conv_window_get_gtkconv_count(PidginWindow *win);
diff --git a/pidgin/plugins/perl/common/GtkConvWin.xs b/pidgin/plugins/perl/common/GtkConvWin.xs
--- a/pidgin/plugins/perl/common/GtkConvWin.xs
+++ b/pidgin/plugins/perl/common/GtkConvWin.xs
@@ -59,11 +59,6 @@ gboolean
pidgin_conv_window_has_focus(win)
Pidgin::Conversation::Window win
-Pidgin::Conversation::Window
-pidgin_conv_window_get_at_xy(x, y)
- int x
- int y
-
void
pidgin_conv_window_get_gtkconvs(win)
Pidgin::Conversation::Window win
More information about the Commits
mailing list