win32: Stop using _gdk_display global in device code

Use gdk_device_get_display() instead.
This commit is contained in:
Benjamin Otte 2016-02-06 05:46:09 +01:00 committed by Benjamin Otte
parent ccbfa64d67
commit 76e56c5038
5 changed files with 22 additions and 21 deletions

View File

@ -148,7 +148,7 @@ gdk_device_virtual_set_window_cursor (GdkDevice *device,
parent_window = parent_window->parent;
}
else
replacement_cursor = _gdk_win32_display_get_cursor_for_type (_gdk_display, GDK_LEFT_PTR);
replacement_cursor = _gdk_win32_display_get_cursor_for_type (gdk_device_get_display (device), GDK_LEFT_PTR);
}
SetCursor (GDK_WIN32_CURSOR (replacement_cursor)->hcursor);

View File

@ -80,7 +80,7 @@ create_pointer (GdkDeviceManager *device_manager,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"display", _gdk_display,
"display", gdk_device_manager_get_display (device_manager),
"device-manager", device_manager,
NULL);
}
@ -97,7 +97,7 @@ create_keyboard (GdkDeviceManager *device_manager,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", _gdk_display,
"display", gdk_device_manager_get_display (device_manager),
"device-manager", device_manager,
NULL);
}
@ -575,7 +575,7 @@ _gdk_input_wintab_init_check (GdkDeviceManager *_device_manager)
"input-source", GDK_SOURCE_PEN,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", lc.lcOptions & CXO_SYSTEM,
"display", _gdk_display,
"display", display,
"device-manager", device_manager,
NULL);
@ -877,9 +877,10 @@ gdk_device_manager_find_wintab_device (GdkDeviceManagerWin32 *device_manager,
}
gboolean
_gdk_input_other_event (GdkEvent *event,
MSG *msg,
GdkWindow *window)
gdk_input_other_event (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window)
{
GdkDeviceManagerWin32 *device_manager;
GdkDeviceWintab *source_device = NULL;
@ -900,12 +901,12 @@ _gdk_input_other_event (GdkEvent *event,
if (event->any.window != wintab_window)
{
g_warning ("_gdk_input_other_event: not wintab_window?");
g_warning ("gdk_input_other_event: not wintab_window?");
return FALSE;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display));
G_GNUC_END_IGNORE_DEPRECATIONS;
window = gdk_device_get_window_at_position (device_manager->core_pointer, &x, &y);
if (window == NULL)
@ -914,7 +915,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
g_object_ref (window);
GDK_NOTE (EVENTS_OR_INPUT,
g_print ("_gdk_input_other_event: window=%p %+d%+d\n",
g_print ("gdk_input_other_event: window=%p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y));
if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE)
@ -943,7 +944,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
if (gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
return FALSE;
last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (source_device));
last_grab = _gdk_display_get_last_device_grab (display, GDK_DEVICE (source_device));
if (last_grab && last_grab->window)
{

View File

@ -52,9 +52,10 @@ struct _GdkDeviceManagerWin32Class
GType gdk_device_manager_win32_get_type (void) G_GNUC_CONST;
void _gdk_input_set_tablet_active (void);
gboolean _gdk_input_other_event (GdkEvent *event,
MSG *msg,
GdkWindow *window);
gboolean gdk_input_other_event (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window);
G_END_DECLS

View File

@ -3401,7 +3401,7 @@ gdk_event_translate (MSG *msg,
event->any.window = window;
g_object_ref (window);
if (_gdk_input_other_event (event, msg, window))
if (gdk_input_other_event (_gdk_display, event, msg, window))
_gdk_win32_append_event (event);
else
gdk_event_free (event);

View File

@ -118,7 +118,7 @@ init_version (GtkInspectorGeneral *gen)
gtk_label_set_text (GTK_LABEL (gen->priv->gdk_backend), backend);
}
static void
static G_GNUC_UNUSED void
append_extension_row (GtkInspectorGeneral *gen,
const gchar *ext,
gboolean have_ext)
@ -169,16 +169,13 @@ append_egl_extension_row (GtkInspectorGeneral *gen,
static void
init_gl (GtkInspectorGeneral *gen)
{
GdkDisplay *display;
gchar *version;
display = gdk_display_get_default ();
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
GdkDisplay *display = gdk_display_get_default ();
Display *dpy = GDK_DISPLAY_XDISPLAY (display);
int error_base, event_base;
gchar *version;
if (!glXQueryExtension (dpy, &error_base, &event_base))
return;
@ -202,8 +199,10 @@ init_gl (GtkInspectorGeneral *gen)
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (display))
{
GdkDisplay *display = gdk_display_get_default ();
EGLDisplay *dpy;
EGLint major, minor;
gchar *version;
dpy = eglGetDisplay ((EGLNativeDisplayType)gdk_wayland_display_get_wl_display (display));