Commit Graph

52663 Commits

Author SHA1 Message Date
Chun-wei Fan
58e038f32e Revert "Bug 676077: Fix handling of Keyboard Input on Windows"
The actual code that does the IM context code handling on Windows now uses the
native Windows APIs to handle keystrokes, so this patch is no longer needed, as
it was found that it instead caused issues.

Pointed out in issue #2865.

This reverts commit fd6ce9975e.
2022-01-17 11:31:28 +08:00
Luca Bacci
b5d0c44a87
Meson: Use gnome.post_install
Only available on Meson 0.57.0 and later
2022-01-14 17:30:35 +01:00
Lukas Oberhuber
021cdf382d macos: correctly handle retina cursors
This change correctly sizes HiDPI curors on macOS.

Before this, the cursors would appear double the size of normal cursors
on non HiDPI screens.
Based in part on this comment:
https://gitlab.gnome.org/GNOME/gtk/-/issues/613#note_687914
2022-01-14 00:10:15 +00:00
Luca Bacci
8252f99e08 Merge branch 'win32-fix-altgr-gtk3' into 'gtk-3-24'
IMContextSimple: Fix AltGr not working on Win32 [GTK3]

See merge request GNOME/gtk!4374
2022-01-13 19:46:26 +00:00
Philip Zander
f03bf55688 IMContextSimple: Fix AltGr not working on Win32
The old code assumed that any key press containing Ctrl or Alt cannot be
regular text input. This is not correct on Win32 as AltGr = Ctrl + Alt.
2022-01-13 13:43:23 +01:00
Matthias Clasen
dac9baf3b1 Merge branch 'wip/keep-scale-3-24' into 'gtk-3-24'
wayland/window: Only update the scale if on any outputs

See merge request GNOME/gtk!4353
2022-01-12 19:45:50 +00:00
Matthias Clasen
7a35c5bd4e Merge branch '4627-printing-Unref-old-spool_io-before-setting-new-one-gtk3' into 'gtk-3-24'
printing: Unref old spool_io before setting new one

See merge request GNOME/gtk!4369
2022-01-12 19:37:38 +00:00
Marek Kasik
0387486407 printing: Unref old spool_io before setting new one
Unref private spool_io of GtkPrintJob before setting it to a new one
in gtk_print_job_set_source_file() and gtk_print_job_set_source_fd()
to prevent a leak.

Fixes: #4627
2022-01-12 12:46:27 +01:00
Matthias Clasen
8fc2af7bb3 Merge branch 'fontchooser-fix-3' into 'gtk-3-24'
docs: Fix gtk_tree_selection_get_selected_rows()

See merge request GNOME/gtk!4354
2022-01-12 02:49:27 +00:00
Luca Bacci
7e9935e381 Merge branch 'file-chooser-native-win32-grab-only-when-modal' into 'gtk-3-24'
GtkFileChooserNativeWin32: add GTK grab only when modal

See merge request GNOME/gtk!4364
2022-01-11 13:49:45 +00:00
Luca Bacci
0b26e8b8a3
GtkFileChooserNativeWin32: add GTK grab only when modal 2022-01-11 14:23:10 +01:00
Luca Bacci
84386c6466 Merge branch 'win32-keymap-fixes' into 'gtk-3-24'
GdkWin32Keymap bugfixes

See merge request GNOME/gtk!4359
2022-01-11 09:56:48 +00:00
David Hogan
cc47262ccb gdkkeys-win32: Perform keyboard layout substitution
For some users, GetKeyboardLayoutNameA() returns an alias instead of the
fully resolved keyboard layout identifier. In that case, we have to
query the registry to resolve the alias before we can look up the DLL
path.

See comments under #4610
2022-01-10 03:34:59 +01:00
Philip Zander
4e9ddaf086 gdkkeys-win32: Fix handling of SGCAPS
Contrary to what you can read on the internet, SGCAPS keys don't work
by having capslock toggle the KBDCTRL bit, they actually have two
consecutive table entries, the first of which is for the normal
version and the second of which is for the capslocked version.

Background: SGCAPS is short for Swiss German caps because Swiss German
was the first layout to use this feature. For keys with the SGCAPS flag,
capslock has a different effect than pressing shift. For example:
Shift + ü = è,  CapsLock + ü = Ü,  CapsLock + Shift + ü = È
2022-01-09 12:36:47 +01:00
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
Matthias Clasen
b4eeada025 fontchooser: Fix axis name handling
This code was just broken.

Fixes: #4603
2022-01-07 14:27:17 -05:00
Jonas Ådahl
b86e6bc38a wayland/window: Only update the scale if on any outputs
If we ended up on no output at all, keep the HiDPI scale as is, as it
likely means we were on a workspace that was switched away from. By
keeping the same scale, we avoid unnecessary scale changes that would
otherwise take place if the scale when on monitors would end up being
more than 1.
2022-01-07 19:33:33 +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