Author: Alberts Muktupāvels Date: Fri Aug 16 23:17:21 2013 +0300 diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c index a82b54a..1a3a745 100644 --- a/gnome-panel/applet.c +++ b/gnome-panel/applet.c @@ -557,6 +557,7 @@ panel_applet_position_menu (GtkMenu *menu, { GtkAllocation allocation; GtkRequisition requisition; + GdkDevice *device; GdkScreen *screen; GtkWidget *parent; int menu_x = 0; @@ -573,7 +574,9 @@ panel_applet_position_menu (GtkMenu *menu, gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL); gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y); - gtk_widget_get_pointer (applet, &pointer_x, &pointer_y); + + device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (applet))); + gdk_window_get_device_position(gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL); gtk_widget_get_allocation (applet, &allocation); diff --git a/gnome-panel/libpanel-util/panel-icon-chooser.c b/gnome-panel/libpanel-util/panel-icon-chooser.c index d95120b..4f62032 100644 --- a/gnome-panel/libpanel-util/panel-icon-chooser.c +++ b/gnome-panel/libpanel-util/panel-icon-chooser.c @@ -425,7 +425,7 @@ _panel_icon_chooser_clicked (GtkButton *button) if (info) { path = g_strdup (gtk_icon_info_get_filename (info)); - gtk_icon_info_free (info); + g_object_unref (info); } } diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c index 00edf96..e4e3613 100644 --- a/gnome-panel/panel-toplevel.c +++ b/gnome-panel/panel-toplevel.c @@ -923,14 +923,16 @@ panel_toplevel_warp_pointer_increment (PanelToplevel *toplevel, int keyval, int increment) { - GdkScreen *screen; - GdkWindow *root_window; - int new_x, new_y; + GdkScreen *screen; + GdkWindow *root_window; + GdkDevice *device; + int new_x, new_y; screen = gtk_window_get_screen (GTK_WINDOW (toplevel)); root_window = gdk_screen_get_root_window (screen); - gdk_window_get_pointer (root_window, &new_x, &new_y, NULL); + device = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gtk_widget_get_display(GTK_WIDGET(toplevel)))); + gdk_window_get_device_position(root_window, device, &new_x, &new_y, NULL); switch (keyval) { case GDK_KEY_Up: diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c index 1172af4..eb591c1 100644 --- a/gnome-panel/panel-util.c +++ b/gnome-panel/panel-util.c @@ -287,7 +287,7 @@ panel_find_icon (GtkIconTheme *icon_theme, if (info) { retval = g_strdup (gtk_icon_info_get_filename (info)); - gtk_icon_info_free (info); + g_object_unref (info); } else retval = NULL; diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c index 7f6f86a..b4d9fc2 100644 --- a/gnome-panel/panel-widget.c +++ b/gnome-panel/panel-widget.c @@ -1515,10 +1515,11 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation) gboolean panel_widget_is_cursor(PanelWidget *panel, int overlap) { - GtkWidget *widget; - GtkAllocation allocation; - int x,y; - int w,h; + GtkWidget *widget; + GtkAllocation allocation; + GdkDevice *device; + int x,y; + int w,h; g_return_val_if_fail(PANEL_IS_WIDGET(panel),FALSE); @@ -1529,7 +1530,8 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap) !gtk_widget_get_visible(widget)) return FALSE; - gtk_widget_get_pointer(widget, &x, &y); + device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget))); + gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL); gtk_widget_get_allocation (widget, &allocation); w = allocation.width; @@ -1900,12 +1902,15 @@ panel_widget_applet_drag_end (PanelWidget *panel) int panel_widget_get_cursorloc (PanelWidget *panel) { - int x, y; - gboolean rtl; + int x, y; + gboolean rtl; + GdkDevice *device; g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1); - gtk_widget_get_pointer (GTK_WIDGET (panel), &x, &y); + device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (panel)))); + gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET (panel)), device, &x, &y, NULL); + rtl = gtk_widget_get_direction (GTK_WIDGET (panel)) == GTK_TEXT_DIR_RTL; if (panel->orient == GTK_ORIENTATION_HORIZONTAL) @@ -2078,14 +2083,16 @@ move_timeout_handler(gpointer data) been_moved = FALSE; if(panel->currently_dragged_applet && repeat_if_outside) { - GtkWidget *widget; - GtkAllocation allocation; - int x,y; - int w,h; + GtkWidget *widget; + GtkAllocation allocation; + GdkDevice *device; + int x,y; + int w,h; widget = panel->currently_dragged_applet->applet; - gtk_widget_get_pointer(widget, &x, &y); + device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget))); + gdk_window_get_device_position(gtk_widget_get_window (widget), device, &x, &y, NULL); gtk_widget_get_allocation (widget, &allocation); w = allocation.width; diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c index 806d427..2e60676 100644 --- a/libpanel-applet/panel-applet.c +++ b/libpanel-applet/panel-applet.c @@ -1130,6 +1130,7 @@ panel_applet_position_menu (GtkMenu *menu, PanelApplet *applet; GtkAllocation allocation; GtkRequisition requisition; + GdkDevice *device; GdkScreen *screen; int menu_x = 0; int menu_y = 0; @@ -1145,9 +1146,10 @@ panel_applet_position_menu (GtkMenu *menu, gtk_menu_set_screen(menu, screen); gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL); - gdk_window_get_origin (gtk_widget_get_window (widget), - &menu_x, &menu_y); - gtk_widget_get_pointer (widget, &pointer_x, &pointer_y); + gdk_window_get_origin (gtk_widget_get_window (widget), &menu_x, &menu_y); + + device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (gtk_widget_get_display (widget))); + gdk_window_get_device_position(gtk_widget_get_window (widget), device, &pointer_x, &pointer_y, NULL); gtk_widget_get_allocation (widget, &allocation);