Commit Graph

52547 Commits

Author SHA1 Message Date
Philip Zander
8b1c334c4a gdkkeys-win32: Fix crash when keyboard DLL failed to load
DLL loading failures should not happen under normal circumstances, but
we should at least try not to crash and and print better diagnostic
messages if they do happen.

See #4610
2022-01-09 12:36:47 +01:00
Philip Zander
404229ad75 gdkkeys-win32: Add keysym mapping for capslock key
Add missing mapping between VK_CAPITAL and GDK_KEY_Caps_Lock, so
applications get a meaningful keyval rather than ffffff.
2022-01-09 12:36:47 +01:00
Philip Zander
acf5db32f1 gdkkeys-win32: Fix capslock handling
Previously, we treated CapsLock and KanaLock as part of the global
keyboard state, much like NumLock and ScrollLock, rather than using
the supplied modifier mask. This was because GDK does not have a
modifier mask for KanaLock, only for CapsLock, so it would not have been
possible to properly support it.

However, this approach ended up causing problems, with certain keyboard
shortcuts not registering when capslock was active. This was first
observed in Inkscape [0] and appears to affect shortcuts consisting of a
single key (like 'a') with no additional modifiers (wheareas shortcuts
like 'ctrl+a' work).

So now we are using the supplied GDK_LOCK_MASK instead, and dropped
support for KanaLock, which we probably don't need anyway (since regular
text input should be handled by the IME input module -- the keymap is
mainly for shortcuts and keybindings, where you don't really want
KanaLock).

