2017-03-20 12:03:45 +00:00
|
|
|
gdk_win32_sources = files([
|
2018-04-12 14:48:31 +00:00
|
|
|
'gdkcairocontext-win32.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkcursor-win32.c',
|
2018-03-24 16:27:11 +00:00
|
|
|
'gdkclipboard-win32.c',
|
|
|
|
'gdkclipdrop-win32.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkdevicemanager-win32.c',
|
|
|
|
'gdkdevice-virtual.c',
|
|
|
|
'gdkdevice-win32.c',
|
2021-07-02 08:53:16 +00:00
|
|
|
'gdkdevice-winpointer.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkdevice-wintab.c',
|
|
|
|
'gdkdisplay-win32.c',
|
|
|
|
'gdkdisplaymanager-win32.c',
|
2018-03-24 16:27:11 +00:00
|
|
|
'gdkdrag-win32.c',
|
|
|
|
'gdkdrop-win32.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkevents-win32.c',
|
|
|
|
'gdkglcontext-win32.c',
|
Split out WGL/EGL stuff and simplify things
This commit attempts to split GdkWin32GLContext into two parts, one for
WGL and the other for EGL (ANGLE), and attempts to simplify things a
bit, by:
* We are already creating a Win32 window to capture display changes,
so we can just use that to act as our dummy window that we use to
find out the pixel format that the system supports for WGL. We also
use it to obtain the dummy legacy WGL context that we will always
require to create our more advanced Core WGL contexts.
* Like what is done in X11, store up the WGL pixel format or the
EGLConfig in our GdkWin32Display.
* Ensure we do not create the dummy WGL context unnecessarily.
In this way, we can successfully create the WGL/EGL contexts, however
there are some issues at this point:
* For WGL, the code successfully initializes and realizes the WGL
Contexts, but for some reason things became invisible. When running
gtk4-demo, this can be verified by seeing the mouse cursor changing
when moved to spots where one can resize the window, although they
were invisible.
* For EGL, the code initializes EGL but could not realize the EGL
context as shaders failed to compile. It seems like the shader issue
is definitely outside the scope of this MR.
2021-07-14 09:46:31 +00:00
|
|
|
'gdkglcontext-win32-wgl.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkglobals-win32.c',
|
2018-03-24 16:27:11 +00:00
|
|
|
'gdkhdataoutputstream-win32.c',
|
2021-07-02 09:13:06 +00:00
|
|
|
'gdkinput-winpointer.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkkeys-win32.c',
|
GDK W32: Test for IME correctly
ImmIsIME() doesn't work (always returns TRUE) since Vista.
Use ITfActiveLanguageProfileNotifySink to detect TSF changes,
which are equal to IME changes for us.
Also make sure that IMMultiContext re-loads the IM when keyboard layout
changes, otherwise there's a subtle bug that could happen:
* Run GTK application with non-IME layout (US, for example)
* Focus on an editable widget (GtkEntry, for example)
* IM Context is initialized to use the simple IM
* Switch to an IME layout (such as Korean)
* Start typing
* Since IME module is not loaded yet, keypresses are handled
by a default MS IME handler
* Once IME commits a character, GDK will get a WM_KEYDOWN,
which will trigger a GdkKeyEvent, which will be handled by
an event filter in IM Context, which will finally re-evaluate
its status and load IME, and only after that GTK will get
to handle IME by itself - but by that point input would
already be broken.
To avoid this we can emit a dummy event (with Void keyval),
which will cause IM Context to load the appropriate module
immediately.
2019-03-22 15:10:02 +00:00
|
|
|
'gdkwin32langnotification.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
'gdkmain-win32.c',
|
|
|
|
'gdkmonitor-win32.c',
|
|
|
|
'gdkproperty-win32.c',
|
|
|
|
'gdkscreen-win32.c',
|
|
|
|
'gdkvulkancontext-win32.c',
|
|
|
|
'gdkwin32cursor.h',
|
|
|
|
'gdkwin32display.h',
|
|
|
|
'gdkwin32id.c',
|
2018-03-20 10:46:11 +00:00
|
|
|
'gdksurface-win32.c',
|
2017-03-20 12:03:45 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
gdk_win32_public_headers = files([
|
|
|
|
'gdkwin32cursor.h',
|
|
|
|
'gdkwin32display.h',
|
|
|
|
'gdkwin32displaymanager.h',
|
|
|
|
'gdkwin32dnd.h',
|
|
|
|
'gdkwin32glcontext.h',
|
|
|
|
'gdkwin32keys.h',
|
|
|
|
'gdkwin32misc.h',
|
|
|
|
'gdkwin32monitor.h',
|
|
|
|
'gdkwin32screen.h',
|
2018-03-20 10:46:11 +00:00
|
|
|
'gdkwin32surface.h',
|
2017-03-20 12:03:45 +00:00
|
|
|
])
|
|
|
|
|
2019-05-06 18:09:03 +00:00
|
|
|
install_headers(gdk_win32_public_headers, 'gdkwin32.h', subdir: 'gtk-4.0/gdk/win32/')
|
2017-03-20 12:03:45 +00:00
|
|
|
|
2018-06-22 07:02:24 +00:00
|
|
|
GDK_WIN32_EGL_CFLAGS = []
|
|
|
|
|
2021-10-05 02:14:57 +00:00
|
|
|
if have_egl
|
2018-06-22 07:02:24 +00:00
|
|
|
GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
|
Split out WGL/EGL stuff and simplify things
This commit attempts to split GdkWin32GLContext into two parts, one for
WGL and the other for EGL (ANGLE), and attempts to simplify things a
bit, by:
* We are already creating a Win32 window to capture display changes,
so we can just use that to act as our dummy window that we use to
find out the pixel format that the system supports for WGL. We also
use it to obtain the dummy legacy WGL context that we will always
require to create our more advanced Core WGL contexts.
* Like what is done in X11, store up the WGL pixel format or the
EGLConfig in our GdkWin32Display.
* Ensure we do not create the dummy WGL context unnecessarily.
In this way, we can successfully create the WGL/EGL contexts, however
there are some issues at this point:
* For WGL, the code successfully initializes and realizes the WGL
Contexts, but for some reason things became invisible. When running
gtk4-demo, this can be verified by seeing the mouse cursor changing
when moved to spots where one can resize the window, although they
were invisible.
* For EGL, the code initializes EGL but could not realize the EGL
context as shaders failed to compile. It seems like the shader issue
is definitely outside the scope of this MR.
2021-07-14 09:46:31 +00:00
|
|
|
gdk_win32_sources += ['gdkglcontext-win32-egl.c']
|
2018-06-22 07:02:24 +00:00
|
|
|
endif
|
|
|
|
|
2021-07-02 09:13:06 +00:00
|
|
|
gdk_win32_deps = [
|
|
|
|
pangowin32_dep, # FIXME
|
|
|
|
cc.find_library('hid'),
|
2017-03-20 12:03:45 +00:00
|
|
|
]
|
|
|
|
|
2017-03-30 23:15:08 +00:00
|
|
|
libgdk_win32 = static_library('gdk-win32',
|
2017-03-20 12:03:45 +00:00
|
|
|
gdk_win32_sources, gdkconfig, gdkenum_h,
|
2020-12-15 12:31:38 +00:00
|
|
|
include_directories: [ confinc, gdkinc ],
|
|
|
|
c_args: [
|
|
|
|
'-DGTK_COMPILATION',
|
|
|
|
'-DG_LOG_DOMAIN="Gdk"',
|
|
|
|
'-DINSIDE_GDK_WIN32',
|
2021-06-29 12:27:13 +00:00
|
|
|
'-D_WIN32_WINNT=0x0601',
|
|
|
|
'-DWINVER=0x0601',
|
2020-12-15 12:31:38 +00:00
|
|
|
] + GDK_WIN32_EGL_CFLAGS,
|
|
|
|
dependencies: [ gdk_deps, gdk_win32_deps ],
|
|
|
|
)
|