#include "config.h"
+#include <math.h>
+
#include "gdkdeviceprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkinternals.h"
*y = tmp_y;
}
+static GdkWindow *
+gdk_display_real_get_window_at_device_position (GdkDisplay *display,
+ GdkDevice *device,
+ gint *win_x,
+ gint *win_y)
+{
+ GdkWindow *window;
+ gint x, y;
+
+ window = _gdk_device_window_at_position (device, &x, &y, NULL, FALSE);
+
+ /* This might need corrections, as the native window returned
+ may contain client side children */
+ if (window)
+ {
+ double xx, yy;
+
+ window = _gdk_window_find_descendant_at (window,
+ x, y,
+ &xx, &yy);
+ x = floor (xx + 0.5);
+ y = floor (yy + 0.5);
+ }
+
+ *win_x = x;
+ *win_y = y;
+
+ return window;
+}
+
/**
* gdk_device_get_window_at_position:
* @device: pointer #GdkDevice to query info to.
display = gdk_device_get_display (device);
- window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y);
+ window = gdk_display_real_get_window_at_device_position (display, device, &tmp_x, &tmp_y);
if (win_x)
*win_x = tmp_x;
#include "gdkscreen.h"
#include <glib.h>
-#include <math.h>
/**
static void gdk_display_finalize (GObject *object);
-static GdkWindow *gdk_display_real_get_window_at_device_position (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y);
static GdkAppLaunchContext *gdk_display_real_get_app_launch_context (GdkDisplay *display);
static guint signals[LAST_SIGNAL] = { 0 };
-static const GdkDisplayDeviceHooks default_device_hooks = {
- gdk_display_real_get_window_at_device_position
-};
-
G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
static void
display->double_click_time = 250;
display->double_click_distance = 5;
- display->device_hooks = &default_device_hooks;
-
display->device_grabs = g_hash_table_new (NULL, NULL);
display->motion_hint_info = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_free);
*mask = tmp_mask;
}
-static GdkWindow *
-gdk_display_real_get_window_at_device_position (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y)
-{
- GdkWindow *window;
- gint x, y;
-
- window = _gdk_device_window_at_position (device, &x, &y, NULL, FALSE);
-
- /* This might need corrections, as the native window returned
- may contain client side children */
- if (window)
- {
- double xx, yy;
-
- window = _gdk_window_find_descendant_at (window,
- x, y,
- &xx, &yy);
- x = floor (xx + 0.5);
- y = floor (yy + 0.5);
- }
-
- *win_x = x;
- *win_y = y;
-
- return window;
-}
-
/**
* gdk_display_get_window_at_pointer:
* @display: a #GdkDisplay
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
-typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
-
-struct _GdkDisplayDeviceHooks
-{
- GdkWindow * (* window_at_device_position) (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y);
-};
-
typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the keyboard grab on this display */
guint double_click_time; /* Maximum time between clicks in msecs */
GdkDevice *core_pointer; /* Core pointer device */
- const GdkDisplayDeviceHooks *device_hooks; /* Hooks for querying pointer */
-
guint closed : 1; /* Whether this display has been closed */
guint ignore_core_events : 1; /* Don't send core motion and button event */