[0] https://gitlab.com/inkscape/inkscape/-/issues/3082
2022-01-09 12:36:32 +01:00
Luca Bacci
99c7cb11e5 Merge branch 'fix-4610' into 'gtk-3-24'
gdkkeys-win32: Fix uninitialized value (#4610)

See merge request GNOME/gtk!4355
2022-01-07 20:53:28 +00:00
Luca Bacci
ed67e424f2 Merge branch 'win32-theme-flat-button-fix' into 'gtk-3-24'
GTK WIn32 theme - make buttons with .flat class appear flat and buttons in toolbar non-flat if they don't have said class

See merge request GNOME/gtk!4350
2022-01-07 19:58:47 +00:00
Philip Zander
f81da43b00 gdkkeys-win32: Fix uninitialized value
gdk_win32_keymap_get_entries_for_keycode() did not initialize n_entries,
which led to a wrong number of items being returned in some cases.

/fixes #4610
2022-01-07 20:48:50 +01:00
KrIr17
e9370d1dc8 make flat buttons look flat (and allow non-flat button in toolbars) 2022-01-07 16:59:24 +00:00
Luca Bacci
0e09bb75b5 Merge branch 'improve-font-features-msvc' into 'gtk-3-24'
Visual Studio projects: Simplify building font features demo

See merge request GNOME/gtk!4336
2022-01-06 05:11:53 +00:00
Luca Bacci
185f82c2ad Merge branch 'msvc-project-improvements' into 'gtk-3-24'
Improve Visual Studio projects (for gtk-3-24)

See merge request GNOME/gtk!4324
2022-01-05 14:12:57 +00:00
Chun-wei Fan
eebc70bf27 Visual Studio projects: Simplify building font features demo
Improve the NMake Makefiles that is used to re-generate demos.h(.win32)
by re-generating the gtk3-demo Visual Studio projects, so that one would
no longer need to do that manually.

Update the build instructions accordingly.
2022-01-05 17:16:00 +08:00
Chun-wei Fan
cef3293184 Visual Studio projects: Generate versioned sources
Instead of relying on the ones that are currently shipped with the tarballs,
generate them from their .in counterparts prior to the build.  This includes
the Resource Scripts (.rc) for libgdk/libgtk, as well as gtkversion.h, in
addition to gdkversionmacros.h which can now be generated during prebuild.
2022-01-04 14:17:38 +08:00
Chun-wei Fan
089cccc929 Visual Studio: Make gen-gdkversionmacros-h.py generic
Rename the script as gen-version-items.py, and so make things more generic and
usable by other items in the build.  We want to eventually to be able to
generate the .rc files and the *version*.h files from their *.in counterparts
using this script.
2022-01-04 11:14:49 +08:00
Chun-wei Fan
fc8b70cbdf config-msvc.mak.in: Record the interface age
We want to make use of this so that we can generate the various versioned
sources easily, such as the Windows .rc scripts and the [gdk|gtk]version*.h.
2022-01-04 11:14:49 +08:00
Chun-wei Fan
6789ff7443 Visual Studio projects: Improve generating libgtk sources
This improves the source generating process by:

*  Generating the sources in the libgtk build directory, so that we do not
   pollute the source tree.
*  Support generating gtk[private]typebuiltins.[c|h] in the Visual Studio
   projects by using NMake internally.
*  Update the projects and the introspection build files so that the generated
   sources and headers can be found.
2022-01-04 11:14:41 +08:00
Chun-wei Fan
8eaddde310 gtk/build: Split out part of headers listings
This will enable us to share this list with the NMake Makefiles that will be
used to generate the gtk[private]typebuiltins.[c|h] in the Visual Studio
projects.
2022-01-04 11:07:28 +08:00
Chun-wei Fan
67f27409e0 GDK/build: Rename deprecated_h_sources to gdk_deprecated_h_sources
This will enable us to not confuse with the deprecated headers in
gtk/deprecated as those headers are also listed under deprecated_h_sources in
gtk/deprecated/Makefile.inc, when we include the makefile snippets in both
gdk/ and gtk/.
2022-01-04 11:07:28 +08:00
Chun-wei Fan
334333f779 Visual Studio projects: Improve generating GDK sources
This makes the rest of the sources that are generated being put in GDK's build
directory for the Visual Studio projects, instead of being placed in GDK's
source subdir, so that:

*  We can avoid polluting GDK's source tree.
*  The Visual Studio builds won't interfere with the Meson builds.

Update the project files to look for the generated sources and headers in the
right places, as well as making the introspection builds look for the generated
sources as well.

Also remove the gtk3-gen-srcs property sheets and put the relevant parts in the
corresponding gtk3-build-defines property sheets, to clean things up a bit.
2022-01-04 11:07:28 +08:00
Chun-wei Fan
74d43defc5 win32: Support (re-)generating gdkenumtypes.[c|h]
Add support in the NMake Makefiles used by the Visual Studio builds to generate
the enumeration sources in gdk/ in its own build directory.
2022-01-04 11:07:27 +08:00
Chun-wei Fan
caa1c0e4e5 gdk: Split out public headers listing
This is so that we can share the list with other Makefile-based build systems
to generate the enumeration sources.
2022-01-04 11:07:27 +08:00
Chun-wei Fan
61dd680b02 win32: Re-organize NMake Makefiles a bit
This way, we can have the introspection NMake Makefiles share more items
with the source generating bits.

Update the Visual Studio projects accordingly
2022-01-04 11:07:27 +08:00
Luca Bacci
6671c20632 Merge branch 'winpointer-fix-key-state' into 'gtk-3-24'
Winpointer: Fix keyboard state

See merge request GNOME/gtk!4327
2022-01-03 18:49:13 +00:00
Luca Bacci
0603dbb466 Merge branch 'filechoosernative-win32-invisible' into 'gtk-3-24'
GTK grab for GtkFileChooserNativeWin32

See merge request GNOME/gtk!4326
2022-01-03 16:12:43 +00:00
Luca Bacci
46c12b2c92
Winpointer: Fix keyboard state
The dwKeyStates field of the POINTER_INFO structure is
always set to 0 no matter what.

Use GetKeyState instead.

Fixes https://gitlab.com/inkscape/inbox/-/issues/5946
2022-01-03 15:08:58 +01:00
Luca Bacci
d3f46bcb16
Add GTK grab when opening GtkFileChooserNativeWin32
Implementation copied from gtkfilechoosernativeportal.c

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4582
2022-01-03 14:51:57 +01:00
Luca Bacci
728f0e13a8 Merge branch 'fix_windows_build' into 'gtk-3-24'
Fix Windows build in gtk 3.24.31

See merge request GNOME/gtk!4292
2022-01-02 16:27:33 +00:00
Luca Bacci
23f49038e3 Merge branch 'fix-4565' into 'gtk-3-24'
Font features: Fix building with Pango before 1.44.0

See merge request GNOME/gtk!4302
2022-01-02 15:51:51 +00:00
Luca Bacci
f6fe5d37a5 Merge branch 'more-vs2022-fixes' into 'gtk-3-24'
Some further Visual Studio 2022 build improvements (for gtk-3-24 only)

See merge request GNOME/gtk!4276
2022-01-02 15:50:25 +00:00
Luca Bacci
6ba7c50a7a
Add hid.lib to GDK .pc file 2022-01-02 16:11:03 +01:00
Chun-wei Fan
bec88ded5f demos/gtk-demo/font_features.c: Fix build on Pango < 1.44.x
The Pango headers prior to 1.44.0 do not include the HarfBuzz headers, so we
need to re-structure how we check for HarfBuzz 2.2.0 or later if we have Pango
1.44.x or later.

Fixes issue #4565.
2021-12-30 15:33:14 +08:00
Chun-wei Fan
b0e3d03831 gtkfontchooserwidget.c: Fix build with pre-1.44.x Pango
Pango headers after 1.44.0 include hb.h automatically, but not before, so
re-structure the #if/#elif/#else checks for the availability of HarfBuzz 2.2.0
or later.

Pointed out in issue #4565.
2021-12-30 15:26:44 +08:00
Matthias Clasen
cae257c9dc Merge branch 'meson-reftests' into 'gtk-3-24'
meson: Do not install reftests

See merge request GNOME/gtk!4280
2021-12-29 14:42:35 +00:00
Matthias Clasen
8fe3e09cfc Merge branch 'gtk-3-24-macos-dock-quit' into 'gtk-3-24'
macOS: Dock "Quit" invokes "app.quit" action

See merge request GNOME/gtk!4299
2021-12-29 14:28:47 +00:00
Matthias Clasen
8352dee082 Merge branch 'gtk-3-24-issue-4573' into 'gtk-3-24'
macOS: Fix QuartzCore linking and compiling with 10.11

See merge request GNOME/gtk!4298
2021-12-29 13:55:43 +00:00
Thomas Holder
cbd9715c3c macOS: Dock "Quit" invokes "app.quit" action
Allows the application to handle "Dock icon > Quit" the same as
"Application menu > Quit".

Requires GtkApplication's `register-session` property.

Suitable replacement for gtk-mac-integration's
`NSApplicationBlockTermination` signal.
2021-12-29 13:51:01 +01:00
Thomas Holder
0ac6144369 macOS: Fix QuartzCore linking and compiling with 10.11
Follow-up on 10b5f8a0d6

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4573
2021-12-29 11:33:50 +01:00
Melroy van den Berg
37f9af5805
Add define for GC_ALLGESTURES, in-case WINVER is not set. 2021-12-28 00:50:17 +01:00
Melroy van den Berg
4090306fd7
Lowercaps Windows.h -> windows.h 2021-12-28 00:47:28 +01:00
Luca Bacci
e6e4f9e630 Merge branch 'fix_gtk_switch_cleanup' into 'gtk-3-24'
Fix: GTK Switch crash under Windows, on exit.

See merge request GNOME/gtk!4291
2021-12-27 20:39:05 +00:00
Melroy van den Berg
1ce49e48b2 Fix: GTK Switch crash under Windows, on exit. 2021-12-27 20:39:04 +00:00
David King
7f295eeb32 meson: Do not install reftests
Match the testsuite in the main branch.
2021-12-23 10:57:58 +00:00
Chun-wei Fan
04496cc535 win32/detectenv-msvc.mak: Add section on VS2022
This will make introspection builds via the Visual Studio 2022 projects work as
the NMake Makefiles were looking for VS2019 builds, which most probably did not
exist
2021-12-22 10:12:22 +08:00
Chun-wei Fan
92a8e10789 meson: Make VS2022 builds distinct from VS2019
Make sure that we append the 'vs17' suffix to the DLL filenames rather than
appending 'vs16', so that VS2022 builds are distinct from the VS2019 ones.
2021-12-22 10:12:12 +08:00
Matthias Clasen
aa89959942 Merge branch 'fix-dist' into 'gtk-3-24'
gdk/win32/Makefile.am: Dist gdkkeys-win32.h

See merge request GNOME/gtk!4270
2021-12-21 19:25:50 +00:00
Matthias Clasen
bae1a43710 Merge branch 'high-contrast-3' into 'gtk-3-24'
gdk/wayland: Support new `high-contrast` key

See merge request GNOME/gtk!4272
2021-12-21 19:25:32 +00:00
Matthias Clasen
a4b522f6d7 Merge branch 'meson-fixes' into 'gtk-3-24'
Meson fixes

See merge request GNOME/gtk!4273
2021-12-21 19:25:16 +00:00
Matthias Clasen
01cb9b5ae6 Update meson build for recent changes
Adapt the meson build to the changes in
commit 93e1f7f1ec.
2021-12-21 14:22:45 -05:00
David King
208e115368 Revert "meson: simplify builtin_immodules build option"
This reverts commit 749a58ab26.

This maintains feature parity with the autotools build. To achieve the
equivalent of --with-included-immodules=wayland,
-Dbuiltin_immodules=wayland,waylandgtk can be used instead.
2021-12-21 14:36:16 +00:00
David King
2b566f0633 meson: Install example schema XML 2021-12-21 13:31:35 +00:00
Florian Müllner
da8f634b25 gdk/wayland: Support new high-contrast key
We now have a boolean setting that determines whether the high-contrast
theme should be used. Support it by automatically setting the existing
`gtk-theme-name` and `gtk-icon-theme-name` properties when enabled.

With that, it is no longer necessary to change the regular theme settings
for high-contrast, so toggling between high-contrast and a non-default
theme finally works reliably.
2021-12-21 14:01:10 +01:00
David King
9bad0a2d5e meson: Remove missing reftests
Removed from autotools build in commit
93e1f7f1ec.
2021-12-21 10:09:29 +00:00