[gnome-panel] panel: fix deprecated warnings (part 1)
- From: Philipp Kaluza <phk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: fix deprecated warnings (part 1)
- Date: Wed, 25 Sep 2013 14:16:33 +0000 (UTC)
commit dde999b0ba9d444f5d97ff13179a585dfe1ee711
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Aug 16 23:17:21 2013 +0300
panel: fix deprecated warnings (part 1)
gnome-panel/applet.c | 3 +-
gnome-panel/libpanel-util/panel-icon-chooser.c | 2 +-
gnome-panel/panel-toplevel.c | 9 ++++---
gnome-panel/panel-util.c | 2 +-
gnome-panel/panel-widget.c | 29 +++++++++++++----------
libpanel-applet/panel-applet.c | 3 +-
6 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index a82b54a..bdb5062 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;
+ GdkModifierType modifier_mask;
GdkScreen *screen;
GtkWidget *parent;
int menu_x = 0;
@@ -573,7 +574,7 @@ 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);
+ gdk_window_get_device_position(gtk_widget_get_window (applet), gtk_get_current_event_device (),
&pointer_x, &pointer_y, &modifier_mask);
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 8cf91c7..ea94b6b 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -923,14 +923,15 @@ 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;
+ GdkModifierType modifier_mask;
+ 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);
+ gdk_window_get_device_position(root_window, gtk_get_current_event_device (), &new_x, &new_y,
&modifier_mask);
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 d640c27..8b27f69 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;
+ GdkModifierType modifier_mask;
+ int x,y;
+ int w,h;
g_return_val_if_fail(PANEL_IS_WIDGET(panel),FALSE);
@@ -1529,7 +1530,7 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
!gtk_widget_get_visible(widget))
return FALSE;
- gtk_widget_get_pointer(widget, &x, &y);
+ gdk_window_get_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device (), &x,
&y, &modifier_mask);
gtk_widget_get_allocation (widget, &allocation);
w = allocation.width;
@@ -1900,12 +1901,13 @@ panel_widget_applet_drag_end (PanelWidget *panel)
int
panel_widget_get_cursorloc (PanelWidget *panel)
{
- int x, y;
- gboolean rtl;
+ int x, y;
+ gboolean rtl;
+ GdkModifierType modifier_mask;
g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1);
- gtk_widget_get_pointer (GTK_WIDGET (panel), &x, &y);
+ gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET (panel)),
gtk_get_current_event_device (), &x, &y, &modifier_mask);
rtl = gtk_widget_get_direction (GTK_WIDGET (panel)) == GTK_TEXT_DIR_RTL;
if (panel->orient == GTK_ORIENTATION_HORIZONTAL)
@@ -2078,14 +2080,15 @@ 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;
+ GdkModifierType modifier_mask;
+ int x,y;
+ int w,h;
widget = panel->currently_dragged_applet->applet;
- gtk_widget_get_pointer(widget, &x, &y);
+ gdk_window_get_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device
(), &x, &y, &modifier_mask);
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..78e2e83 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;
+ GdkModifierType modifier_mask;
GdkScreen *screen;
int menu_x = 0;
int menu_y = 0;
@@ -1147,7 +1148,7 @@ panel_applet_position_menu (GtkMenu *menu,
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_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device (),
&pointer_x, &pointer_y, &modifier_mask);
gtk_widget_get_allocation (widget, &allocation);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]