[gnome-panel] panel, libpanel-applet: use gdk_device_manager_get_client_pointer
- From: Philipp Kaluza <phk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel, libpanel-applet: use gdk_device_manager_get_client_pointer
- Date: Sun, 29 Sep 2013 10:41:46 +0000 (UTC)
commit d7d0efa55a26cce3f62b05610b80b37cfd61a8a3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Sep 28 18:56:48 2013 +0300
panel, libpanel-applet: use gdk_device_manager_get_client_pointer
to get device (not gtk_get_current_event_device)
gnome-panel/applet.c | 5 +++--
gnome-panel/panel-toplevel.c | 5 +++--
gnome-panel/panel-widget.c | 15 +++++++++------
libpanel-applet/panel-applet.c | 5 +++--
4 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index bdb5062..77cb9f9 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -557,7 +557,7 @@ panel_applet_position_menu (GtkMenu *menu,
{
GtkAllocation allocation;
GtkRequisition requisition;
- GdkModifierType modifier_mask;
+ GdkDevice *device;
GdkScreen *screen;
GtkWidget *parent;
int menu_x = 0;
@@ -574,7 +574,8 @@ 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);
- gdk_window_get_device_position(gtk_widget_get_window (applet), gtk_get_current_event_device (),
&pointer_x, &pointer_y, &modifier_mask);
+ 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/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 5cb5d69..b1b6f80 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -925,13 +925,14 @@ panel_toplevel_warp_pointer_increment (PanelToplevel *toplevel,
{
GdkScreen *screen;
GdkWindow *root_window;
- GdkModifierType modifier_mask;
+ 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_device_position(root_window, gtk_get_current_event_device (), &new_x, &new_y,
&modifier_mask);
+ 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-widget.c b/gnome-panel/panel-widget.c
index d8e10b5..b598779 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -1517,7 +1517,7 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
{
GtkWidget *widget;
GtkAllocation allocation;
- GdkModifierType modifier_mask;
+ GdkDevice *device;
int x,y;
int w,h;
@@ -1530,7 +1530,8 @@ panel_widget_is_cursor(PanelWidget *panel, int overlap)
!gtk_widget_get_visible(widget))
return FALSE;
- gdk_window_get_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device (), &x,
&y, &modifier_mask);
+ 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;
@@ -1903,11 +1904,12 @@ panel_widget_get_cursorloc (PanelWidget *panel)
{
int x, y;
gboolean rtl;
- GdkModifierType modifier_mask;
+ GdkDevice *device;
g_return_val_if_fail (PANEL_IS_WIDGET (panel), -1);
- gdk_window_get_device_position(gtk_widget_get_window (GTK_WIDGET (panel)),
gtk_get_current_event_device (), &x, &y, &modifier_mask);
+ 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)
@@ -2082,13 +2084,14 @@ move_timeout_handler(gpointer data)
if(panel->currently_dragged_applet && repeat_if_outside) {
GtkWidget *widget;
GtkAllocation allocation;
- GdkModifierType modifier_mask;
+ GdkDevice *device;
int x,y;
int w,h;
widget = panel->currently_dragged_applet->applet;
- gdk_window_get_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device
(), &x, &y, &modifier_mask);
+ 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 78e2e83..56f31f1 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -1130,7 +1130,7 @@ panel_applet_position_menu (GtkMenu *menu,
PanelApplet *applet;
GtkAllocation allocation;
GtkRequisition requisition;
- GdkModifierType modifier_mask;
+ GdkDevice *device;
GdkScreen *screen;
int menu_x = 0;
int menu_y = 0;
@@ -1148,7 +1148,8 @@ 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);
- gdk_window_get_device_position(gtk_widget_get_window (widget), gtk_get_current_event_device (),
&pointer_x, &pointer_y, &modifier_mask);
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]