GDK: Make sure W32 backend compiles without GdkDeviceManager

https://bugzilla.gnome.org/show_bug.cgi?id=773299
This commit is contained in:
Руслан Ижбулатов 2017-11-30 05:38:20 +00:00
parent 645e67231e
commit c7bdf643c5
7 changed files with 16 additions and 22 deletions

View File

@ -7,7 +7,6 @@ private_headers = [
'gdk-private.h',
'gdkapplaunchcontextprivate.h',
'gdkcursorprivate.h',
'gdkdevicemanagerprivate.h',
'gdkdeviceprivate.h',
'gdkdisplaymanagerprivate.h',
'gdkdisplayprivate.h',

View File

@ -71,7 +71,7 @@ static gboolean default_display_opened = FALSE;
G_DEFINE_TYPE (GdkDeviceManagerWin32, gdk_device_manager_win32, G_TYPE_OBJECT)
static GdkDevice *
create_pointer (GdkDeviceManager *device_manager,
create_pointer (GdkDeviceManagerWin32 *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
@ -83,12 +83,11 @@ create_pointer (GdkDeviceManager *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"display", _gdk_display,
"device-manager", device_manager,
NULL);
}
static GdkDevice *
create_keyboard (GdkDeviceManager *device_manager,
create_keyboard (GdkDeviceManagerWin32 *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
@ -100,7 +99,6 @@ create_keyboard (GdkDeviceManager *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", _gdk_display,
"device-manager", device_manager,
NULL);
}
@ -352,7 +350,7 @@ print_cursor (int index)
static void
wintab_init_check (GdkDeviceManagerWin32 *device_manager)
{
GdkDisplay *display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager));
GdkDisplay *display = device_manager->display;
static gboolean wintab_initialized = FALSE;
GdkDeviceWintab *device;
WORD specversion;
@ -564,7 +562,6 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
"input-mode", GDK_MODE_SCREEN,
"has-cursor", lc.lcOptions & CXO_SYSTEM,
"display", display,
"device-manager", device_manager,
NULL);
device->sends_core = lc.lcOptions & CXO_SYSTEM;
@ -701,12 +698,12 @@ gdk_device_manager_win32_constructed (GObject *object)
device_manager = GDK_DEVICE_MANAGER_WIN32 (object);
device_manager->core_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
create_pointer (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Pointer",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
create_pointer (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Pointer",
GDK_DEVICE_TYPE_SLAVE);
@ -716,12 +713,12 @@ gdk_device_manager_win32_constructed (GObject *object)
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
device_manager->core_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
create_keyboard (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Keyboard",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
create_keyboard (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Keyboard",
GDK_DEVICE_TYPE_SLAVE);
@ -757,7 +754,6 @@ gdk_device_manager_win32_constructed (GObject *object)
static void
gdk_device_manager_win32_class_init (GdkDeviceManagerWin32Class *klass)
{
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_device_manager_win32_finalize;

View File

@ -18,8 +18,6 @@
#ifndef __GDK_DEVICE_MANAGER_WIN32_H__
#define __GDK_DEVICE_MANAGER_WIN32_H__
#include <gdk/gdkdevicemanagerprivate.h>
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE_MANAGER_WIN32 (gdk_device_manager_win32_get_type ())

View File

@ -447,8 +447,8 @@ _gdk_win32_display_open (const gchar *display_name)
_gdk_input_ignore_core = FALSE;
_gdk_device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32,
"display", _gdk_display,
NULL);
_gdk_device_manager->display = _gdk_display;
_gdk_dnd_init ();

View File

@ -179,7 +179,7 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
}
static void
generate_focus_event (GdkDeviceManager *device_manager,
generate_focus_event (GdkDeviceManagerWin32 *device_manager,
GdkWindow *window,
gboolean in)
{
@ -201,7 +201,7 @@ generate_focus_event (GdkDeviceManager *device_manager,
}
static void
generate_grab_broken_event (GdkDeviceManager *device_manager,
generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager,
GdkWindow *window,
gboolean keyboard,
GdkWindow *grab_window)
@ -1107,7 +1107,7 @@ send_crossing_event (GdkDisplay *display,
POINT pt;
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager);_gdk_device_manager);
device_manager = _gdk_device_manager;
grab = _gdk_display_has_device_grab (display, device_manager->core_pointer, 0);
@ -3009,7 +3009,7 @@ gdk_event_translate (MSG *msg,
if (keyboard_grab != NULL &&
!GDK_WINDOW_DESTROYED (keyboard_grab->window))
{
generate_grab_broken_event (device_manager, keyboard_grab->window, TRUE, NULL);
generate_grab_broken_event (_gdk_device_manager, keyboard_grab->window, TRUE, NULL);
}
/* fallthrough */
@ -3024,7 +3024,7 @@ gdk_event_translate (MSG *msg,
if (GDK_WINDOW_DESTROYED (window))
break;
generate_focus_event (device_manager, window, (msg->message == WM_SETFOCUS));
generate_focus_event (_gdk_device_manager, window, (msg->message == WM_SETFOCUS));
return_val = TRUE;
break;

View File

@ -28,7 +28,7 @@
#include "gdkprivate-win32.h"
GdkDisplay *_gdk_display = NULL;
GdkDeviceManager *_gdk_device_manager = NULL;
GdkDeviceManagerWin32 *_gdk_device_manager = NULL;
gint _gdk_offset_x, _gdk_offset_y;

View File

@ -39,6 +39,7 @@
#include <gdk/win32/gdkwin32display.h>
#include <gdk/win32/gdkwin32screen.h>
#include <gdk/win32/gdkwin32keys.h>
#include <gdk/win32/gdkdevicemanager-win32.h>
#include "gdkinternals.h"
@ -259,7 +260,7 @@ extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM)
extern GdkDisplay *_gdk_display;
extern GdkDeviceManager *_gdk_device_manager;
extern GdkDeviceManagerWin32 *_gdk_device_manager;
/* Offsets to add to Windows coordinates (which are relative to the
* primary monitor's origin, and thus might be negative for monitors