[gthumb] removed use of gdk_window_get_pointer
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] removed use of gdk_window_get_pointer
- Date: Tue, 6 Mar 2012 15:28:50 +0000 (UTC)
commit 1356e815635321efb31051c70da4743add843be0
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Mar 6 14:38:18 2012 +0100
removed use of gdk_window_get_pointer
gthumb/gth-browser.c | 34 ++++++++++++++++++++++++++--------
gthumb/gth-image-navigator.c | 6 +++++-
2 files changed, 31 insertions(+), 9 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index a559d9b..f80d9a1 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -6098,14 +6098,25 @@ _gth_browser_create_fullscreen_toolbar (GthBrowser *browser)
}
+typedef struct {
+ GthBrowser *browser;
+ GdkDevice *device;
+} HideMouseData;
+
+
static gboolean
hide_mouse_pointer_cb (gpointer data)
{
- GthBrowser *browser = data;
- int px, py;
- GList *scan;
+ HideMouseData *hmdata = data;
+ GthBrowser *browser = hmdata->browser;
+ int px, py;
+ GList *scan;
- gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (browser)), &px, &py, 0);
+ gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (browser)),
+ hmdata->device,
+ &px,
+ &py,
+ 0);
for (scan = browser->priv->fullscreen_controls; scan; scan = scan->next) {
GtkWidget *widget = scan->data;
int x, y, w, h;
@@ -6133,7 +6144,8 @@ fullscreen_motion_notify_event_cb (GtkWidget *widget,
GdkEventMotion *event,
gpointer data)
{
- GthBrowser *browser = data;
+ GthBrowser *browser = data;
+ HideMouseData *hmdata;
if (browser->priv->last_mouse_x == 0.0)
browser->priv->last_mouse_x = event->x;
@@ -6160,9 +6172,15 @@ fullscreen_motion_notify_event_cb (GtkWidget *widget,
if (browser->priv->hide_mouse_timeout != 0)
g_source_remove (browser->priv->hide_mouse_timeout);
- browser->priv->hide_mouse_timeout = g_timeout_add (HIDE_MOUSE_DELAY,
- hide_mouse_pointer_cb,
- browser);
+
+ hmdata = g_new0 (HideMouseData, 1);
+ hmdata->browser = browser;
+ hmdata->device = event->device;
+ browser->priv->hide_mouse_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
+ HIDE_MOUSE_DELAY,
+ hide_mouse_pointer_cb,
+ hmdata,
+ g_free);
browser->priv->last_mouse_x = event->x;
browser->priv->last_mouse_y = event->y;
diff --git a/gthumb/gth-image-navigator.c b/gthumb/gth-image-navigator.c
index b8848c1..5bb2780 100644
--- a/gthumb/gth-image-navigator.c
+++ b/gthumb/gth-image-navigator.c
@@ -448,7 +448,11 @@ popup_window_event_cb (GtkWidget *widget,
return TRUE;
case GDK_MOTION_NOTIFY:
- gdk_window_get_pointer (gtk_widget_get_window (widget), &mx, &my, &mask);
+ gdk_window_get_device_position (gtk_widget_get_window (widget),
+ gdk_event_get_device (event),
+ &mx,
+ &my,
+ &mask);
get_visible_area_origin_as_double (nav_popup, mx, my, &x, &y);
nav_popup->visible_area.x = (int) x;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]