Compare commits

..

557 Commits

Author SHA1 Message Date
Nelson Benítez León d1bf21ea43 containers that can be scrolled should have precedence
over child widgets that also react to scrolling
like GtkComboBox, GtkScale and GtkSpinButton,
because otherwise when you're in the middle of
scrolling the view/window you can involuntarily
scroll over the widgets and change its values.

This problem can be seen in applications like
pavucontrol, gnome-tweaks prefs, devhelp prefs,
and so on.

Fixes issue #3092
2022-01-20 20:05:39 -04:00
Philip Zander 10efc3cb0d 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-20 20:05:39 -04: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
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
Chun-wei Fan 1a73728e04 gdk/win32/Makefile.am: Dist gdkkeys-win32.h
This was missing from the tarball.
2021-12-21 16:38:17 +08:00
Matthias Clasen ab45bde94c 3.24.31 2021-12-20 23:01:49 -05:00
Matthias Clasen 93e1f7f1ec Remove a bunch of failing reftests
Still not enough to make distcheck pass.
Giving up on it :(
2021-12-20 23:01:34 -05:00
Matthias Clasen 62768629f2 Fix distcheck 2021-12-20 17:18:55 -05:00
Matthias Clasen 7521de1d61 NEWS: Updates 2021-12-20 13:29:09 -05:00
Matthias Clasen 292be6c4bb Merge branch 'gtk-3-24-bigsur-perf' into 'gtk-3-24'
macOS: Big Sur performance patch

See merge request GNOME/gtk!4265
2021-12-20 15:42:52 +00:00
Lukas Oberhuber 10b5f8a0d6 macOS: Big Sur performance patch
One of 4 that were applied on Gimp 2.99. Original authorship
@DesMcGuiness and adapted to Gtk3 by @lukaso
2021-12-18 22:59:58 +00:00
Matthias Clasen c3b3f4711d Merge branch 'gtk-3-24' into 'gtk-3-24'
gdkquartz: fix crash on uninitialized attribute

See merge request GNOME/gtk!4257
2021-12-16 13:43:32 +00:00
Lukas Oberhuber 71e2821578 gdkquartz: fix crash on uninitialized attribute
`gdk_quartz_display_get_monitor_at_window` crashes when it tries to access the NSWindow on
an offscreen window. The attribute `toplevel` of `impl` is uninitialized and
causes a segfault.

This partially fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/7608
2021-12-16 13:00:02 +00:00
Sveinn í Felli fde4431559 Update Icelandic translation 2021-12-15 19:52:29 +00:00
Sveinn í Felli d45b11e8ea Update Icelandic translation 2021-12-15 19:48:09 +00:00
Luca Bacci ff06d5d59f Merge branch 'win32-rewrite-keymap-v2' into 'gtk-3-24'
Rewrite GdkWin32Keymap (V2)

See merge request GNOME/gtk!1051
2021-12-15 11:15:27 +00:00
Matthias Clasen ef95b58500 Merge branch 'gtk-3-24' into 'gtk-3-24'
textview: Add CSS letter spacing [GTK3]

See merge request GNOME/gtk!4254
2021-12-14 18:30:45 +00:00
Melroy van den Berg 70ef77a4c2 Add CSS letter spacing to textview 2021-12-14 17:04:38 +01:00
Carlos Garnacho 2800dc356b Merge branch 'gtk-3-24-x11-xi2.4-gestures' into 'gtk-3-24'
[GTK3] Touchpad gestures for X11 (XInput 2.4, X Server 21.1)

See merge request GNOME/gtk!4212
2021-12-13 13:21:09 +00:00
Philip Zander e658e3c449 gdk/win32: Fix modifiers sometimes being consumed for special keys
Windows keymaps contain some bogus mappings, e.g. Ctrl+Backspace=Delete.
Previously, we correctly identified the key as Backspace, but the Ctrl
was still consumed, so the Ctrl+Backspace keybinding did not work.
2021-12-10 01:14:47 +01:00
Philip Zander b3fcfa4bbc gdk/win32: Fix group parameter not being used by translate_keyboard_state
gdk_win32_keymap_translate_keyboard_state erroneously used the active
group rather than the specified group, which caused shortcuts not to
work in Inkscape when using a Cyrillic layout.
2021-12-09 12:29:19 +01:00
Philip Zander 4601d3aee4 gdk/win32: Add licensing boilerplate to gdkkeys-win32 2021-12-09 12:29:15 +01:00
Philip Zander 64eedbfaf4 gdk/win32: Remove unneeded struct _GdkWin32KernelCPUFuncs
It only had a single member and was only used internally by one
function.
2021-12-08 22:46:52 +01:00
Chun-wei Fan 4a55c527d7 gdk/win32: Consolidate CPU detection in one place
This consolidates the check for the running CPU in one single location,
to make things a bit cleaner, as:

* We can make use of IsWow64Process2(), if available, to check both
  whether we are running on an ARM64 CPU, and whether we are running as
  a WOW64 process.  This is also the function to use to properly check
  whether we are running as a WOW64 process on ARM64 systems, as
  IsWow64Process() does not work as we want on ARM64 systems.

* If we don't have IsWow64Process2() (which is absent from Windows prior
  to Windows 10 1511, where ARM64 Windows is introduced), we can fall
  back to  IsWow64Process(), which will tell us whether we are running
  as an WOW64 process (but clearly not on an ARM64 system).

Also clean up things a bit so that we can reduce reliance on global
variables.
2021-12-08 22:46:49 +01:00
Philip Zander aa3e6bb0a3 GdkWin32Keymap: Be more robust against DLL loading failures
Fixes failure on the CI servers when generating GIR files
2021-12-08 22:44:20 +01:00
Philip Zander 4039153ca7 Rewrite GdkWin32Keymap (load table directly from layout DLL)
The old code used repeated calls to `ToUnicodeEx` to populate
the translation table, which is slow and buggy. The new code
directly loads the layout driver DLLs from Windows.

Associated issues: #2055 #1033
Merge request: !1051

GdkWin32Keymap cleanup

Conform to C89, improve comments, whitespace
2021-12-08 22:44:17 +01:00
Carlos Garnacho 068df4874a Merge branch 'wayland-clipboard-fix' into 'gtk-3-24'
wayland: Ensure clipboard handling doesn't lock up in certain corner cases

See merge request GNOME/gtk!4058
2021-12-06 11:16:54 +00:00
msizanoen1 e23b4dd21b wayland: Ensure clipboard handling doesn't lock up in certain corner cases
When a selection request fails to be converted to the requested format in the
GTK layers, the wayland backend would miss bumping the machinery to handle
further pending selection requests. Fix this by reacting to
GdkDisplay::send_selection_notify with target=GDK_NONE (i.e. a failed
conversion as hinted from the upper layers) to do that.

This ensures the clipboard handling doesn't lock up in the following
scenarios:
  - GTK returned with a mismatching type to the one requested
  - GTK fails to convert to the requested type

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4340
2021-12-06 11:30:11 +01:00
Povilas Kanapickas a94baf4c3d gdk/x11: Report XI2 version on the server 2021-12-03 00:04:10 +02:00
Povilas Kanapickas a1a2f8ab56 gdk/x11: Implement XI2.4 touchpad gesture support 2021-12-03 00:04:10 +02:00
Quentin PAGÈS 2db8f64ca7 Update Occitan translation 2021-12-02 15:48:19 +00:00
Matthias Clasen 15d9b3c7d6 Merge branch 'backport-font-feature-pango-hb' into 'gtk-3-24'
Backport font features code utilizing Pango with HarfBuzz integration (1.44.x) for gtk-3-24

See merge request GNOME/gtk!4206
2021-12-01 15:47:30 +00:00
Matthias Clasen 1b789197e5 fontchooser: Avoid setting variations needlessly
Setting variations to their default value causes
them to show up in the serialization of the font
description - a font description has no idea about
the default values, so can't filter them out.

Avoid that.
2021-11-29 13:05:02 +08:00
Chun-wei Fan 28337d68a3 Visual Studio projects: Update README for additional features
Rename README_EGL_MSVC.txt to README_FEATURES_MSVC.txt, as we now have
more features that can be included in the builds using the Visual
Studio projects, which require additional depedencies and manual
enabling.

Specifically, this outlines how the font tweaking feature in libgtk can
be enabled and for people who wish to do so, how to enable the Font
Features demo in gtk3-demo.exe.
2021-11-29 12:25:53 +08:00
Chun-wei Fan f82eb198f2 Meson: Enable font features demo on later Pango versions
...even if PangoFT2 is not present, provided that Pango 1.44.0+ and
HarfBuzz 2.2.0+ are installed.  The demo now has added support for later
Pango versions that use HarfBuzz for shaping on all supported platforms.
2021-11-29 12:25:53 +08:00
Chun-wei Fan 720e335246 configure.ac: Check for Pango 1.44.0 or later
...and HarfBuzz 2.2.0 or later so that we can enable the font feature
demo even if we do not have PangoFT2.
2021-11-29 12:25:53 +08:00
Chun-wei Fan b8e78f83ce Font features demo: Port to newer Pango
...if Pango 1.44.0+ and HarfBuzz 2.2.0+ are available, otherwise we
stick on to the current code path.

This way, we can have people build and run the demo even without
PangoFT2 if Pango 1.44.0 or later and HarfBuzz 2.2.0 or later is
installed.
2021-11-29 12:25:53 +08:00
Chun-wei Fan 079ee4e31e win32/generate-msvc.mak: Add rule to regenerate demos.h.win32
We can regenerate demos.h.win32 with or without the font features demo
by using the regenerate-demos-h-win32 target with or without secifying
the FONT_FEATURES_DEMO=1 flag on the NMake command line.
2021-11-29 12:25:53 +08:00
Chun-wei Fan f8200470da gtk-demo: Split out demo sources from Makefile.am
This way, we can share the demo listing to be used in other build
Makefile-based build systems, such as the auxiliary NMake Makefiles used
to generate the various sources.
2021-11-29 12:25:52 +08:00
Chun-wei Fan c3c759cbdd Visual Studio projects: Define __MSVC_PROJECTS__
...in the libgtk3 project, so that we can automatically link to
harfbuzz.lib if we have a sufficiently-new version of Pango and HarfBuzz
installed, so that the code to enable font features can be linked
properly, even if we don't explicitly put harfbuzz.lib in the list of
libraries that we feed into the linker in the project files.

If one is using pre-Pango-1.44.x and/or pre-HarfBuzz-2.2.0 and intends
to enable font features support, one still must update config.h.win32 to
make sure HAVE_PANGOFT2 and HAVE_HARFBUZZ is defined, and put
pangoft2-1.0.lib, harfbuzz.lib and freetype.lib (or so) in the
"Additional Libraries" under the linker settings in the projects
manually, as required before.
2021-11-29 12:25:52 +08:00
Chun-wei Fan e1422d73b1 gtkfontchooserwidget.c: Always enable font features with later Pango
This is a backport of the code in GTK4 where we can use the font
features that is given to us via HarfBuzz if we have Pango 1.44.x and
HarfBuzz 2.2.0 or later installed, even if we do not have PangoFT2
aavilable.

Since Pango 1.44.x depends on HarfBuzz for all platforms after 1.44.0,
we could take advantage of that and build the support in
GtkFontChooserWidget.

Add a directive that is to be used by Visual Studio compilers via the
Visual Studio projects to link to harfbuzz.lib automatically, so that
this support can be linked properly if we have the required Pango and
HarfBuzz headers and lib's installed.  Meson builds via Visual Studio
should handle this automatically, since pkg-config is being used there.

Since HAVE_PANGOFT2 and HAVE_HARFBUZZ is not defined by default in the
Visaul Studio projects, we will leave it up to the user to enable them
themselves and put in pangoft2-1.0.lib and harfbuzz.lib in the project
settings by themselves, or they could use Meson, as we did before.
2021-11-29 12:25:52 +08:00
Quentin PAGÈS 6c4cc93121 Update Occitan translation 2021-11-28 13:24:15 +00:00
Luca Bacci ee79334a52 Merge branch 'fix-printoperation-win32' into 'gtk-3-24'
gtkprintoperation-win32.c: Fix build on Visual Studio

See merge request GNOME/gtk!4193
2021-11-25 11:33:38 +00:00
Chun-wei Fan dfbcc0849b gtkprintoperation-win32.c: Fix build on Visual Studio
Cast the result of GetWindowLongPtrW() to void * so that we won't get
the C4047 warnings, which are considered an error in building the GTK
stack.
2021-11-25 19:00:22 +08:00
Emmanuele Bassi 34038aaf7d Merge branch 'wip/fix-randr-race-3-24' into 'gtk-3-24'
x11: Trap error when getting CRTC info [3.24]

See merge request GNOME/gtk!4168
2021-11-24 16:48:39 +00:00
Luca Bacci 0e48d8d7e3 Merge branch 'quartz-fix-keyboard-layout-notification' into 'gtk-3-24'
Quartz: Fix race for keyboard layout change notifications

See merge request GNOME/gtk!4190
2021-11-24 15:56:00 +00:00
Luca Bacci 78a0cdde83 Quartz: Fix keyboard layout notification
Register for notifications before initializing keymaps
2021-11-24 16:20:02 +01:00
Luca Bacci c2e6fcc92d Merge branch 'win32-theme-fixes' into 'gtk-3-24'
Win32 theme fixes

See merge request GNOME/gtk!4189
2021-11-23 13:25:08 +00:00
Jaime Velasco Juan 466619f7c1 win32 theme: Draw expander arrow
Better than nothing.
2021-11-23 12:42:41 +01:00
Jaime Velasco Juan 2f30e12de7 win32 theme: Fix unfocused window buttons 2021-11-23 12:35:39 +01:00
Jaime Velasco Juan bfe7a57b76 win32 theme: fix disabled GtkEntry style 2021-11-23 12:27:47 +01:00
Jaime Velasco Juan f9d82e965e win32 theme: Fix levelbar and tweak progressbar
Both have a similar look now
2021-11-23 12:05:51 +01:00
Luca Bacci 8d654527ab Merge branch 'ole2-dnd-ipc-window-follows-the-cursor-monitor' into 'gtk-3-24'
GdkWin32: Make OLE2 DND work on monitors with different OS scales

See merge request GNOME/gtk!4155
2021-11-18 21:57:36 +00:00
Luca Bacci 661f23d337 Merge branch 'gdk-win32-custom-print-dialog-widget-measurement' into 'gtk-3-24'
Fix measurement of custom widget in win32 print dialog

See merge request GNOME/gtk!4159
2021-11-18 19:02:58 +00:00
Luca Bacci 1650b4b205 Win32: Fix print dialog custom widget measurement 2021-11-17 15:41:13 +01:00
Jonas Ådahl 102341ae9f x11: Trap error when getting CRTC info
This should fix a race happening when RANDR changes quickly, e.g. during
unit testing where tests change monitor configurations rapidly.
2021-11-17 11:14:00 +01:00
Aleksandr Melman 2d67c74ea2 Update Russian translation 2021-11-16 21:52:25 +00:00
Matthias Clasen 7f8efb6b8d Merge branch 'gtk-3-24_inkscape2932' into 'gtk-3-24'
Backport css: Avoid a crash while parsing radial gradients

See merge request GNOME/gtk!4161
2021-11-16 21:30:10 +00:00
Matthias Clasen bac491b0b5 Merge branch 'compose-cache-symlinks' into 'gtk-3-24'
[GTK3 backport] composetable: invalidate cache based on symlink mtime too

See merge request GNOME/gtk!4165
2021-11-16 21:29:38 +00:00
Naïm Favier 1284a804f1 composetable: invalidate cache based on symlink mtime too
When the compose file is a symbolic link, take the link itself's
modification time into account (in addition to its target's) in
determining whether to invalidate the compose cache.

This is useful e.g. on NixOS systems where the compose file might point
to a store path with an irrelevant modification time, and we want the
cache to expire when the symlink itself changes.

(cherry picked from commit 22f5236943)
2021-11-16 18:30:02 +01:00
Matthias Clasen 60ec8dbd69 css: Avoid a crash while parsing radial gradients
has_size does not imply that sizes[0] is != NULL.

(cherry picked from commit aceba7484f)
2021-11-16 12:04:54 +11:00
Luca Bacci 4d40300d8a GdkWin32: Make OLE2 DND work in monitors with different OS scales
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3734
2021-11-13 19:41:58 +01:00
Luca Bacci a174568ef9 Merge branch 'gtk3-dnd-find-dest-window-fix' into 'gtk-3-24'
GdkWin32: Fix DND destination window search

See merge request GNOME/gtk!3885
2021-11-13 14:51:49 +00:00
Quentin PAGÈS 7520524aed Update Occitan translation 2021-11-10 18:17:30 +00:00
Milo Casagrande 02381e49d7 Update Italian translation 2021-11-09 08:43:19 +00:00
Luca Bacci ae8fde9630 Merge branch 'win32-gl-reorg-3' into 'gtk-3-24'
GDK-Win32: Reorganize backend GL code and add fallback mode

See merge request GNOME/gtk!3859
2021-11-06 11:21:43 +00:00
Matthias Clasen 3c83854962 Merge branch 'wip/carlosg/no-ping-serials-for-input-3-24' into 'gtk-3-24'
[3.24] gdk/wayland: Do not use xdg_wm_base.ping serials as "user input" serials

See merge request GNOME/gtk!4123
2021-11-06 02:20:12 +00:00
Luca Bacci 4067e46e20 Merge branch 'vs2022-vcproj' into 'gtk-3-24'
Visual Studio projects: "Add" Visual Studio 2022 projects

See merge request GNOME/gtk!4064
2021-11-05 17:38:08 +00:00
Carlos Garnacho d81f58bc09 gdk/wayland: Do not use xdg_wm_base.ping serials as "user input" serials
Ping/pong serials are not meant to be interpreted as user input serials
(e.g. those given back later to the compositor on grabs). As a matter
of fact, Mutter uses a different count (i.e. timestamps) in these, so
using these serials may confuse the compositor into denying certain
operations like DnD.
2021-11-05 14:43:23 +01:00
Goran Vidović 6b980e5ce8 Update Croatian translation 2021-10-29 15:24:44 +00:00
Matthias Clasen 660cbee51e Merge branch 'fix-win11-sdk-3' into 'gtk-3-24'
Fix building against the Windows 11 SDK (GTK+-3.x)

See merge request GNOME/gtk!4062
2021-10-28 16:47:15 +00:00
Matthias Clasen a12769a2c4 Merge branch 'fix-recent-filter-uri' into 'gtk-3-24'
GtkRecentFilter: Do not unset the uri if it is needed

See merge request GNOME/gtk!4080
2021-10-27 15:03:40 +00:00
Rūdolfs Mazurs 20be04f7ac Update Latvian translation 2021-10-25 16:50:04 +00:00
Goran Vidović cdab711ec2 Update Croatian translation 2021-10-21 10:38:42 +00:00
Goran Vidović 595531eba5 Update Croatian translation 2021-10-21 10:37:02 +00:00
Gaël Bonithon 90ca7fb3c9 GtkRecentFilter: Do not unset the uri if it is needed 2021-10-19 20:28:06 +02:00
Matthias Clasen 1e72dac839 Merge branch 'wip/hadess/quiet-broadway-gtk3' into 'gtk-3-24'
broadway: Quiet initialisation failures

See merge request GNOME/gtk!4052
2021-10-19 02:45:56 +00:00
Matthias Clasen 25d01b7610 Merge branch 'wip/fix-remap-up-left-popup' into 'gtk-3-24'
window/wayland: Reset position when hiding popup

See merge request GNOME/gtk!3913
2021-10-18 22:34:39 +00:00
Jonas Ådahl 0f871584fc Merge branch 'surfaceloop' into 'gtk-3-24'
Check if size changed before hiding a surface

See merge request GNOME/gtk!3944
2021-10-18 14:20:44 +00:00
Luca Bacci d34f4416bd Merge branch 'gdk-win32-ensure-correct-order-of-operations-when-handling-dpi-scale-and-gdk-screen-offset' into 'gtk-3-24'
GdkWin32: Ensure consistent order of operations when handling DPI scale and GDK screen offset

See merge request GNOME/gtk!3931
2021-10-18 11:36:47 +00:00
John Ralls 36315cbe2b [quartz]Use the absolute value of Scale values for CGContextScaleSCM
In macOS-12.sdk CGContextConverSizeToDeviceSpace returns a negative
height and passing that to CGContextScaleCTM in turn causes the cairo
surface to draw outside the window where it can't be seen. Passing the
absolute values of the scale factors fixes the display on macOS 12 without
affecting earlier macOS versions.
2021-10-14 12:45:48 -07:00
Chun-wei Fan 1234b46d3b Visual Studio projects: "Add" Visual Studio 2022 projects
Like the Visual Studio 2012+ projects, copy the Visual Studio 2010
projects and replace the items in there as needed, so that we can
obtain Visual Studio 2022 project files, since they are all in the
MSBuild format.
2021-10-14 10:53:18 +08:00
Chun-wei Fan c4d8575c30 gtk: Fix building version resource on Windows 11 SDK
The rc.exe that comes with the Windows 11 SDK does not allow one to include
winuser.h directly in the .rc scripts, so make sure that we do not try to
generate the final gtk.rc with it, but instead include windows.h with
WIN32_LEAN_AND_MEAN defined.
2021-10-14 10:30:58 +08:00
Chun-wei Fan dceed915e8 gtk/generate-uac-manifest.py: Fix UAC manifest .rc
The resource compiler in the Windows 11 SDK does not allow one to include
winuser.h directly in resource scripts (.rc) with a rather cryptic error
message, so fix generating the .rc file to embed the UAC manifest by including
windows.h with WIN32_LEAN_AND_MEAN instead.
2021-10-13 11:38:26 +08:00
Sveinn í Felli 49374551e8 Update Icelandic translation 2021-10-12 22:45:33 +00:00
Rafael Fontenelle 888fe92051 Update Brazilian Portuguese translation 2021-10-12 17:37:09 +00:00
Bastien Nocera e7679635b0 broadway: Quiet initialisation failures
Broadway is the only GTK+ backend that throws an error on stderr for a
"display server" connection failure.

This causes problems when gtk_init_check() is used and unexpected error
output is generated such as with hotdoc, which fails when generating a
GTK plugin's documentation instead of overlooking the issue.

"Unable to init server: Could not connect: Connection refused"
2021-10-11 20:29:40 +02:00
Ting-Wei Lan d90efbd9be Merge branch 'wip/lantw/GDK-Win32-Fix-MinGW-autotools-build' into 'gtk-3-24'
GDK/Win32: Fix MinGW autotools build

See merge request GNOME/gtk!3991
2021-10-10 10:33:42 +00:00
Emmanuele Bassi 0d0c9c918e Merge branch 'filesearch3' into 'gtk-3-24'
searchenginemodel: finalize search results

See merge request GNOME/gtk!4030
2021-10-04 14:07:13 +00:00
Pierre Ossman aca83684ed searchenginemodel: finalize search results
It is necessary to signal the search engine that we are finished and
that we found something for it to reliably show the results. It would
sometimes work anyway since it is sufficient if any backend signals
completion. However if GtkSearchEngineModel was the only backend
returning results then things would break.
2021-10-04 15:41:42 +02:00
Emmanuele Bassi d4376ec0db Merge branch 'gtk3-debian-ci' into 'gtk-3-24'
ci: Update Debian image to current stable

See merge request GNOME/gtk!4031
2021-10-04 12:50:35 +00:00
Emmanuele Bassi 41a2f5cdc0 ci: Update the Debian CI image 2021-10-04 13:24:32 +01:00
Emmanuele Bassi 7e2917e19c ci: Update Debian image to current stable
This is required by a change in the certificates that makes it
impossible to run `git clone` on a GNOME GitLab repository in a CI
pipeline.
2021-10-04 13:23:32 +01:00
Emmanuele Bassi 3935a4a44a Merge branch 'gtk3-selection-docs' into 'gtk-3-24'
docs: Fix gtk_tree_selection_get_selected()

See merge request GNOME/gtk!4012
2021-09-30 00:12:20 +00:00
Emmanuele Bassi 1900fc2f80 docs: Fix gtk_tree_selection_get_selected_rows()
Reword the description and return value so that they look better on
docs.gtk.org.
2021-09-30 00:38:17 +01:00
Emmanuele Bassi 4f54fcd288 docs: Fix gtk_tree_selection_get_selected()
Use the proper sigils for enumeration values and constants. The
description is also barely intelligible.
2021-09-30 00:35:11 +01:00
Sveinn í Felli d5657e2c55 Update Icelandic translation 2021-09-29 12:08:08 +00:00
Danial Behzadi d1b90752ca Update Persian translation 2021-09-25 10:48:05 +00:00
Ting-Wei Lan 26d61e2abc GDK/Win32: Fix MinGW autotools build
MinGW-w64 CRT provides no 'hid.lib' file. Instead, it has 'libhid.a'
which can be linked with '-lhid' linker argument.

Also, we have to declare the '_LIBADD' variable and add 'LDADDS' to it,
or 'LDADDS' won't do anything for the build.
2021-09-24 00:06:51 +08:00
Luca Bacci 378ed797a4 GdkWin32: Initialize _gdk_offset_x / _gdk_offset_x to unscaled values
Note that gdk_monitor_get_geometry () returns DPI-scaled values,
while the screen offset should be unscaled, as scales are properties
of indivdual monitors.
2021-09-23 17:37:54 +02:00
Luca Bacci 876a2e6225 GdkWin32: Ensure a consistent order of operations when handling DPI scale and GDK screen offset 2021-09-23 17:37:45 +02:00
Luca Bacci cac1c7cd22 GdkWin32: Use a signed integral type for the DPI scale
An arithmetic operation involving a signed and an unsigned operand
of the same rank will have both operands converted to *unsigned*.
That's an issue if the signed operand actually has a negative value.

That was causing issues with the handling of monitor geometries that
had negative x / y positions.
2021-09-23 15:28:42 +02:00
Matthias Clasen 8d04980f38 Merge branch 'gtk-3-24' into 'gtk-3-24'
Do not require wayland-protocols as dependency in the .pc files

See merge request GNOME/gtk!3961
2021-09-16 18:37:36 +00:00
muradm 6efcbf4634 Do not require wayland-protocols as dependency in the .pc file
Basically, I was building some packages on Guix. I figured out that
wayland-protocols was listed among propagated-inputs for gtk+ package
(gtk-3-24). propagated-inputs holds a list of runtime dependencies,
that should be available to any other package that depends on gtk+.
While discussing we clarified that wayland-protocols is not runtime
dependency. So I moved it to native-inputs of gtk+ package, which
means that, this dependency will be available only to gtk+ package and
only at build time. Once moved, building of other applications that
depening on gtk+ started to fail.

Investigation showed that, all .pc (pkg-config) files prepared by gtk+
package, was including:

Requires.private: ... wayland-protocols ...

Since it becomes requirement, other applications was failing with
missing dependency wayland-protocols of dependency gtk+, for instance:

-- Checking for module 'gtk+-3.0'
--   Package 'wayland-protocols', required by 'gdk-3.0', not found

While actually wayland-protocols is not even a build time dependency
of application that depends on gtk+. Advertisement of such
requirement, is a bit misleading, because one does not need it at
runtime, especially applications based on gtk.
2021-09-16 20:44:39 +03:00
Fabio Tomat 5cccc2d975 Update Friulian translation 2021-09-16 12:15:24 +00:00
Matthias Clasen 36b4cd11b6 Merge branch 'reset-source-id' into 'gtk-3-24'
GtkClipboard: Reset a source id to prevent double free

See merge request GNOME/gtk!3954
2021-09-15 12:23:15 +00:00
Daniel Mustieles df1e6dc45d Updated Spanish translation 2021-09-15 08:29:52 +02:00
Gaël Bonithon 599ab80c63 GtkClipboard: Reset a source id to prevent double free
Fixes #4253.
2021-09-15 07:37:46 +02:00
Ronan Pigott 23c7e6e13b Check if size changed before hiding a surface
Commit 68188fc948 introduces a workaround for clients that try to
change the size of a popup after it is created, but inadvertently
introduces an infinite loop of surface creation when the popup enters
two or more wl_outputs with different scales on creation.

This commit checks if the size actually changed before applying the
workaround and avoids the loop.
2021-09-13 17:14:14 -07:00
Alan Mortensen 1382e54ef6 Updated Danish translation of gtk-properties 2021-09-13 20:48:53 +02:00
Alan Mortensen 53fc584988 Updated Danish translation 2021-09-13 20:48:50 +02:00
Matthias Clasen 3567a74dd8 Merge branch 'ownoutput' into 'gtk-3-24'
Ignore wl_output globals not bound by us

See merge request GNOME/gtk!3941
2021-09-13 16:48:40 +00:00
Ronan Pigott 9a4e328928 Ignore wl_output globals not bound by us
Gdk doesn't know the scale of output globals it didn't bind. This
keeps them from entering the output list and triggering erroneous
changes in surface scales.
2021-09-13 03:08:49 -07:00
Luca Bacci c71dca236c Use WindowFromPoint to find DND target window 2021-09-10 13:59:27 +02:00
John Ralls a752e33838 Update Quartz version detection for macOS 12. 2021-09-08 18:01:50 -07:00
Luna Jernberg b5a2d29538 Update Swedish translation 2021-09-08 19:53:47 +00:00
John Ralls e9d4b0dda0 Move includes of gdkinternal-quartz.h from headers to impl files.
gdkinternal-quartz.h isn't installed but the headers that included
it are, which which would cause the build to fail if an external
project included one of them.

Also changed the includes in gdkinteral-quartz.h to local for
faster loading.
2021-09-07 11:08:11 -07:00
John Ralls 7e732caa1e Let gdkquartz-cocoa-access.h find gdkquartz.h during build.
gdkquartz.h is installed in $PREFIX/include/gdk but is in gdk/quartz
in the source tree. Use "gdkquartz.h" to find it in both places.
2021-09-07 10:39:37 -07:00
Chun-wei Fan bcdbb93296 GDK-Win32: Add fallback mode to GLES
...if GLES (libANGLE) support was enabled in the build.  This way, we can
check whether the GL driver is capable enough to support the OpenGL
features that we use in GTK.  If the driver is not capable enough, and
GLES support is enabled, we can try to create the GdkGLContext again as a
GLES context.
2021-09-06 19:36:14 +08:00
Chun-wei Fan 97d3024701 gdk/win32: Some further small GL-related cleanup
Remove from gdkglcontext-win32.h items that aren't really necessary, and
just include gdkglcontext-win32.h where applicable.
2021-09-06 19:36:13 +08:00
Chun-wei Fan 9e949209a1 GDK-Win32: Reorganize gdkgdlcontext-win32.c
Group the WGL-specific code and GLES-specific code together, so that we
can reduce the number of #ifdef ... in the code, to make the code more
readable and easily maintained.  This will pave the way to add a
fallback mode to use libANGLE (OpenGL/ES) in case the Desktop OpenGL
support is inadequte, if OpenGL/ES support is enabled in the build.

This is somewhat based on the updates that were done in GTK master, so
we are using one subclass for WGL-based GdkGLContexts, and another for
GLES-based GdkGLContexts.

Also remove the underscores in many of the functions in
gdkglcontext-win32.*.

Clean up the code a bit as a result.
2021-09-06 19:36:13 +08:00
Goran Vidović 543b7defec Update Croatian translation 2021-09-04 17:15:55 +00:00
Boyuan Yang f7713bde1a Update Chinese (China) translation 2021-09-04 16:20:22 +00:00
Dz Chen 499af07d2c Update Chinese (China) translation 2021-09-04 15:50:14 +00:00
Changwoo Ryu b4acfaee1c Update Korean translation 2021-09-04 14:54:31 +00:00
Jiri Grönroos c6d2d97774 Update Finnish translation 2021-09-02 16:18:44 +00:00
Jonas Ådahl d74b01636b window/wayland: Reset position when hiding popup
When a popup is remapped, if the GdkWindow::x/y position is negative,
some best-effort hueristics used to ignore internal X11-style hackery
windows incorrectly scooped up remapped popup windows.

Avoid these hueristics by resetting the x and y fields of GdkWindow to 0
whe hiding a popup. It'll then appear as if it was newly initialized,
and escape the mentioned hueristics.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4071
2021-09-02 10:24:38 +02:00
Nathan Follens 9ff2a9ab9b Update Dutch translation 2021-08-31 15:30:14 +00:00
eshagh shahidani 7691c94a37 Update Persian translation 2021-08-31 14:41:54 +00:00
Baurzhan Muftakhidinov 659292f9ba Update Kazakh translation 2021-08-29 07:38:36 +00:00
Claude Paroz e2218cbb4d Updated French translation 2021-08-28 09:13:25 +02:00
Marek Černocký 93c4359ec0 Updated Czech translation 2021-08-26 14:33:08 +02:00
Fran Dieguez 82c199db00 Update Galician translation 2021-08-25 06:04:44 +00:00
Balázs Meskó 79fc2631c5 Update Hungarian translation 2021-08-23 05:54:19 +00:00
Matthias Clasen f6a82cb658 Merge branch 'cherry-pick-5044031b' into 'gtk-3-24'
Merge branch 'wip/kalev/gcc-11' into 'master'

See merge request GNOME/gtk!3870
2021-08-22 19:53:16 +00:00
Matthias Clasen 26e9919bf6 Merge branch 'gtk3-docs-fixes' into 'gtk-3-24'
docs: Escape the XML tags in the Widget class description

See merge request GNOME/gtk!3869
2021-08-22 19:13:57 +00:00
Matthias Clasen b4e110920a Merge branch 'wip/kalev/gcc-11' into 'master'
Avoid diagnostics for gcc-11 false positive out of bounds accesses

See merge request GNOME/gtk!3064

(cherry picked from commit 5044031b53)

c514c41d Avoid diagnostics for gcc-11 false positive out of bounds accesses
2021-08-22 19:03:23 +00:00
Emmanuele Bassi ff46ea64c4 docs: Escape the XML tags in the Widget class description
While gtk-doc doesn't care, this isn't really valid Markdown as the
GtkBuilder custom XML tags will be considered valid markup and embedded
as they are, breaking the HTML output.
2021-08-22 19:38:44 +01:00
Asier Sarasua Garmendia 4868656ebb Update Basque translation 2021-08-21 08:43:24 +00:00
Matthias Clasen 2dee749632 Merge branch 'accepts_dnd_from_finder' into 'gtk-3-24'
accepts NSPasteboardTypeFileURL as "text/uri-list".

See merge request GNOME/gtk!3846
2021-08-20 13:23:07 +00:00
Hiroyuki Ito ec4d27a4fc accepts NSPasteboardTypeFileURL as "text/uri-list". 2021-08-14 09:38:36 +09:00
Danial Behzadi fe19b20492 Update Persian translation 2021-08-07 14:42:26 +00:00
Мирослав Николић 94f86a2fb6 Update Serbian translation 2021-08-04 17:26:12 +00:00
Matthias Clasen 3a8fab6879 Merge branch 'luizfls-gtk-3-24-patch-58754' into 'gtk-3-24'
gtkwindow.c: Fix typo in `gtk_window_unstick` documentation

See merge request GNOME/gtk!3798
2021-07-29 21:27:41 +00:00
Luiz Silva b04bd31718 Fix typo in gtk_window_unstick documentation 2021-07-29 15:03:34 +00:00
Matthias Clasen d450cbe517 Merge branch 'opengl.win32.fixes' into 'gtk-3-24'
GDK/Win32: Fix up OpenGL a bit (part of !3767 for GTK3)

See merge request GNOME/gtk!3792
2021-07-28 17:55:51 +00:00
Matthias Clasen d86ce85267 Merge branch 'fix-cxo-system-build' into 'gtk-3-24'
gdkdevicemanager-win32.c: Fix build

See merge request GNOME/gtk!3791
2021-07-28 17:55:01 +00:00
Chun-wei Fan a4066188a2 Merge branch 'msvc-prototype' into 'gtk-3-24'
config.h.win32.in: Define HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W

See merge request GNOME/gtk!3793
2021-07-28 07:22:22 +00:00
Chun-wei Fan b81b9311f6 config.h.win32.in: Define HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W
... on Visual Studio, so that we will not have warnings from defining
the prototype SetupDiGetDevicePropertyW() unnessarily.
2021-07-28 15:00:38 +08:00
Chun-wei Fan 15817973d7 GDK/Win32: Fix up OpenGL a bit
Like the recent updates in GTK4, the HWND that we use to obtain the HDC
that we need for OpenGL/GLES operations should really be tied to
GdkWindow, not GdkDisplay, as that is where the Win32 HWND where we
originate from is located, so stop storing the GL HWND in
GdkWin32Display, but just grab them from the GdkWindow that is bound to
the GdkGLContext.

We are more conservative about freeing up GL resources in GTK3, so we
will continue to call ReleaseDC() as we did before.
2021-07-28 11:28:17 +08:00
Chun-wei Fan 71aa479d16 gdkdevicemanager-win32.c: Fix build
Fix the call to p_WTSetA, as we should be passing in a HCTX, not a
HCTX*.  Also clean up things a bit.
2021-07-28 09:58:06 +08:00
Matthias Clasen 998f4f32cc Merge branch 'wip/carlosg/sequence-accepted-in-group-3-24' into 'gtk-3-24'
gtkgesture: Apply gesture group state after setting up sequence

See merge request GNOME/gtk!3774
2021-07-21 12:49:22 +00:00
Carlos Garnacho 944a75659c gtkgesture: Apply gesture group state after setting up sequence
When a new sequence is added to a GtkGesture, its state is looked
in other gestures in the same group, and made to match in this
gesture. This however happened a bit too early, before the
gesture touchpoint was fully set up. As this may result in signal
emission and whatnot, it's a good idea to make it happen with a
fully set up touchpoint.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3946

(Cherry-picked from commit 53df32e6cf)
2021-07-21 14:27:28 +02:00
Matthias Clasen bc1ab236bd Merge branch 'BUG_filechooserbutton_remote_GTK3' into 'gtk-3-24'
FileChooserButton: query 'display name' also for unbookmarked files

See merge request GNOME/gtk!1724
2021-07-20 18:39:44 +00:00
Benjamin Otte adf9578e9c Merge branch 'ci-default-settings' into 'gtk-3-24'
reftests: Enforce default settings

See merge request GNOME/gtk!3768
2021-07-19 17:30:57 +00:00
Matthias Clasen b541ad48d1 reftests: Enforce default settings
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
2021-07-19 13:10:31 -04:00
Matthias Clasen 557c3d1d62 Merge branch 'pango-main-for-3' into 'gtk-3-24'
Use pango from the main branch

See merge request GNOME/gtk!3761
2021-07-17 13:05:13 +00:00
Philipp Kiemle da4769ec81 Update German translation 2021-07-16 22:17:16 +00:00
Matthias Clasen fe14b9d311 Use pango from the main branch
Change the Pango subproject to use the main branch.

This depends on
https://gitlab.gnome.org/GNOME/pango/-/merge_requests/379
2021-07-16 13:21:09 -04:00
Chun-wei Fan 71d7054ff7 Merge branch 'wintab-set-cxo-system-option' into 'gtk-3-24'
Wintab: Set the CXO_SYSTEM option

See merge request GNOME/gtk!3644
2021-07-12 01:52:57 +00:00
John Ralls 6128492cc0 [quartz] Fix incorrect include path for gdkquartz.h 2021-07-10 13:57:11 -07:00
Chao-Hsiung Liao 7912714337 Update Chinese (Taiwan) translation 2021-07-10 08:40:51 +00:00
Chao-Hsiung Liao 0c4a627199 Update Chinese (Taiwan) translation 2021-07-10 08:36:42 +00:00
Matthias Clasen a8c83fe3bc Merge branch 'gdkkeys' into 'gtk-3-24'
gdkkeys-win32.c: fix initialisation of key_state in update_keymap

See merge request GNOME/gtk!3741
2021-07-09 10:58:09 +00:00
Chun-wei Fan 2f176b566e Merge branch 'fix-winpointer-h-make-dist' into 'gtk-3-24'
Add winpointer.h to Makefile.am sources list

See merge request GNOME/gtk!3743
2021-07-09 09:37:24 +00:00
Luca Bacci de31fdcc68 Add winpointer.h to Makefile.am sources list 2021-07-09 09:00:36 +02:00
Jeremy Tan 7303854310 gdkkeys-win32.c: fix initialisation of key_state in update_keymap
It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.
2021-07-09 12:35:44 +08:00
Matthias Clasen d4e2d05cd9 3.24.30 2021-07-08 10:02:44 -04:00
Źmicier Turok 2169161312 Update Belarusian translation 2021-07-06 06:21:07 +00:00
Matthias Clasen 635591c4d6 Merge branch 'pgriffis/remove-cloudprint-gtk3' into 'gtk-3-24'
Remove Google Cloud Print backend (GTK3)

See merge request GNOME/gtk!3730
2021-07-05 20:21:40 +00:00
Patrick Griffis c77ea5101e Remove Google Cloud Print backend
This service was shut down at the start of 2021
2021-07-05 10:52:31 -05:00
Robert Mader 3e1214bda4 Merge branch 'gtk-3-24-pointer-gestures-version' into 'gtk-3-24'
gdk/wayland: Fix pointer-gestures version selection

See merge request GNOME/gtk!3696
2021-07-05 13:16:18 +00:00
Vlad Zahorodnii 92ba4bf396 gdk/wayland: Fix pointer-gestures version selection
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION will fail if the
compositor implements version 2 of pointer-gestures-v1.
2021-07-05 14:50:59 +02:00
Matthias Clasen 1fa2969a05 Merge branch 'add-support-for-windows-pointer-input-stack-apis' into 'gtk-3-24'
Add support for Windows Pointer Input Stack

See merge request GNOME/gtk!1563
2021-07-03 16:22:33 +00:00
Luca Bacci 712721b60a Add support for Windows Pointer Input Stack
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1563
2021-07-03 16:04:28 +02:00
Alexey Rubtsov 01eb5d41cf Update Russian translation 2021-06-28 11:10:59 +00:00
Chun-wei Fan 88730e81c1 Merge branch 'fix-issue-2019' into 'gtk-3-24'
[Gtk3] GdkWin32: Remove klassTEMPSHADOW

See merge request GNOME/gtk!2749
2021-06-22 06:51:56 +00:00
Matthias Clasen a9c8b879a4 Merge branch 'wip/otte/for-3-24' into 'gtk-3-24'
cellarea: Don't shrink area too much

See merge request GNOME/gtk!3671
2021-06-16 00:13:43 +00:00
Benjamin Otte 4ba89f25b8 cellarea: Don't shrink area too much
Do not compute rectangles with negative width/height. This avoids
assertion failures further down when those rectangles were actually
checked.

https://bugzilla.redhat.com/show_bug.cgi?id=1962215
2021-06-15 19:34:37 +02:00
Matthias Clasen 447ab4ad0e Merge branch 'quartz-fixes' into 'gtk-3-24'
quartz: fix compilation on macOS 10.10

See merge request GNOME/gtk!3654
2021-06-15 11:11:57 +00:00
Emin Tufan Çetin 47959b5b4a Update Turkish translation 2021-06-15 08:59:44 +00:00
Tom Schoonjans 66b533408d quartz: fix compilation on macOS 10.10 2021-06-12 06:10:54 +01:00
Luca Bacci f67bf8d892 Wintab: Set the CXO_SYSTEM option
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3860
2021-06-11 19:52:44 +02:00
Luca Bacci af747315d7 Wintab: set the right device field in the event structure
Even when sends_core is FALSE

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3860
2021-06-11 19:52:43 +02:00
Emmanuele Bassi 90e8d7ff1a Merge branch 'gtk3-a11y-leak' into 'gtk-3-24'
a11y: Fix ref counting in tree views

See merge request GNOME/gtk!3660
2021-06-11 14:12:10 +00:00
Matthias Clasen 21f8098261 a11y: Plug a memory leak with treeviews
We need to explicitly remove the children from
a GtkContainerCellAccessible, since they otherwise
keep the parent alive.

Fixes: #3981
2021-06-11 08:55:48 -04:00
Matthias Clasen d4f62b44d4 a11y: Fix ref counting in tree views
GtkContainerCellAccessible wasn't unsetting accessible
parents. Fix that.

By itself, this doesn't help for freeing a memory leak,
since AtkObject keeps a ref on its parent, so we never
free the GtkContainerCellAccessible as long as it has children.
2021-06-11 08:53:46 -04:00
Matthias Clasen 6d6d76ecbb Merge branch 'arb_fbo' into 'gtk-3-24'
Switch to GL_ARB_framebuffer_object

See merge request GNOME/gtk!2076
2021-06-08 14:59:05 +00:00
Emmanuele Bassi 43a8655ad0 Merge branch 'glib-main-gtk-3-24' into 'gtk-3-24'
subprojects: Use GLib main branch (3.24)

See merge request GNOME/gtk!3643
2021-06-07 15:06:48 +00:00
Philip Withnall df9fe56264 subprojects: Use GLib main branch
GLib upstream has renamed its `master` branch to `main`.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2348.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-07 14:59:09 +01:00
Aurimas Černius bfa763a24a Updated Lithuanian translation 2021-06-06 22:52:49 +03:00
Matthias Clasen c70d23b61f Merge branch 'backport-mr2884-to-gtk-3-24' into 'gtk-3-24'
Backport !2884 to GTK3

See merge request GNOME/gtk!3632
2021-06-06 12:33:08 +00:00
Matthias Clasen 7773c423aa Merge branch 'provide-built-dlls-as-gitlab-ci-artifacts' into 'gtk-3-24'
Provide built DLLs as Gitlab CI artifacts

See merge request GNOME/gtk!3633
2021-06-06 12:32:33 +00:00
Rafael Fontenelle 0ba8d3f87e Update Brazilian Portuguese translation 2021-06-06 08:48:49 +00:00
Matthias Clasen 906eba7288 Merge branch 'imcontext-ignore-more-3' into 'gtk-3-24'
imcontext: Ignore more keysyms

See merge request GNOME/gtk!3636
2021-06-05 02:08:18 +00:00
Matthias Clasen d7196e5ea8 imcontext: Ignore more keysyms
It finally dawned on my that #3673 is just another
case of unexpected keysyms getting sent our way via
fringe XKB features.

Ignore them all!
2021-06-04 21:30:36 -04:00
Luca Bacci a14e5778ff Provide built DLLs as Gitlab CI artifacts 2021-06-04 22:42:13 +02:00
Luca Bacci 547ea8b073 Backport 'fix integer overflow in monitor refresh rate calculation' to GTK3
Original MR by Volker Rümelin.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2884
2021-06-04 17:44:49 +02:00
Daniel Șerbănescu 5aa878d8e5 Update Romanian translation 2021-06-02 10:03:45 +00:00
Matthias Clasen 854343f8aa Merge branch 'screensaver-async-3' into 'gtk-3-24'
gtkapplication-dbus: Fetch inital screen saver state async

See merge request GNOME/gtk!3614
2021-06-01 19:10:59 +00:00
Guido Günther 72ab4c46ed gtkapplication-dbus: Fetch inital screen saver state async
Avoid a sync call that can make the application block for no good
reason.

Fixes 6f6b5faaa2
2021-06-01 14:32:58 +02:00
Bruce Cowan 1308bc6131 Update British English translation 2021-05-30 11:05:08 +00:00
Piotr Drąg aeecafc11e Update Polish translation 2021-05-30 13:00:23 +02:00
Jordi Mas 5b8eca222c Update Catalan translation 2021-05-28 22:29:32 +02:00
Daniel Mustieles e6676432cd Updated Spanish translation 2021-05-27 12:16:11 +02:00
Kukuh Syafaat 1e72ea5a92 Update Indonesian translation 2021-05-27 02:52:04 +00:00
Hugo Carvalho 8c97f0832c Update Portuguese translation 2021-05-26 16:53:18 +00:00
Matej Urbančič f9fe28cece Update Slovenian translation 2021-05-25 19:45:00 +00:00
Matthias Clasen f64f335bd6 Merge branch 'ignore-nosymbol-press-3-24' into 'gtk-3-24'
imcontext: Ignore NoSymbol key events

See merge request GNOME/gtk!3593
2021-05-25 18:22:04 +00:00
Matthias Clasen 6baf287c5f imcontext: Ignore NoSymbol key events
These can happen with some XKB options.

Fixes: #3973
2021-05-25 13:42:06 -04:00
Yuri Chornoivan 6930749ad5 Update Ukrainian translation 2021-05-25 16:20:44 +00:00
Piotr Drąg 98e5fc81ed Update POTFILES.in 2021-05-25 16:33:30 +02:00
Yuri Chornoivan d2ae457378 Update Ukrainian translation 2021-05-25 13:08:17 +00:00
Emmanuele Bassi 26119e5fc0 Merge branch 'filechooser-a11y' into 'gtk-3-24'
Improve FileChooser a11y

See merge request GNOME/gtk!2721
2021-05-25 12:57:12 +00:00
Matthias Clasen 37477a1210 Merge branch 'fix-im-reset-3-24' into 'gtk-3-24'
imcontextsimple: Fix a possible problem

See merge request GNOME/gtk!3586
2021-05-25 12:40:02 +00:00
Matthias Clasen 0952c11bec imcontextsimple: Fix a possible problem
We were forgetting to handle the compose sequence
case in reset().
2021-05-25 08:07:26 -04:00
Matthias Clasen eff4d45c09 Merge branch 'gtk-3-24+emoji-data-update' into 'gtk-3-24'
Backport Emoji changes to share the same (and newer) emojibase data

See merge request GNOME/gtk!3521
2021-05-14 00:42:04 +00:00
Kjartan Maraas dc5fcd28fd Update Norwegian Bokmål translation 2021-05-12 13:10:23 +00:00
Kjartan Maraas 49a14a25b3 Update Norwegian Bokmål translation 2021-05-12 12:52:53 +00:00
Yann Dirson 50889d7629 GtkFileChooserDialog: give a accessible name the GtkFileChooserWidget
Using pyatspi.utils.findDescendant() on the GtkFileChooserDialog using
just a role would return the Dialog, as they have the same "file
chooser" role.  So we have to give it a name to distinguish between
them.
2021-05-11 19:34:00 +02:00
Yann Dirson 9673b5a749 GtkFileChooserWidget: give accessible names to GtkStack children
Now that an AT can request apparition of the Location field, this
allows to locate it in the a11y tree.
2021-05-11 19:34:00 +02:00
Yann Dirson 50cbb8f9a2 GtkFileChooserWidget: export a11y action "show_location"
Note that this changes the accessible role of the widget to "file
chooser" instead of "filler".
2021-05-11 19:34:00 +02:00
Yann Dirson 813965fbc5 GtkFileChooserWidget: add a couple of accessible names in .ui file 2021-05-11 19:34:00 +02:00
Quentin PAGÈS 42a69cce2a Update Occitan translation 2021-05-10 19:56:15 +00:00
Emmanuele Bassi 51198cb1e9 Merge branch 'mg/iterator' into 'gtk-3-24'
Hoist iterator variable definition outside of for loop

See merge request GNOME/gtk!3527
2021-05-07 12:27:07 +00:00
Mosè Giordano fa68804a5b Hoist iterator variable definition outside of for loop
This is compliant with pre-C99 standard.
2021-05-07 12:47:05 +01:00
Emmanuele Bassi ae0c559c21 Merge branch 'mg/macosx-version-max-allowed' into 'gtk-3-24'
Fix value of `MAC_OS_X_VERSION_MAX_ALLOWED`

See merge request GNOME/gtk!3526
2021-05-07 11:14:18 +00:00
Mosè Giordano 0e14822a22 Fix value of MAC_OS_X_VERSION_MAX_ALLOWED 2021-05-07 11:46:47 +01:00
Marco Trevisan (Treviño) 3177a3b42b emoji: Update data to CLRD v39
This is based on version 6.2.0 of emojibase, containing CLRD 39

http://cldr.unicode.org/index/downloads/cldr-39
https://github.com/milesj/emojibase/blob/b3c9a78/packages/data/CHANGELOG.md
2021-05-06 16:04:25 +02:00
Marco Trevisan (Treviño) 247ed3d14a gtkemojichooser: Use retrocompatible format for saving recent-emoji
Given that the format changed, not to break current user history we can
keep using the old format for saving and reading the emoji-recent
gsettings key, by converting the new data to the old one at save time.

We loose information about the short name (not really relevant), even it
could be saved using the first keyword, but this isn't really relevant.
2021-05-06 16:04:25 +02:00
Marco Trevisan (Treviño) a1aecd26d5 gtk: Include emoji data when using autotools and msvc build systems
Differently from the meson case, here we just include the emoji data
files into the global gresources file, get_emoji_data() supports this
and it's just easier to handle in these build systems.
2021-05-06 16:03:11 +02:00
Marco Trevisan (Treviño) accb8e3173 emoji: Use a portable and configuration-dependent path to load the data
Load the emojis data in all the platforms, respecting the configured
GTK_DATA_PREFIX
2021-05-06 15:57:50 +02:00
Matthias Clasen 1a4e368c7e Redo the handling of Emoji data
Use the data files from https://github.com/milesj/emojibase.git
as source for our Emoji data. Slightly change our data format by
adding a group to each item, in both the Emoji data and in the
setting for recent-emoji.

Install translated versions of the data as separate resource
bundles in $prefix/gtk-4.0/emoji, and load them when appropriate.

Currently, we have data for de, en, es, fr, zh, with data taken
from Unicode 13 and CLDR 13.

Fixes: #950 #1511
2021-05-06 15:36:27 +02:00
Matthias Clasen 100ee4ce16 Emoji: Drop the shortname field from emoji.data
Match the name for Emoji completion, and display
it too. 'man worker' looks a lot more natural in
the UI than ':man_worker:'.
2021-05-06 05:22:27 +02:00
Matthias Clasen 32e972e95b Do case-folding and tokenization when creating emoji.data
We can avoid doing the extra work of case-folding and
tokenization whenever we filter in the Emoji chooser.
2021-05-06 05:22:27 +02:00
Matthias Clasen 78cc9113c1 emoji: Add keywords to the data
And use them for matching in the Emoji chooser.
2021-05-06 05:22:26 +02:00
Matthias Clasen cb32ff5b18 emoji: Some work on the conversion tool
Document the variant format, and write out json
format if asked to.
2021-05-06 05:22:26 +02:00
Matthias Clasen bfad7693bf emojichooser: Allow inserting multiple Emoji
Don't close the Emoji chooser when the Control
key is held while clicking. So you can insert
multiple Emoji without having to reopen the
chooser every time.

Fixes: #1002
2021-05-06 05:22:26 +02:00
Matthias Clasen 71bcecbc8d emoji chooser: Fix handling of no recent Emoji
If the recent section is empty, we want to hide
it, make its button insensitive, and select the
next section, initially. This was not working
properly, since nothing was ever setting the
section box to invisible.
2021-05-06 05:22:26 +02:00
Marco Trevisan (Treviño) 30835d7a86 gtkemojichooser: Do not leak the data loaded from resources
This was part of commit 67e6d1087 but not of gtk3 branch in commit
9cde2186.
2021-05-06 05:22:26 +02:00
Matthias Clasen 0fc99afa25 Merge branch 'wl-phys-transform-3-24' into 'gtk-3-24'
gdk/wayland: Take transform into account when setting physical size

See merge request GNOME/gtk!3517
2021-05-05 18:38:34 +00:00
Guido Günther 8c0b11998d gdk/wayland: Take transform into account when setting physical size
Width and height of a GdkMonitor are derived via wl_output which
talks about physical dimensions of a device and compositors usually
implement this as the untransformed values (e.g. weston, wlroots).

Since the GTK client has no way to figure out if a monitor was rotated,
transform the physical dimensions according to the applied wayland
transform to have the physical dimensions match the logical ones.

Mutter flips the physical dimensions itself but doesn't announce the
transform so this shouldn't break anything there.
2021-05-05 18:09:07 +02:00
Matthias Clasen fa70d08387 Merge branch 'quartz-drag-crash' into 'gtk-3-24'
Ensure gdk_quartz_drag_source freed on all paths.

See merge request GNOME/gtk!3498
2021-05-04 16:17:13 +00:00
John Ralls a6c3887736 Ensure gdk_quartz_drag_source freed on all paths.
New release function _gdk_quartz_drag_source_context_destroy_gtk_only
gets called when drag fails to start or is cancelled as well as
when it successfully completes.
2021-05-04 08:33:56 -07:00
Matthias Clasen 414cd74d20 Merge branch 'mesa.win32-3.24' into 'gtk-3-24'
gdkglcontext-win32.c: Fix running with Mesa drivers

See merge request GNOME/gtk!3482
2021-05-02 22:43:30 +00:00
Мирослав Николић 27dad4b90a Update Serbian translation 2021-05-01 14:37:55 +00:00
Pawan Chitrakar c721959d31 Update Nepali translation 2021-04-30 04:56:42 +00:00
Timm Bäder bf4290a330 Merge branch 'wip/hadess/box-guards' into 'gtk-3-24'
box: Fix guards not working

See merge request GNOME/gtk!3485
2021-04-29 15:03:02 +00:00
Chun-wei Fan 1b1dee86a5 gdkglcontext-win32.c: Fix running with Mesa drivers
Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL on Windows using the Mesa drivers.
2021-04-29 12:17:58 +08:00
Bastien Nocera 44aa328dc3 box: Fix guards not working
The guards weren't working because we were accessing data inside the
arguments before checking them. Postpone data access until after the
guards.

0x00007ffff741203c in gtk_box_pack (box=box@entry=0x0, child=0xe0b1b0, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0, pack_type=pack_type@entry=GTK_PACK_START)
    at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:1530
1530	  GtkBoxPrivate *private = box->priv;
(gdb) bt
 #0  0x00007ffff741203c in gtk_box_pack (box=box@entry=0x0, child=0xe0b1b0, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0, pack_type=pack_type@entry=GTK_PACK_START)
     at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:1530
 #1  0x00007ffff741223c in gtk_box_pack_start (box=box@entry=0x0, child=<optimized out>, expand=expand@entry=0, fill=fill@entry=0, padding=padding@entry=0)
     at /usr/src/debug/gtk3-3.24.28-2.fc34.x86_64/gtk/gtkbox.c:2179
2021-04-28 23:44:20 +02:00
Jordi Mas e024a542b0 Update Catalan translation 2021-04-25 21:47:01 +02:00
Pawan Chitrakar 8d87d1b2a4 Update Nepali translation 2021-04-25 16:19:17 +00:00
Matthias Clasen 77f32a69c0 3.24.29 2021-04-22 22:47:50 -04:00
Matthias Clasen 1dc428dc3e Fix distcheck 2021-04-22 22:47:16 -04:00
Matthias Clasen 9b0eec55aa Merge branch 'listbox-extend' into 'gtk-3-24'
Allow GtkListBox multiple selection to be extended repeatedly

See merge request GNOME/gtk!3459
2021-04-23 02:47:05 +00:00
Matthias Clasen d6c45d0e17 imcontext: Fix cursor positions
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.

Fixed: #3885
2021-04-22 21:33:59 -04:00
John Renner 42d4e6de51 Fix extend selection behavior in ListBox 2021-04-22 16:30:12 -07:00
Matthias Clasen 5e673e94de Merge branch 'icon-browser-icon' into 'gtk-3-24'
iconbrowser: Don't use a nonexistent icon

See merge request GNOME/gtk!3466
2021-04-22 10:59:51 +00:00
Matthias Clasen b1a34e0b0c Merge branch 'gtk3-compose-modifiers' into 'gtk-3-24'
imcontextsimple: Ignore more modifiers in compose (gtk3)

See merge request GNOME/gtk!3469
2021-04-22 10:57:02 +00:00
Ulli Kehrle d3a564d4f9 imcontextsimple: Ignore more modifiers in compose
Previously it was impossible to compose characters on higher levels of
some keyboard layouts as pressing the level selection key would just
exit compose mode.

Examples for affected keyboard layouts include the Latvian
apostrophe-variant "lv(apostrophe)" (latched third level), the extended
German keyboard layout "de(e1)" (latched fifth level) as well as the
multilingual Canadian keyboard layout "ca(multix)" and the German
neo-layout "de(neo)" and its descendants (shifted fifth level).

To reproduce, set a compose key and select the Latvian apostrophe layout.
Notice that you now can input [ by pressing first the ' and then the 8-key.
Then pressing <compose>'8'8 should produce ⟦, but prior to this patch it
did not.
2021-04-22 03:53:49 +02:00
Matthias Clasen a7a10aa63f iconbrowser: Don't use a nonexistent icon
We don't have this icon, so don't put it in the
desktop file, or tools will get upset.
2021-04-21 15:16:43 -04:00
Matthias Clasen 8bbaa7d092 Merge branch 'wip/oholy/placesview-default-location-regression-gtk-3-34' into 'gtk-3-24'
placesview: Open location even if mount was not found

See merge request GNOME/gtk!3465
2021-04-21 15:36:39 +00:00
Ondrej Holy 4fe7b3ec25 placesview: Open location even if mount was not found
Some locations have to be mounted, but their mounts are not user-visible
(e.g. smb-browse). Though this is maybe a bit weird, it is how it works
for years. The problem is that the commit 267ea755, which tries to get the
default location for opening, caused regression as it doesn't expect such
possibility. Before this commit, such locations were opened without any
issue, but nothing happens currently after clicking to "Connect" except of
clearing the "Connect to Server" entry. Let's fallback to the original
location if the mount was not found to fix this regression.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1811
2021-04-21 15:33:34 +02:00
Matthias Clasen ca6794b2d8 Merge branch 'untrusted-beep-3' into 'gtk-3-24'
x11: Don't beep on untrusted displays

See merge request GNOME/gtk!3462
2021-04-21 10:12:19 +00:00
Matthias Clasen 9c84f7645e x11: Don't beep on untrusted displays
This can trigger BadAccess, and we don't
want that.

Fixes: #3862
2021-04-20 21:41:48 -04:00
Matthias Clasen c714739759 Merge branch 'fix-uri-crash-3' into 'gtk-3-24'
Fix a possible crash in gtk_show_uri

See merge request GNOME/gtk!3458
2021-04-19 23:25:15 +00:00
Matthias Clasen 536da7a15c Fix a possible crash in gtk_show_uri
g_file_get_basename can return NULL.
Deal with it somehow.

Fixes: #3883
2021-04-19 16:52:55 -04:00
Matthias Clasen 191433bf0a Merge branch 'fix-non-overlay-scrollbars-3' into 'gtk-3-24'
scrolledwindow: Always add other scrollbar size...

See merge request GNOME/gtk!3456
2021-04-19 19:21:53 +00:00
Timm Bäder 25879ea37e scrolledwindow: Always add other scrollbar size...
... if we're not using indicators and the policy may be visible. Not
doing this if the policy may be invisible is incorrect as we need to
reserve the space anyway in case the scrolledwindow is allocated at
minimum size and the child size increases to show the scrollbar.
2021-04-19 14:43:01 -04:00
Matthias Clasen 610f52b125 Merge branch 'cocoa-access-header' into 'gtk-3-24'
Add a public header for Cocoa access functions.

See merge request GNOME/gtk!3450
2021-04-17 00:28:16 +00:00
John Ralls 242b76a771 Add a public header for Cocoa access functions.
Some applications need to access gdk_quartz_window_get_nsview,
gdk_quartz_window_get_nswindow, and gdk_quartz_event_get_nsevent
so move these from the private gdkquartz-gtk-only.h to a new
header gdkquartz-cocoa-access.h. Don't include this header in
gdkquartz.h so that user code that doesn't need to access these
functins isn't required to compile with Objective C/C++.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/1737
2021-04-16 16:56:55 -07:00
Matthias Clasen 3a70781d40 Merge branch 'fix_elcapitan_support' into 'gtk-3-24'
Fix building on OS X El Capitan 10.11

See merge request GNOME/gtk!3402
2021-04-16 20:02:09 +00:00
Matthias Clasen 399356833d Merge branch 'cups-local-printer-2.2-only' into 'gtk-3-24'
Don't try to create local cups printers before CUPS 2.2

See merge request GNOME/gtk!3448
2021-04-16 19:45:11 +00:00
John Ralls 3d53204c75 Don't try to create local cups printers before CUPS 2.2
Not supported on earlier versions.
2021-04-16 12:17:11 -07:00
Matthias Clasen 3aa742d715 overlay: Clarify pass-through docs
Explain that widgets with their own windows need to
have gdk_window_set_pass_through called on them.

Fixes: #3861
2021-04-16 11:15:05 -04:00
Matthias Clasen a1aa4a970d Merge branch 'latest.glib.msvc-3' into 'gtk-3-24'
GTK-3.x: Fix builds against latest stable GLib with Visual Studio

See merge request GNOME/gtk!3445
2021-04-16 12:37:52 +00:00
Matthias Clasen a0a18a7b02 Merge branch 'pre.c99' into 'gtk-3-24'
gtkimcontextsimple.c, updateiconcache.c: Fix build on older compilers

See merge request GNOME/gtk!3444
2021-04-16 12:12:56 +00:00
Chun-wei Fan b69790a776 gtkimcontextsimple.c: Declare variables at top-of-block
This way, things will continue to build on older compilers
2021-04-16 15:38:17 +08:00
Chun-wei Fan da651ca7fc update-icon-cache.c: Declare variables at top-of-block
This way, things will continue to build on older compilers
2021-04-16 15:36:58 +08:00
Chun-wei Fan 35fee660ff gtkcsscustomgadget.c: Fix build with latest stable GLib with MSVC
This eliminates the C4098 warnings ('void' function returning a value),
which is considered by GLib-2.68.x or later to be an error.
2021-04-16 15:28:28 +08:00
Chun-wei Fan 416e6b9cdd gdkglcontext-win32.c: Avoid C4715 warning
We can just group the code for the desktop GL codepath and the EGL
codepath a bit so that we can just have a single location where we
return TRUE upon a successful setup of our WGL/EGL context, and avoid
the C4715 warning that is considered an error when building with
GLib-2.68.x or later using Visual Studio, when we are building without
EGL support.
2021-04-16 15:08:41 +08:00
Matthias Clasen 915d0b39a9 Merge branch 'im-context-event-leak-3' into 'gtk-3-24'
imcontext: Eat key events during preedit

See merge request GNOME/gtk!3442
2021-04-15 22:21:51 +00:00
Matthias Clasen d9a3e07b7f Merge branch 'demo-manpages-3.24' into 'gtk-3-24'
[3.24] meson: only build demo manpages when demos are enabled

See merge request GNOME/gtk!3439
2021-04-15 22:17:22 +00:00
Matthias Clasen a926f217d7 imcontext: Eat key events during preedit
Avoid passing through random key press or release
events while we are showing preedit. That prevents
'accidents' like typing Ctrl-. bringing up the
Emoji chooser during preedit, or hitting Ctrl-a
after the Compose key moving the 'dot' around in
vim in terminals.
2021-04-15 17:46:19 -04:00
Matthias Clasen 4334f9613b Merge branch 'x11-quiet-exit-3' into 'gtk-3-24'
x11: Be quiet on exit by default

See merge request GNOME/gtk!3437
2021-04-14 10:50:24 +00:00
Eli Schwartz ae5a29be4f meson: only build demo manpages when demos are enabled
Installing them even when manpages are enabled, but the demos are
disabled, produces manpages for unavailable programs...
2021-04-13 22:48:39 -04:00
Matthias Clasen c3503fcc84 x11: Be quiet on exit by default
The condition we check for to catch X servers going away
may not be accurate anymore, and the warning shows up in
logs, causing customers to be concerned. So, be quiet by
default, unless the user explicitly asked for a message.
2021-04-13 20:42:21 -04:00
Matthias Clasen 222c6c66ab Merge branch 'fontchooser-since-fix' into 'gtk-3-24'
fontchooser: Fix some since annotations

See merge request GNOME/gtk!3428
2021-04-12 05:07:44 +00:00
Matthias Clasen 3fb5890e69 fontchooser: Fix some since annotations
The "level", "font-features" and "language" were annotated
with the wrong version.

Fixes: #1830
2021-04-11 23:22:46 -04:00
Matthias Clasen 5b13ae1b2e Merge branch 'ebassi/hvbox-docs' into 'gtk-3-24'
docs: Remove any reference to GtkGrid in Gtk[HV]Box

See merge request GNOME/gtk!3422
2021-04-11 13:14:33 +00:00
Matthias Clasen 728d6cd538 Merge branch 'fix-scale-critical' into 'gtk-3-24'
scale: Fix sporadic criticals

See merge request GNOME/gtk!3421
2021-04-11 13:14:21 +00:00
Emmanuele Bassi 3377dc7d40 docs: Remove any reference to GtkGrid in Gtk[HV]Box
GtkBox is not going away, so there's not point in making things more
confusing for those who are still porting their code from GTK2 to GTK3
10 years after GTK 3.0 was released.

Fixes: #3854
2021-04-10 23:57:03 +01:00
Matthias Clasen eaabc3722e scale: Fix sporadic criticals
gtk_css_node_update_layout_attributes can cause us to
free priv->layout, and then bad things happen. Therefore,
we must call that function on a new layout *before* setting
priv->layout.
2021-04-10 10:07:55 -04:00
Matthias Clasen 3cfd1e1f52 Merge branch 'ceo_of_programming-gtk-3-24-patch-54089' into 'gtk-3-24'
Fix typo on gtklistbox.c's docs

See merge request GNOME/gtk!3418
2021-04-10 12:59:12 +00:00
CEO of Programming 475a4c8262 Update gtklistbox.c 2021-04-10 01:04:05 +00:00
Pawan Chitrakar 8b74d5f966 Update Nepali translation 2021-04-09 17:41:07 +00:00
Pawan Chitrakar b7cb281879 Update Nepali translation 2021-04-09 17:13:05 +00:00
Matthias Clasen 550b7fe8b2 Merge branch 'font-settings-fallback' into 'gtk-3-24'
wayland: Improve font setting fallback more

See merge request GNOME/gtk!3409
2021-04-07 18:58:21 +00:00
Matthias Clasen dfea8c31d9 wayland: Improve font setting fallback more
We may get a response from the portal that contains
no useful settings at all. In that case, we should
fallback as well.

Fixes: #3838
2021-04-07 14:30:48 -04:00
Matthias Clasen c3280c6b3c Merge branch 'font-settings-fallback' into 'gtk-3-24'
wayland: Improve font setting fallback

See merge request GNOME/gtk!3406
2021-04-07 14:04:12 +00:00
Matthias Clasen a3ff6e279c wayland: Improve font setting fallback
When we don't get stettings from the portal, the current
fallback is 'awful fonts'. There is no need for that. Instead,
set the fallback values to grayscale antialiasing with slight
hinting.
2021-04-07 08:43:08 -04:00
René de Hesselle 8627a9a569 Fix building on OS X El Capitan 10.11
The preprocessor directives for proper OS version support are missing
their last digit, rendering the checks defunct.

Improves on https://gitlab.gnome.org/GNOME/gtk/-/issues/3592 but does
not fully fix as other issues have surfaced down the line.
2021-04-05 22:20:25 +02:00
Chao-Hsiung Liao d03bf414ce Update Chinese (Taiwan) translation 2021-04-04 00:10:24 +00:00
Nathan Follens 98bf543af2 Update Dutch translation 2021-04-02 14:20:15 +00:00
Matthias Clasen 6a60ce7cd4 Merge branch 'us-intl-compose-for-3' into 'gtk-3-24'
Revert Compose sequence changes

See merge request GNOME/gtk!3387
2021-04-01 20:51:31 +00:00
Matthias Clasen ed9b3f5057 Revert Compose sequence changes
This was breaking muscle memory of people with
the us intl keyboard layout, for important keys
such as '. The unfortunate side-effect is that
our handling of <dead_acute> is a bit hampered
by sequences that don't fit the pattern. But
such is life.

Fixes: #3807
2021-04-01 15:52:12 -04:00
Carlos Garnacho 0ec077bcdc Merge branch 'wip/exalm/overshoot-changes-gtk3' into 'gtk-3-24'
scrolledwindow: Cancel overshoot on dimension changes

See merge request GNOME/gtk!3333
2021-04-01 12:14:10 +00:00
Alexander Mikhaylenko 27d38eca9a scrolledwindow: Cancel overshoot on dimension changes
If we scroll down in a list that's still being filled, we hit the edge and
initiate overshoot, and then the adjustment's upper value increases. This
leads to an unwanted bounce back.

Additionally, if in a similar situation the upper value decreases, the
overscroll glow gets stuck.

Update kinetic scrolling upper and lower value on changes, and immediately
cancel it if dimensions on that side change.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3752
2021-04-01 16:37:03 +05:00
Jonas Ådahl 4ac8889d64 Merge branch 'issue3791' into 'gtk-3-24'
gdk/wayland: Defer processing of globals closures

See merge request GNOME/gtk!3357
2021-03-30 13:40:17 +00:00
Robert Mader 86ef0e6094 gdk/wayland: Defer processing of globals closures
... until all globals have been received.

The dependency tracking introduced in 4e9be39518 only allows to
specify required globals and processes the closures as soon as
the requirements have been met. There are, however, also optional
dependencies - most notably the primary_selection protocol.
Currently we rely on the fact that compositors like Mutter announce
it before `wl_seat`, even though the order is not specified in
the spec.

Process globals closures only after all globals have been announced,
so optional dependencies can be accommodated.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/3791
2021-03-30 15:10:04 +02:00
Matthias Clasen 9a2382bebc Merge branch 'spinbutton-localized-digits-3' into 'gtk-3-24'
spinbutton: Interpret localized digits

See merge request GNOME/gtk!3369
2021-03-30 02:37:41 +00:00
Matthias Clasen fa69e5f42d spinbutton: Interpret localized digits
Interpret input where the characters have numeric values.

See #3387
2021-03-29 22:10:06 -04:00
Matthias Clasen 162243c7ce Merge branch 'fix-large-text-3' into 'gtk-3-24'
label: Fix reacting to screen resolution changes

See merge request GNOME/gtk!3368
2021-03-30 01:28:37 +00:00
Matthias Clasen 316aa85b8d label: Fix reacting to screen resolution changes
Labels were not reacting when the screen resolution
changes, as e.g. when turning "Large Text" on of off.
2021-03-29 20:48:15 -04:00
Matthias Clasen ba8c18019d imcontext: Look for Compose file in the right place
The documentation states that GTK will load a Compose
file from ~/.config/gtk-3.0/Compose. Unfortunately,
backports changed this unintentionally to look in
the gtk-4.0 directory. Change it back.
2021-03-29 18:31:23 -04:00
Anders Jonsson d8fb8db37c Update Swedish translation 2021-03-27 21:11:16 +00:00
Matthias Clasen 71c64e650d Merge branch 'gtk-3-24-minimize-no-decorations' into 'gtk-3-24'
GDK quartz: Keep window without decoration miniaturizable

See merge request GNOME/gtk!3281
2021-03-27 03:32:07 +00:00
Matthias Clasen 23db350889 3.24.28 2021-03-26 21:54:29 -04:00
Matthias Clasen 3c6d96980f Fix make dist 2021-03-26 21:54:29 -04:00
Matthias Clasen 4c7944175f Merge branch 'double-dead-keys-3' into 'gtk-3-24'
Double dead keys 3

See merge request GNOME/gtk!3354
2021-03-27 01:11:20 +00:00
Matthias Clasen 8c7846733a imcontext: Tweak dead key handling
Reshuffle things to allow for a limited amount of
dead key 'chaining'. We keep up to 2 dead keys in
the preedit, so you can type
<dead_acute> <dead_cedilla> <c>
to produce ḉ, while still getting ```c with
<dead_grave> <dead_grave> <dead_grave> <c>.
2021-03-26 20:42:24 -04:00
Matthias Clasen 58b3145c90 composetable: Limit algorithmic checking
Only check for combinations of up to 2 dead keys with
a base character. We don't want to spend ages generating
all permutations of long sequences.
2021-03-26 20:28:14 -04:00
Matthias Clasen da7a511aa2 Merge branch 'fix-ding-119' into 'gtk-3-24'
cssshadowvalue: Apply device scale to the offset when blurring text

See merge request GNOME/gtk!3343
2021-03-24 11:24:21 +00:00
Daniel van Vugt 86da4e0c97 cssshadowvalue: Apply device scale to the offset when blurring text
Although the surface already has the device scale set, that doesn't
apply to the offset which is in raw device units. So we need to scale
the device offset explicitly.

Fixes: https://gitlab.com/rastersoft/desktop-icons-ng/-/issues/119
2021-03-24 18:37:12 +08:00
Matthias Clasen c22d4a6657 Merge branch 'issue3715-gtk3' into 'gtk-3-24'
[gtk3] x11/dnd: Ignore XErrors from the COW

See merge request GNOME/gtk!3335
2021-03-22 15:05:01 +00:00
Olivier Fourdan 39db784704 x11/dnd: Ignore XErrors from the COW
The DnD code for X11 adds the composite overlay window (aka COW) to the
cache.

Yet the X11 requests to get and release the COW may trigger XErrors that
we ought to ignore otherwise the client will abort.

Fixes: #3715
2021-03-22 15:35:13 +01:00
Matthias Clasen 0f5ae95460 Merge branch 'better-dead-keys-3' into 'gtk-3-24'
Better dead keys 3

See merge request GNOME/gtk!3330
2021-03-22 02:48:30 +00:00
Matthias Clasen 59397005fa Regenerate compose sequence file
Update our compose sequences based on the current
update xorg Compose.pre file. Beyond that, remove
some deadkey sequences that we are now handling
(better) in code.
2021-03-21 22:11:37 -04:00
Matthias Clasen 41c3e9873c Move compose related tooling to a subdir
This reduces the clutter in gtk/.
2021-03-21 22:11:27 -04:00
Matthias Clasen 7b3c387af9 compose-parse: Add a negative lookaside
Make this script parse gtk-compose-remove.txt for
sequences to remove from the xorg Compose file.
This will be used for removing some deadkey combinations
that we can handle better in code.

Also, make this script explicitly python2. I tried
porting it to python3, but gave up in the end.
2021-03-21 22:11:16 -04:00
Matthias Clasen a0cdd25bd4 imcontext: Improve dead key handling more
For sequences like ``, we want to commit the first
deadkey and then continue preedit with the second.

The alternative is to do chained deadkeys, where
entering ~~a yields ̃̀̃̃a. But we don't do that, and
I think that would be more controversial.
2021-03-21 22:09:56 -04:00
Matthias Clasen c26525f87c imcontext: Improve dead key handling
For sequences like `x, where we don't have a compose
sequence, we still want to commit "`x", and not silently
eat the keys.
2021-03-21 22:09:41 -04:00
Марко Костић 5b0a14410d Update Serbian translation 2021-03-19 06:31:48 +00:00
Matthias Clasen f1f5cbd88e Merge branch 'fix-wayland-keyboard-layout' into 'gtk-3-24'
wayland: Pass layout information in key events

See merge request GNOME/gtk!3302
2021-03-15 19:57:34 +00:00
Matthias Clasen 1ce5494ffd wayland: Pass layout information in key events
We were always setting group to 0, causing accelerator
interpretation to always go off the first configured
layout, not the active one.

Fixes: #1825
2021-03-15 14:48:05 -04:00
Matthias Clasen 5edac966e4 Merge branch 'ebassi/reproducible-icon-cache' into 'gtk-3-24'
Reproducible icon cache

See merge request GNOME/gtk!3293
2021-03-13 18:07:01 +00:00
Bernhard M. Wiedemann 850768270f updateiconcache: Sort list of entries
because filesystem readdir order is indeterministic.

Without this patch, building openSUSE's balsa package
had variations between builds in /usr/share/balsa/icon-theme.cache

(cherry picked from commit b364827a5b)
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2021-03-13 15:12:18 +00:00
Matthias Clasen c7df3b9e97 3.24.27 2021-03-12 10:41:57 -05:00
Matthias Clasen b94955e614 Merge branch 'gdk-win32-use-window-from-point-api' into 'gtk-3-24'
GdkWin32: Fix mouse events in presence of transparent windows on the desktop

See merge request GNOME/gtk!2767
2021-03-11 01:10:20 +00:00
Cédric Krier 238bb38249 Keep window without decoration miniaturizable
Closes #2345
2021-03-10 16:08:14 +01:00
Tim Sabsch c8dbe02850 Update German translation 2021-03-08 17:59:25 +00:00
Tim Sabsch 84337f7758 Update German translation 2021-03-08 17:47:11 +00:00
Rūdolfs Mazurs a3c8214fb5 Update Latvian translation 2021-03-07 18:44:43 +00:00
Matthias Clasen 9216fe2cc0 Merge branch 'fix-wintab-whlrot-gtk-3-24' into 'gtk-3-24'
WinTab - Add support for Wheel/Rotation axis

See merge request GNOME/gtk!3249
2021-03-06 19:26:45 +00:00
Changwoo Ryu 60a714a25f Update Korean translation 2021-03-06 18:11:19 +00:00
Knuckx d7d6098281 WinTab - Add support for Wheel/Rotation axis - Rebase and fix conflicts for merge 2021-03-05 23:35:29 +00:00
Matthias Clasen 79757da2a9 Merge branch 'fix-label-link-activate' into 'gtk-3-24'
label: Skip updating link state if we have no layout

See merge request GNOME/gtk!3262
2021-03-05 20:30:38 +00:00
Timm Bäder bfe0f7dd4d label: Skip updating link state if we have no layout
This can happen whenever the ::activate-link handler sets different
markup on the label, causing all links to be recreated. In this case,
the GtkLabelLink* passed to emit_activate_link is garbage after the
g_signal_emit call and we shouldn't try to do anything with it.

Fixes #1498
2021-03-05 14:56:20 -05:00
Steven Calwas 86d38e6ae2 Fix window unresponsive to mouse after app-switch w/drawing tablet
Partially fixes issue #2191 regarding switching to another app while
hovering a stylus over a drawing tablet causes subsequent mouse
clicks in the app to be ignored. I was not able to reproduce the
other behavior described in #2191 concerning tiling a window.
2021-03-05 14:37:29 -05:00
Matthias Clasen b64d888288 Merge branch 'wip/exalm/window-shadow-dark-3' into 'gtk-3-24'
Adwaita: Use transparent black for window border in dark too

See merge request GNOME/gtk!3260
2021-03-05 19:35:26 +00:00
Matthias Clasen 94befed65f Merge branch 'issue1549' into 'gtk-3-24'
Handle Wintab cursors that are recognized after GDK app init

See merge request GNOME/gtk!2458
2021-03-05 18:53:42 +00:00
Alexander Mikhaylenko d70fa89bdf Adwaita: Use transparent black for window border in dark too
Avoid smear when the background behind the window is dark. Adjust opacity
to make it appear roughly the same as before on white background.
2021-03-05 22:43:49 +05:00
Matthias Clasen 782bbca52c Merge branch 'mutter-css-crash-fix' into 'gtk-3-24'
Adwaita: Ensure SSD decorations do not change size when losing focus

See merge request GNOME/gtk!3256
2021-03-05 15:47:08 +00:00
Sebastian Keller 392e52187d Adwaita: Ensure SSD decorations do not change size when losing focus
56f6ac5f introduced a 20px shadow for the '.tiled decoration:backdrop'
selector. This selector is more specific than the '.ssd decoration'
selector and caused unfocused tiled SSD windows to have a shadow that
focused ones did not have. The mutter code however assumes that the size
of the decoration does not change between the states and this was
causing a crash when clicking below the titlebar in unfocused tiled SSD
windows.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3716
2021-03-05 00:36:15 +01:00
Matthias Clasen 57cc7dce81 Merge branch 'wip/exalm/scroll' into 'gtk-3-24'
Revert "Add scaling adjustment for touch dragging a scrolled window"

See merge request GNOME/gtk!3251
2021-03-03 12:00:14 +00:00
Alexander Mikhaylenko d0cf3007c6 Revert "Add scaling adjustment for touch dragging a scrolled window"
This reverts commit d4943ef2fb.

This commit has broken scrolling in GtkTreeView. VTE has
`scroll-unit-pixels` property now, so the original issue is fixed
separately.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3707
2021-03-03 15:04:41 +05:00
Baurzhan Muftakhidinov 48768bd3ae Update Kazakh translation 2021-03-02 03:38:08 +00:00
Matthias Clasen 19b8013618 Merge branch 'fix-leak-of-event-structures' into 'gtk-3-24'
GdkWin32: fix leak of event structures

See merge request GNOME/gtk!3245
2021-03-02 00:37:32 +00:00
Luca Bacci fa2ae10599 Fix leak of event structures
Inside generate_button_event, if _gdk_input_ignore_core is > 0 we
leak an event structure. Fix that.
2021-03-01 10:51:38 +01:00
Emin Tufan Çetin 48de9796c2 Update Turkish translation 2021-02-25 14:26:26 +00:00
Sabri Ünal fcd083af14 Update Turkish translation 2021-02-25 13:48:29 +00:00
Źmicier Turok 88eaffc207 Update Belarusian translation 2021-02-25 09:29:42 +00:00
Źmicier Turok 85315ea457 Update Belarusian translation 2021-02-25 09:13:07 +00:00
Matthias Clasen 5ec5359981 Merge branch 'libreoffice-input-fix' into 'gtk-3-24'
imcontext: Fixes to the state machine

See merge request GNOME/gtk!3239
2021-02-24 22:27:57 +00:00
Matthias Clasen 7b6f627666 imcontext: Fixes to the state machine
It turns out that we we were sometimes emitting
preedit-end multiple times, and sometimes not at
all. Same for preedit-start. To fix this up, introduce
a in_compose_sequence flag, maintain it, and use it
in the right places.

After these changes, both

C-S-u 1 2 3 Enter
Compose a e

generate the right signals:

preedit-start, preedit-changed,..., preedit-end, commit
2021-02-24 14:15:33 -05:00
Matthias Clasen 953d35b225 3.24.26 2021-02-24 14:13:46 -05:00
Fran Dieguez 659b23b7c6 Updated Galician translations 2021-02-24 01:53:47 +01:00
Emmanuele Bassi 1a878b2b88 docs: Fix closing tag
The XML validator took way too long.
2021-02-23 19:25:42 +00:00
Emmanuele Bassi b189d842dd docs: Remove mentions of decommissioned services
We don't use Bugzilla or mailing list any more.
2021-02-23 17:37:00 +00:00
Chun-wei Fan 22391f42b8 Visual Studio projects: Set GTK_HOST appropriately
This will make GTK_HOST defined more like what it is on Meson builds, so that
we set the host string appropriately according to the build that is being
carried out, instead of defaulting to i686-pc-vsXX for all builds.

Like the previous commit on win32/config-msvc.mak.in, this now sets GTK_HOST
to be:

i686-pc-vsXX for 32-bit x86 builds
x86_64-pc-vsXX for x64 builds
aarch64-pc-vsXX for ARM64 builds (requires VS2017 15.9.x or later)
2021-02-23 17:48:53 +08:00
Chun-wei Fan c3b9f56121 win32/gtk-introspection-msvc.mak: Prepare for ARM64 builds
Currently, introspection is not well-supported for ARM64 Windows builds as:

* There is no official Python release for ARM64 Windows, but it is currently
  possible to build it with sufficient support for G-I, however...

* The tooling in Python still needs to be updated to enable ARM64 Windows
  builds for use with g-ir-scanner and friends, and...

* Introspection builds must be done on an ARM64 system, since we are running a
  dumper binary to generate the .gir files

This will attempt to prepare things for building GTK's introspection files on
Windows ARM64, but will require a custom installation of Python as noted above,
for the time being
2021-02-23 17:48:53 +08:00
Chun-wei Fan 07e06fb4dd win32/config-msvc.mak: Don't hardcode GTK_HOST to i686-pc-vsXX
Instead, rely on the mechanism that we already have to set the platform string
appropriately, eg:

i686-pc-vsXX for 32-bit x86 builds
x86_64-pc-vsXX for x64 builds
aarch64-pc-vsXX for arm64 builds
2021-02-23 17:48:53 +08:00
Chun-wei Fan 935691f94c win32/detectenv-msvc.mak: Add linker flag for ARM64
This prepares things better for ARM64 (aarch64) Windows builds, to make things
more complete and comparable to x64 and x86 builds.
2021-02-23 17:48:53 +08:00
Źmicier Turok 4d6f110ca2 Update Belarusian translation 2021-02-23 09:11:08 +00:00
Źmicier Turok 9227d9c30f Update Belarusian translation 2021-02-23 09:09:40 +00:00
Chun-wei Fan 508036f745 Visual Studio 201x projects: Fix generating gtk+-win32-3.0.pc
The copy command to copy gtk+-win32-3.0.pc from gtk+-3.0.pc was mistakenly
done to copy gtk+-3.0.pc two times.  Oops... :|
2021-02-23 16:39:32 +08:00
Ask Hjorth Larsen 9c9805dff8 Revert "Updated Danish translation"
Update applies only to other branch

This reverts commit 8b0001876b.
2021-02-23 01:30:56 +01:00
Ask Hjorth Larsen 8b0001876b Updated Danish translation 2021-02-23 01:26:19 +01:00
Matthias Clasen ef340ea616 Merge branch 'compose-warning-3' into 'gtk-3-24'
imcontext: Take out the warnings

See merge request GNOME/gtk!3231
2021-02-22 21:06:26 +00:00
Matthias Clasen db1cb04896 imcontext: Take out the warnings
Don't warn about Compose file constructs we don't
support. We haven't supported these for a long time,
and nobody has every complained. No need to wake
up sleeping dogs.
2021-02-22 15:18:25 -05:00
Emin Tufan Çetin 4f81b5cd91 Update Turkish translation 2021-02-21 18:05:31 +00:00
Emin Tufan Çetin f297e9198d Update Turkish translation 2021-02-21 18:02:23 +00:00
Emin Tufan Çetin b56ce02e0c Update Turkish translation 2021-02-21 18:00:49 +00:00
Emin Tufan Çetin aae92380a1 Update Turkish translation 2021-02-21 13:39:39 +00:00
Emmanuele Bassi c06a593b57 Merge branch 'type-int-cairo-format' into 'gtk-3-24'
Use the proper cairo.Format type instead of overriding to gint via annotations...

See merge request GNOME/gtk!3228
2021-02-20 11:49:11 +00:00
Sebastian Dröge ac69c05a31 Use the proper cairo.Format type instead of overriding to gint via annotations in gdk_window_create_similar_surface() 2021-02-20 12:43:53 +02:00
Matthias Clasen bfe201d70a Merge branch 'unintrusive-compose-preedit-3' into 'gtk-3-24'
sUnintrusive compose preedit 3

See merge request GNOME/gtk!3223
2021-02-18 23:55:28 +00:00
Matthias Clasen 1282cac99d imwayland: Be careful about cursor positions
We don't want to hand out cursor positions based on
the original preedit text and then tweak the text to
be different.
2021-02-18 15:44:21 -05:00
Matthias Clasen 784b236964 Merge branch 'unintrusive-compose-preedit-3' into 'gtk-3-24'
Unintrusive compose preedit 3

See merge request GNOME/gtk!3221
2021-02-18 18:41:37 +00:00
Matthias Clasen f8206f18b1 imwayland: Tweak preedit text
Tweak the preedit text we get from IBus (via the compositor) to
match what GtkIMContextSimple produces for Compose sequences now.

This provides a unified experience.
2021-02-18 13:14:31 -05:00
Matthias Clasen 523d5121d3 imcontext: Make Compose preedit less intrusive
Tweak the preedit display for Compose sequences to
be not so distracting. We only show the Compose key
when it occurs in the middle of the sequence or is
the only key so far, and use · instead of ⎄ for it.

Also, make sure to display dead keys more adequately.
2021-02-18 12:38:22 -05:00
Matthias Clasen a048da02d5 Merge branch 'wip/carlosg/font-settings-lookups-3-24' into 'gtk-3-24'
gdk/wayland: Look for font settings recursively (3.24)

See merge request GNOME/gtk!3219
2021-02-18 17:18:19 +00:00
Carlos Garnacho 4d30400987 gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:51:28 +01:00
Matthias Clasen f56a5ee260 Merge branch 'wip/jimmac/tiled-resize-area-gtk3' into 'gtk-3-24'
Adwaita: control surface for resize tiled windows

See merge request GNOME/gtk!3212
2021-02-17 03:53:55 +00:00
Matthias Clasen 891d4e9da3 Merge branch 'imcontext-modifier-intent' into 'gtk-3-24'
imcontextsimple: Bring back modifier intent

See merge request GNOME/gtk!3213
2021-02-17 03:40:22 +00:00
Matthias Clasen 8780cde919 imcontextsimple: Bring back modifier intent
This was lost by accident in 85d34932f3.
2021-02-16 19:31:17 -05:00
Jakub Steiner 56f6ac5fcc Adwaita: control surface for resize tiled windows
- window resizing control area is implemented as where the shadows are drawn
    - create a 'fake' shadow for the tiled case to allow easier resizing of
      the tiled window ratio even if it's offset to the side of the border

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3670
2021-02-16 14:23:12 +01:00
Matthias Clasen 03b97b0a8b Merge branch 'wip/jimmac/scrollbars-fine-tune-fix-gtk3' into 'gtk-3-24'
Adwaita: Avoid fine-tune scrollbars jumping

See merge request GNOME/gtk!3210
2021-02-16 12:26:13 +00:00
Jakub Steiner 3d30790280 Adwaita: Avoid fine-tune scrollbars jumping
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3672
2021-02-16 11:41:57 +01:00
Charles Monzat 20ecaaa0e1 Update French translation 2021-02-16 08:52:37 +00:00
Matthias Clasen b201438b39 Merge branch 'wip/jimmac/larger-smaller-scrollbar-gtk3' into 'gtk-3-24'
Adwaita: Scrollbar transitions and size

See merge request GNOME/gtk!3205
2021-02-15 18:08:20 +00:00
Carlos Garnacho dca64da1fe Merge branch 'touch-scroll-scale' into 'gtk-3-24'
Add scaling adjustment for touch dragging a scrolled window

See merge request GNOME/gtk!2615
2021-02-15 17:27:26 +00:00
Jakub Steiner ca34428d17 Adwaita: Scrollbar transitions and size
- tone down the size of the controller again
 - transition between the indicator and control fluidly

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1886
2021-02-15 13:45:21 +01:00
Matthias Clasen 5f13ee0afe Merge branch 'lenient-compose-parsing-3' into 'gtk-3-24'
Lenient compose parsing 3

See merge request GNOME/gtk!3202
2021-02-14 20:35:40 +00:00
Matthias Clasen d11cde0c1c imcontext: Be more lenient in parsing Compose
X11 allows keysyms to be specified in addition to strings.
We only support the strings. In the past, we ignored everything
after the string. Go back to doing that, but issue a warning
that we've ignored the keysym.
2021-02-14 13:03:50 -05:00
Matthias Clasen 052b7d0ca7 Merge branch 'fix-compose-comments-for-3' into 'gtk-3-24'
imcontext: Fix a regression in Compose file parsing

See merge request GNOME/gtk!3200
2021-02-14 17:45:22 +00:00
Matthias Clasen 22960c5c20 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back.

Fixes: #3664
2021-02-14 12:10:09 -05:00
Balázs Meskó d68898a033 Update Hungarian translation 2021-02-14 00:11:21 +00:00
Matthias Clasen 5c6aa76979 3.24.25 2021-02-12 10:45:40 -05:00
Matthias Clasen abefce0961 Fix distcheck 2021-02-12 10:24:27 -05:00
Matthias Clasen 2ca1fe61a4 Merge branch 'frame-request-api' into 'gtk-3-24'
wayland/window: Add API to overwrite surface frame requests

See merge request GNOME/gtk!3111
2021-02-12 12:46:37 +00:00
Robert Mader d3316a37ed wayland/window: Add API to add extra surfaces for frame callbacks
This is useful when clients use subsurfaces independently of GDK.
For example if a client creates a subsurface that covers a GdkWindow
entirely. If this subsurface is opaque, Wayland compositors may not
emit callbacks for the surface of the GdkWindow any more.
Adding the covering subsurface via this new API ensures the
GdkWindow will continue to update in this case.
2021-02-12 13:18:29 +01:00
Matthias Clasen 6fd951e53d Merge branch 'wip/jimmac/tiled-shadow-fix-fix-gtk3' into 'gtk-3-24'
Adwaita: Bring back borders of tiled windows

See merge request GNOME/gtk!3185
2021-02-11 17:03:24 +00:00
Jakub Steiner 35adc7ed04 Adwaita: Bring back borders of tiled windows
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3661
2021-02-11 15:24:59 +01:00
Matthias Clasen 52eb7b23cb Merge branch 'wip/jimmac/fix-maximized-shadows-gtk3' into 'gtk-3-24'
adwaita: disable shadows when window is maximized, fullscreen, tiled

See merge request GNOME/gtk!3179
2021-02-10 19:20:37 +00:00
Jakub Steiner 6f4ebce914 adwaita: disable shadows when window is maximized, fullscreen, tiled
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-10 18:18:10 +01:00
Matthias Clasen 40295441d1 Merge branch 'fix-imcontext-crash' into 'gtk-3-24'
Fix imcontext crash

See merge request GNOME/gtk!3174
2021-02-09 23:37:27 +00:00
Matthias Clasen d2fe033c21 imcontextsimple: Fix a crash
In the backport, I inadvertendly removed the
set_client_window implementation, which needs
to remain.
2021-02-09 18:11:38 -05:00
Matthias Clasen e3c03e98f9 Merge branch 'im-context-work-for-3' into 'gtk-3-24'
imcontext: Backport compose sequence improvements

See merge request GNOME/gtk!3172
2021-02-09 02:00:00 +00:00
Matthias Clasen 85d34932f3 imcontext: Backport compose sequence improvements
Improve compose sequence handling:
- Show preedit for compose seqences
- Support sequences of up to 20 code points
- Warn when ignoring Compose file features
- Support compose sequences producing multiple characters
- Support hex escapes
2021-02-08 20:28:49 -05:00
Matthias Clasen a0818f5bae Merge branch 'gtk-3-24' into 'gtk-3-24'
printing: Create temporary queues for Avahi printers (Gtk 3)

See merge request GNOME/gtk!3161
2021-02-07 16:14:05 +00:00
Marek Kasik de3e97309f printing: Show all Avahi advertised printers
This commit unsubscribes CUPS backend from a DBus
signal in idle when listening for new items on Avahi.

Since GDBus emits gathered signals in idle while
checking whether the signal has been unsubscribed
it could happen that a signal was not processed
because it was removed from hash table of
subscribed signals.
This caused the situation where printers advertised
on Avahi were not listed in CUPS backend sometimes.

We need those signals since this happens when switching
from a general subscription which listens to signals
for all Avahi services to a specific one which listens
to just _ipp._tcp and _ipps._tcp (chicken and egg problem).
2021-02-05 18:57:19 +01:00
Marek Kasik d07bfbec1d printing: Create temporary queues for Avahi printers
This change extends set of Avahi advertised printers which
works with Gtk's CUPS print backend.

It creates a temporary queue (local printer) for each
Avahi printer in CUPS instead of accessing them directly
(via CUPS library).

This makes some printers work which did not work before and
also gives users more options to change in the print dialog.

This also changes naming of printers to be in accordance with CUPS.
It uses '_' instead of '-' and has hostname appended for CUPS remote
printers.
2021-02-05 18:57:19 +01:00
Matthias Clasen 89f3273651 Merge branch 'uac.meson.3' into 'gtk-3-24'
Meson: Avoid UAC on 32-bit Windows for gtk-update-icon-cache

See merge request GNOME/gtk!3147
2021-02-03 15:42:32 +00:00
Chun-wei Fan a612a42c11 Meson: Avoid UAC on 32-bit Windows for gtk-update-icon-cache
As the program executable name has 'update' in its filename,
gtk-update-icon-cache.exe is considered to be an installer program on 32-bit
Windows [1], which will cause the program to fail to run unless it is running
with elevated privileges (i.e. UAC).

Avoid this situation by embedding a manifest file into the final executable
that tells Windows that this is not a program that requires elevation.

Also make the autotools build files dist the new script and use the new script
to generate the manifest and rc files, instead of hardcoding the generating
bits in gtk/Makefile.am

Fixes issue #3632.

[1]: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709628(v=ws.10)?redirectedfrom=MSDN,
under section "Installer Detection  Technology"
2021-02-03 14:56:07 +08:00
Jonas Ådahl ddb9bae3d4 Merge branch 'gtk-surface-release-3-24' into 'gtk-3-24'
Support gtk-shell surface release destructor

See merge request GNOME/gtk!2074
2021-01-29 16:21:09 +00:00
Matthias Clasen a8c12a4c96 Merge branch 'gtk-3-24' into 'gtk-3-24'
Adds support for Android/Chrome on-screen keyboard

See merge request GNOME/gtk!3130
2021-01-29 00:59:15 +00:00
Maxim Zakharov b31a80cd64 Adds support for Android/Chrome on-screen keyboard
Adds event listener for input events; converts input data into
key press and key release commands depending on inputType of the event.
2021-01-29 11:23:51 +11:00
Matthias Clasen 6748c7116d Merge branch 'wip/jimmac/larger-scrollbars' into 'gtk-3-24'
Adwaita: make scrollbars larger

See merge request GNOME/gtk!3110
2021-01-25 13:42:16 +00:00
Jakub Steiner d13b9f797a Adwaita: make scrollbars larger
When using scrollbars as active controls, rather than their primary role as indicators,
increase their size as click targets.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1886
2021-01-25 14:15:14 +01:00
Fabio Tomat 0b1ca619a7 Update Friulian translation 2021-01-21 06:42:25 +00:00
Bruce Cowan 16ac1a12fc Update British English translation 2021-01-18 20:34:32 +00:00
Jordi Mas 6fee66a9aa Update Catalan translation 2021-01-18 20:51:57 +01:00
Matthias Clasen aec4dc9387 Merge branch 'gtk_dbg_interactive_gtk3_backport' into 'gtk-3-24'
Allow GTK_DEBUG=interactive even without G_ENABLE_DEBUG defined

See merge request GNOME/gtk!3090
2021-01-18 19:41:25 +00:00
vanadiae 0a9e2d6ed7 gtk-debug: Allow interactive debug even without G_ENABLE_DEBUG
Currently when GTK3 is compiled without G_ENABLE_DEBUG, the inspector
can't be opened with GTK_DEBUG=interactive because it doesn't parse
this env var without G_ENABLE_DEBUG.

Since the inspector is always good to have, this commit now always
parses the GTK_DEBUG env var but only keep the "interactive" flag if
G_ENABLE_DEBUG isn't defined.
2021-01-18 18:35:50 +01:00
Марко Костић 395b30dcfe Update Serbian translation 2021-01-16 13:31:17 +00:00
Matthias Clasen 326d101a57 Merge branch 'wip/carlosg/mark-valid-portal-settings-3-24' into 'gtk-3-24'
gdk/wayland: Mark matched settings from the portal as valid (3.24)

See merge request GNOME/gtk!3077
2021-01-14 18:31:57 +00:00
Carlos Garnacho 02a02fac56 gdk/wayland: Mark matched settings from the portal as valid
Commit e6209de962 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.
2021-01-14 16:09:27 +01:00
Carlos Garnacho 7ab4c9a68b Merge branch 'fix-tablet-3.24' into 'gtk-3-24'
Wayland: Fix segfault when receiving tablet/touch events for surfaces that have already been destroyed client-side

See merge request GNOME/gtk!2809
2021-01-10 13:18:15 +00:00
wisp3rwind 19a740e277 Wayland: ignore touch/tablet events on destroyed surfaces
When destroying a wl_surface (e.g. when a window or menu is closed), the
surface may continue to exist in the compositor slightly longer than on
the client side. In that case, the surface can still receive input
events, which need to be ignored gracefully.
In particular, this prevents segfaulting on wl_surface_get_user_data()
in that situation.

Reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3296

The same issue for pointers/keyboards was reported in
https://bugzilla.gnome.org/show_bug.cgi?id=693338

and fixed with in
bfd7137ffb
3625f17857
a8fc099a72
2021-01-10 12:00:28 +01:00
Carlos Garnacho cae5e60113 Merge branch 'avoid-pointer-reset' into 'gtk-3-24'
wayland: avoid set_cursor() when unchanged or invisible

See merge request GNOME/gtk!2822
2021-01-06 19:53:30 +00:00
Matthias Clasen c87b21351c Merge branch 'workaround-win32-intel-blit' into 'gtk-3-24'
gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues

See merge request GNOME/gtk!2996
2021-01-06 16:13:02 +00:00
Matthias Clasen f25a5f21fc Merge branch 'gtk-3-24' into 'gtk-3-24'
fix touchscreen events processing in broadway.js

See merge request GNOME/gtk!2972
2021-01-06 16:10:08 +00:00
Fran Dieguez bda6c5ec2b Update Galician translation 2021-01-04 23:07:05 +00:00
Fabio Tomat 51cef47835 Update Friulian translation 2020-12-31 10:24:55 +00:00
Chun-wei Fan f8b7bd6dd6 Fix 'make dist' again
The autotools pattern rules can be off-putting...
2020-12-28 22:11:08 +08:00
Źmicier Turok 72b047b084 Update Belarusian translation 2020-12-27 07:29:47 +00:00
Źmicier Turok 72eb09f8e8 Update Belarusian translation 2020-12-27 07:27:34 +00:00
Chun-wei Fan 7647208fba Try again to fix 'make dist'
It turns out that we must put Directory.Build.props in win32/vs10 and let
automake copy it over to win32/vs15/... so do that, and only dist the copy
in win32/vs15.
2020-12-24 18:10:16 +08:00
Chun-wei Fan 8f325b475b win32/Makefile-newvs.am: Fix 'make dist'
We need to account for the lack of Directory.Build.props in win32/vs10...
2020-12-24 17:05:10 +08:00
Chun-wei Fan ac7dd63b02 Visual Studio projects: Support arm64/aarch64 builds better
Update the NMake Makefiles used for generating the various sources be able to
cope with an ARM64 build environment, and update the project files, in
particular for Visual Studio 2017 (VisualStudioVersion 15.0) so that we can
pull in the system .lib's that were somehow excluded from the default list
on ARM64 builds.

Also, add a custom Directory.Build.props in win32/vs15 so that we do not
try to build with the Windows 8.1 SDK by defualt, which is not ready for ARM64
builds, but instead uses the appropriate Windows 10 SDK that supports this.

Update the README.win32 file to give people instructions on how ARM64 builds
can be carried out.
2020-12-24 16:27:58 +08:00
Chun-wei Fan a7b93d62d5 Visual Studio Projects: Improve search for Harfbuzz headers
Look in the include/harfbuzz directory that is under the pre-defined prefix
directory, as Pango 1.44.x and later pulled in HarfBuzz headers for all builds
2020-12-24 13:57:28 +08:00
Chun-wei Fan 985e17772b Visual Studio projects: Do not hardcode gdbus-codegen path
Instead, use the $(GDBUS_CODEGEN) NMake Makefile variable, so that it may be
overridden if needed
2020-12-24 13:48:36 +08:00
Danial Behzadi 856fb75413 Update Persian translation 2020-12-23 15:23:18 +00:00
Emmanuele Bassi 138f104fa4 Merge branch '324.c89' into 'gtk-3-24'
Fix gtk-3-24 builds on older C89-esque compilers

See merge request GNOME/gtk!2995
2020-12-23 13:45:28 +00:00
Chun-wei Fan 79e512ab0b gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues
Intel OpenGL drivers have an issue where the results of a series of
glBlitFramebuffer() can delay updating the display, when we use GDK_GL=always,
which is manifested when attempting to enter text in text boxes.

This attempts to work around this issue by requiring a glFlush() call and a
retry to the same glBlitFramebuffer() calls to avoid delays in keystrokes when
using GDK_GL=always and when not using libANGLE OpenGL/ES emulation, when an
Intel OpenGL driver is being used.

Special thanks to Lukas K. for the analysis and coming up with a workaround,
which this patch builds upon.

Fixes issue 3487
2020-12-23 19:01:31 +08:00
Chun-wei Fan 91343251b9 gtk/fallback-c89.c: Add fallback for fmin()
fmin() is a function that is introduced with C99/C++11, so check for the
presence of it and provide a simple implementation for it if it does not
exist.

Also update the config.h.win32.in template accordingly, since this
function is provided on Visual Studio 2013 or later.
2020-12-23 12:52:19 +08:00
Chun-wei Fan ecd6b0b9a4 gtk/gtkscrolledwindow.c: Declare variables at top-of-block
This way, the code can be built on C89-esque compilers.
2020-12-23 11:24:34 +08:00
Chun-wei Fan de6498f18c Visual Studio: Use G_ENABLE_DEBUG for all builds
This way, we can enable the built binaries to print out diagnostic
messages as needed by the values we set via the envvar GDK_DEBUG.

The release configs of the Visual Studio project files follow the
settings of Meson's `debugoptimized` build settings.
2020-12-23 10:46:58 +08:00
Matthias Clasen f89aeecc4f Merge branch 'cursor-aspect-ratio-gtk3' into 'gtk-3-24'
Cursor aspect ratio fixes for gtk 3

See merge request GNOME/gtk!2965
2020-12-21 19:26:39 +00:00
sicklylife eec24a0982 Update Japanese translation 2020-12-20 08:02:07 +00:00
sicklylife a4ab1cfebe Update Japanese translation 2020-12-20 07:57:27 +00:00
Maxim Zakharov ba845fa7b2 fix touchscreen events processing in broadway.js
Makes event listeners active explicitly if supported; corrects
handling for deleted surfaces preventing javascript errors in
accessing deleted objects; makes event identifiers unique for
broadwayd when executing in Chrome on Android.

Partially fixes #1493
2020-12-18 12:22:47 +11:00
Sebastian Keller 2a89189f1a textview: Use correct aspect ratio when invaldiating cursor
The size of the cursor depends on either the gtk-cursor-aspect-ratio
GtkSetting or as of the previous commit on the GtkSetting or the
cursor-aspect-ratio style property. GtkTextView was only considering the
style property.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller 0165cce645 stylecontext: Add style property fallback for gtk-cursor-aspect-ratio
The gtk-cursor-aspect-ratio GtkSetting was only recently introduced and
replaced the cursor-aspect-ratio style property. This was causing old
configurations that used CSS to modify this property to no longer apply.
This commit introduces a fallback from the GtkSetting to the style
property if the value of the setting is unchanged.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller 6c5489ab25 settings: Support loading float values from keyfiles
The gtk-cursor-aspect-ratio property got added as a float property.
However there is no parser for float values from keyfiles which meant
that it could not be changed from settings.ini.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Emmanuele Bassi b933d57632 Merge branch 'pixbuf-from-surface-leak' into 'gtk-3-24'
gdkpixbuf-drawable: Free the pixbuf on Cairo error

See merge request GNOME/gtk!2952
2020-12-14 15:40:12 +00:00
Adrien Plazas c4f8eb7ec9 gdkpixbuf-drawable: Free the pixbuf on Cairo error
This avoids leaking the pixbuf.
2020-12-14 16:18:45 +01:00
Jordi Mas 7208c97c7d Update Catalan translation 2020-12-10 16:06:18 +01:00
Matthias Clasen 69e7ab649c Merge branch 'fix-gtk-nautilus-typo' into 'gtk-3-24'
[Gtk3] GtkNativeDialog: Fix a typo in the docs

See merge request GNOME/gtk!2930
2020-12-08 03:21:26 +00:00
Phaedrus Leeds 59dfeaceff GtkNativeDialog: Fix a typo in the docs 2020-12-07 17:17:39 -08:00
Matthias Clasen de8329b3ce 3.24.24 2020-12-05 19:49:26 -05:00
Emmanuele Bassi 4d410489c5 Merge branch 'notebookpage_child' into 'gtk-3-24'
gtknotebookpageaccessible: do not fallback to child accessible for extents

See merge request GNOME/gtk!2924
2020-12-05 00:03:57 +00:00
Samuel Thibault 4ffe5a4954 gtknotebookpageaccessible: do not fallback to child accessible for extents
When the notebook page does not have a label, it should not fallback to
asking its child accessible for extent, since the child might be asking
exactly the converse when it is a socket, thus getting in an infinite
loop. When the page does not have a label, is does not really make sense to
give it an extent anyway.

Fixes atk#18
2020-12-05 00:34:32 +01:00
Carlos Garnacho 850a086adb Merge branch 'wip/exalm/accumulate-scrolling-backport' into 'gtk-3-24'
scrolledwindow: Accumulate velocity with kinetic scrolling

See merge request GNOME/gtk!2818
2020-12-01 13:14:40 +00:00
Kjartan Maraas 76b7f2704c Update Norwegian Bokmål translation 2020-11-30 14:02:18 +00:00
Daniel Șerbănescu b8af685a43 Update Romanian translation 2020-11-20 09:27:14 +00:00
Milo Casagrande 50c4fbff72 Update Italian translation 2020-11-16 08:50:42 +00:00
Matthias Clasen 0bbe4150a8 Merge branch 'button-fill-var-removal-gtk3' into 'gtk-3-24'
Adwaita: Stop using $button_fill (for gtk-3-24)

See merge request GNOME/gtk!2829
2020-11-15 13:45:57 +00:00
nana-4 6da446c1be Adwaita: Stop using $button_fill
The $button_fill hack for button.circular is pretty awkward and is
currently broken. Instead of relying on it, allow the button() mixin to
have an additional background-image optionally.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3354
2020-11-14 13:21:25 +09:00
Jordi Mas 8f44694d2c Update Catalan translation 2020-11-13 20:24:15 +01:00
wisp3rwind cf7f7df10c wayland: avoid set_cursor() when unchanged or invisible
In pointer_surface_update_scale(), only rescale the cursor surface when
the scale has actually changed and the cursor is on at least one output.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3350

Right now, this issue is not completely understood, so it might also
involve some questionable handling of cursor surface by sway/wlroots.

However, irrespective of that issue, this patch avoids unnecessary calls to the
compositor, and there should be no drawback: Whenever the pointer enters
a new output, pointer_surface_update_scale() will be called again, such
that correct scaling of the cursor is still ensured.

There is a slight difference: When the cursor leaves the last output,
previously the image was reset to scale factor 1. Now, it keeps whatever
was last. That might be more sensible than the previous behaviour,
assuming that it's likely that when the cursor enter an output again, it
has the same scaling. Alternatively, if one cares about resource usage
at this level, it might make more sense to destroy the surface then
rescaling to 1.
2020-11-13 16:20:02 +01:00
Chris Lord 1d62a010ef scrolledwindow: Accumulate velocity with kinetic scrolling
Accumulate existing velocity when decelerating from a swipe if the swipe
velocity is above a certain fraction of that existing velocity.
2020-11-12 18:56:14 +05:00
Jakub Steiner 46cf2849d2 Merge branch 'wip/jimmac/sass-fixes-and-render-css' into 'gtk-3-24'
Adwaita: !global vars no longer in sass

See merge request GNOME/gtk!2815
2020-11-12 12:26:16 +00:00
Jakub Steiner 811c7f2266 Adwaita: !global vars no longer in sass
- render changes from dab79f5d77
2020-11-12 13:05:45 +01:00
Jakub Steiner a84b41abfd Merge branch 'treeview-header-button-border-css' into 'gtk-3-24'
Highlight treeview header button border with more contrasting color on hover

See merge request GNOME/gtk!2467
2020-11-12 09:23:06 +00:00
crvi dab79f5d77 Adwaita: Make treeview header button borders more visible
The existing treeview header button border in GTK3 is close to
invisible. The preferred way to find the border for a treeview column
is to hover the mouse near the beginning of the header button text
expecting the default cursor to switch to 'col-resize' cursor. This
works only when all column headers in the view are left aligned. After
adding a few numeric columns to the view, whose headers are right
aligned, it becomes really hard to find the location of the border
between a left aligned and right aligned column header.

This change addresses the issue by using high contrast colors for
borders of treeview header button - in line with the colors used in
Adwaita theme in GTK4.

See merge request GNOME/gtk!2467
2020-11-12 01:37:03 +05:30
Matthias Clasen e792e077fa Merge branch 'wip/dont-set-invalid-xdg-surface-geometry' into 'gtk-3-24'
wayland: Bail loudly if invalid geometry is set

See merge request GNOME/gtk!2808
2020-11-11 15:18:27 +00:00
Luca Bacci 67be62aeaf GdkWin32: Fix mouse events in presence of transparent windows on the desktop
In gdkdevice-win32.c we are interested in knowing which window
receives mouse input at a specific location.

Only WindowFromPoint is the right API for the task, other API's
(such as (Real)ChildWindowFromPoint(Ex)) have shortcomings because
they are really designed for other purposes. For example, only
WindowFromPoint is able to look through transparent layered windows.

So even if we want to find a direct child we have to use
WindowFromPoint and then walk up the hierarchy.

Fixes: #370, #417
See: !2767
2020-11-11 14:34:40 +01:00
Jonas Ådahl ba31560970 wayland: Bail loudly if invalid geometry is set
There is some bug somewhere where the geometry ends up being correct.
Mutter didn't handle this gracefully, and is to be changed to simply
respect the protocol and error out the client that sends bogus data.

Prepare for this by instead of sending bogus data, complain loudly if it
would happen dropping the invalid geometry on the floor instead of
sending it.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1527
2020-11-11 10:17:59 +01:00
Enrico Nicoletto cfd21b0991 Update Brazilian Portuguese translation 2020-11-10 20:41:12 +00:00
Andika Triwidada ebda6125a4 Update Indonesian translation 2020-11-08 12:07:23 +00:00
Matthias Clasen a1757170da Fix a11y test results
The color palette change is reflected in the a11y dump
for the color chooser.
2020-11-07 22:40:41 -05:00
Matthias Clasen 13f6790fdb expander: Documentation update
Document GtkExpander:label-fill as ignored.

Fixes: #3331
2020-11-07 12:03:46 -05:00
kai-berlin bd4b55ddbf broadway: Set modifier state of scroll events
Set modifier state of scroll events, so Ctrl-scroll
works.

Fixes: #2733
2020-11-03 19:43:21 -05:00
Christian Kirbach 2560af284d Update German translation 2020-11-01 14:02:13 +00:00
Matthias Clasen 0f0dad24f4 Fix the build with older pango
pango_font_family_get_face() was only introduced
in pango 1.46. Work around this for older releases.
2020-10-29 22:22:33 -04:00
Matthias Clasen 9536d3aeaa fontchooser: Fix family-only mode
When the level does not include the style, we only
include one face of each family in the list. But we
were just choosing the first face (typically, a light
or extra-light style). Improve this by picking the
default face (normally, the regular face), which is
the expected behavior.
2020-10-29 21:59:24 -04:00
Asier Sarasua Garmendia 9cfda52d22 Update Basque translation 2020-10-29 20:56:33 +00:00
Matthias Clasen 628d94936a Merge branch 'gtk-3-24' into 'gtk-3-24'
gdk: Fix parent relative background crash

See merge request GNOME/gtk!2753
2020-10-27 21:42:34 +00:00
Sam Bazley a91de44755 gdk: Fix parent relative background crash
When setting a window's background to ParentRelative on X11, the window
depths must match to avoid a BadMatch error. Query the X server for the
parent window rather that relying on the parent passed to
gtk_window_new() to prevent crashes with reparented windows.

Fixes: #3288
2020-10-27 18:29:21 +00:00
Luca Bacci 0cb78a9808 GdkW32: remove klassTEMPSHADOW
Fixes issue #2019

See !2749
2020-10-27 18:12:42 +01:00
Jordi Mas i Hernandez d955636da5 Update Catalan translation 2020-10-22 17:57:33 +00:00
Carlos Garnacho f4c366044b Merge branch 'wip/exalm/swipe' into 'gtk-3-24'
gestureswipe: Count last event when calculating velocity

See merge request GNOME/gtk!2714
2020-10-21 16:58:27 +00:00
Alexander Mikhaylenko 847d378fea gestureswipe: Count last event when calculating velocity
The last event, matching lifting the finger/releasing the mouse button,
is important when there's a large delay between it and the previous events,
as in when performing a movement, stopping, then releasing fingers as
opposed to doing a swipe.

If this event is skipped, doing this will result in kinetic deceleration
matching the previous finger movement, while the expected behavior would
be no deceleration.

See also 97f540622a for a similar fix in
GtkEventControllerScroll.
2020-10-21 20:57:30 +05:00
Goran Vidović fab2558747 Update Croatian translation 2020-10-19 16:36:42 +00:00
Emmanuele Bassi 0ac222fab2 Merge branch 'wip/exalm/screensaver' into 'gtk-3-24'
gtkapplication-dbus: Initialise screensaver-active property

See merge request GNOME/gtk!2716
2020-10-19 10:36:01 +00:00
Bob Ham 6f6b5faaa2 gtkapplication-dbus: Initialise screensaver-active property
When GtkApplication starts listening to the screensaver's D-Bus
status, the screensaver-active property is not initialised and
applications making use of the property are out of sync until the
first state change.  Any application starting when the screensaver is
active will think it's inactive.

To fix this, we set the property when we first start monitoring the
screensaver.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1091
2020-10-19 14:51:19 +05:00
Daniel Mustieles ddb7cab4ac Updated Spanish translation 2020-10-19 09:16:03 +02:00
Benjamin Schaaf d4943ef2fb Add scaling adjustment for touch dragging a scrolled window
If a GtkScrollable uses a different scale than pixels the offset from a
drag must be adjusted to match this scale. This fixes issues like this
https://gitlab.gnome.org/GNOME/vte/-/issues/283 where the terminal
widget uses rows instead of pixels as its scale for each GtkAdjustable
thus causing a 1 pixel vertical drag to scroll 1 row.
2020-09-26 03:08:03 +10:00
Steven Calwas 4c10134295 Handle Wintab cursors that are recognized after GDK app init
Previously, a GDK application handled the Wintab cursors (stylus,
eraser, etc.) only during app initialization. If new cursors were
recognized by Wintab during app execution, the app would not know
about them.

This fix still handles Wintab cursors known during app initialization.
In addition, when Wintab recognizes new cursors and notifies the app
via a WT_CSRCHANGE message, the app handles the new cursors, creating
new Wintab device objects for them.

Closes #1549
2020-08-20 22:54:36 -07:00
Emmanuel Gil Peyrot 75a9f8dc92 Switch to GL_ARB_framebuffer_object
GTK+ 3.0 was currently using GL_EXT_framebuffer_object, which is
deprecated as the ARB version has been merged into OpenGL 3.0 as well as
OpenGL ES 2.0, and provides laxer requirements.
2020-06-11 21:24:17 +02:00
Sebastian Keller 9459be11a9 wayland: Signal gtk-shell surface destruction to the server
This adds a "release" destructor for the gtk_surface1 interface which
signals to the server that a surface has been destroyed on the client
side, which the current "destroy" does not do.

Ideally the protocol would have specified a destroy request marked as
destructor to handle this automatically, however this is no longer
possible due to the destroy method being implicitly generated in the
absence of an explicit request in the protocol. Adding a destroy request
marked as destructor now would generate a new destroy method that
unconditionally would send the request to the server, which would break
clients running on servers not supporting that request.
2020-06-11 11:38:21 +02:00
Nelson Benítez León b01f371ce6 FileChooserButton: query 'display name' also for unbookmarked files
Do also the async file info query for remote files when they
are not bookmarked, because otherwise "None" will be shown as
file name (and fallback text generic icon will be used).

The remote file was already browsed by the file chooser
instance when selecting it, so querying the display name
again should be using gio cache and not be slow.

Even if it's were slow it's better than showing 'None'
which makes it seem as if nothing was selected.

Fixes #1966
2020-04-19 14:16:02 -04:00
377 changed files with 84946 additions and 113642 deletions
+3 -1
View File
@@ -36,7 +36,7 @@ fedora-meson:
- "_build/testsuite/reftests/output"
debian-meson:
image: registry.gitlab.gnome.org/gnome/gtk/debian-gtk3:v1
image: registry.gitlab.gnome.org/gnome/gtk/debian-gtk3:v2
stage: build
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
@@ -79,6 +79,8 @@ msys2-mingw64-meson:
name: "gtk3-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
- "_build/gdk/libgdk-3-0.dll"
- "_build/gtk/libgtk-3-0.dll"
msys2-mingw64-autotools:
when: manual
+1 -1
View File
@@ -1,4 +1,4 @@
FROM debian:buster
FROM debian:bullseye
RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
adwaita-icon-theme \
+1 -1
View File
@@ -15,7 +15,7 @@ meson \
-Dx11_backend=true \
-Dwayland_backend=true \
-Dxinerama=yes \
-Dprint_backends="file,lpr,test,cloudprint,cups" \
-Dprint_backends="file,lpr,test,cups" \
${EXTRA_MESON_FLAGS:-} \
_build
+361
View File
@@ -1,3 +1,364 @@
Overview of Changes in GTK+ 3.24.31, 20-12-2021
===============================================
* input:
- Fix a crash with touch on GtkScale
* clipboard:
- Avoid a double-free
* css:
- Avoid a crash with radial gradients
* GtkFileChooser:
- Don't leak search results
* GtkTextView:
- Support css letterspacing
* Wayland:
- Reset position when hiding popups
- Ignore globals we did not bind ourselves
- Avoid infinite loops when hiding surfaces
- Avoid clipboard-related lockups
* X11:
- Trap errors while doing XRANDR calls
- Support touchpad gestures with XI 2.4
* win32:
- Some OpenGL setup fixes
- Fall back to GLES for OpenGL
- Fix MinGW autotools build
- Fix building on Windows 11
- Support building with Visual Studio 2022
- Improve DND across monitors
- Rewrite keymap handling code
* macOS:
- Accept NSPasteboardTypeFileURL drops
- Build on macOS 12
- Fix display on macOS 12
- Fix keyboard layout notifications
- Fix a crash
- Improve performance on Big Sur
* Translation updates:
Basque
Brazilian Portuguese
Chinese (China)
Chinese (Taiwan)
Croatian
Czech
Danish
Dutch
Finnish
French
Friulian
Galician
German
Hungarian
Icelandic
Italian
Kazakh
Korean
Latvian
Occitan
Persian
Russian
Serbian
Spanish
Swedish
Overview of Changes in GTK+ 3.24.30
===================================
* Input:
- Ignore NoSymbol key events (happens with some XKB options)
- Fix incomplete reset in some cases
* GtkEmojiChooser:
- Update data from CLDR 39
- Support translated keywords for multiple languages
- Allow inserting multiple Emoji with Ctrl
- Match keywords for search
- Fix a memory leak
* GtkFileChooser:
- Accessibility improvements
* GtkTreeView
- Fix an accessibility-related memory leak
- Fix assertion failures in some cases
* Printing:
- Remove the Google Cloud Print backend, since the
service was shut down
* Wayland:
- Work with pointer-gestures v1 protocol
* Win32:
- Fix using GL with Mesa drivers
- Add support for Windows Pointer Input stack
* MacOS:
- Fix a crash with Drag-and-Drop
* Translation updates:
Belarusian
Brazilian Portuguese
British English
Catalan
Indonesian
Lithuanian
Nepali
Norwegian Bokmål
Occitan
Portuguese
Romanian
Russian
Serbian
Slovenian
Spanish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.29
===================================
* Input:
- Look for a Compose file in the right place (~/.config/gtk-3.0)
- Revert some Compose sequence changes (mainly around dead
acute and apostrophe)
- Consume all key events during preedit, to avoid unexpected
interactions
- Ignore more modifiers during preedit, to allow using 3rd and
5th level choosers
- Fix handling of cursor positions in non-ASCII preedit text
* GtkSpinButton:
- Interpret localized digits
* GtkScale:
- Fix sporadic criticals
* GtkScrolledWindow:
- Cancel overshoot on size changes
- Avoid criticals with non-overlay scrollbars
* GtkFileChooser:
- Handle smb mounts better
* GtkListBox:
- Fix extending multi-selections
* Fix a possible crash in gtk_show_uri
* Wayland:
- Improve font settings fallback
* X11:
- Avoid log spam on exit
- Don't beep on untrusted displays
* OS X:
- Fix building on OS X 10.11
- Add gdk-quartz-cocoa-access.h with api that provides
access to native objects
* Translation updates:
Dutch
Nepali
Swedish
Overview of Changes in GTK+ 3.24.28
===================================
* Input:
- Improve dead key handling
* CSS:
- Fix rendering of scaled text shadows
* Wayland:
- Fix matching of accelerators with multiple layouts
* X11:
- Trap errors from the COW
* Build:
- Make gtk3-update-icon-cache output reproducible
* Translation updates:
Serbian
Overview of Changes in GTK+ 3.24.27
===================================
* Input: Ensure preedit-start and preedit-end
are emitted properly
* GtkScrolledWindow:
- Revert a change that broke touch scrolling
* Theme:
- Fix a problem with size changes in SSD decorations
that caused mutter crashes
- Use transparent black for window border in the dark theme
* Windows:
- Memory leak fixes
- Fix unresponsive windows after tablet input
- Add support for wheel and rotation axes
* Translation updates:
Belarusian
German
Kazakh
Korean
Latvian
Turkish
Overview of Changes in GTK+ 3.24.26
===================================
* Input:
- Fix a few oversights in Compose file parsing
- Fine-tune Compose preedit display
* Theme:
- Fine-tune scrollbar size and transitions
- Reinstate invisible borders for tiled windows
* Wayland:
- Fix a problem with font settings not being found
* Translation updates
French
Hungarian
Turkish
Overview of Changes in GTK+ 3.24.25
===================================
* Settings:
- Make cursor aspect ratio setting work
* Broadway:
- Fix touchscreen event handling
- Support Android / Chrome on-screen keyboard
* Windows:
- Fix issues with Intel graphics drivers
- Avoid UAC for gtk-update-icon-cache
* Wayland:
- Avoid crashes with tablet input
- Add api to support clients with subsurfaces better
* Inspector:
- Make the inspector available in non-debug builds
* Theme:
- Make scrollbars larger
- Disable shadows on maximized, fullscreen and tiled windows
* Printing:
- Support Avahi-discovered printers better
* Input:
- Show preedit for compose sequences
- Support long compose sequences
- Support compose sequences producing multiple characters
* Translation updates
Belarusian
British English
Catalan
Friulian
Galician
Japanese
Persian
Serbian
Overview of Changes in GTK+ 3.24.24
===================================
* GtkColorChooser:
- Update the default color palette
* GtkFontChooser:
- Fix family-only mode to return regular style
* GtkTreeView:
- Don't set focus-on-click for header buttons
* Accessibility:
- Implement scrollSubstringTo
- Add a11y support to GtkPlug/GtkSocket
* Printing:
- Allow the lpr backend to print pdf and ps files
* Theme:
- Update gesture graphics
- Update HighContrast css
* Wayland:
- Support the primary-selection-unstable-v1 protocol
* X11:
- Fix a crash with parent-relative backgrounds
* Broadway:
- Set modifier state of scroll events
* Build:
- Fix pc file generation on NixOS
* OS X:
- Restore command-key bindings
* Windows:
- Fix meson build with epoxy subproject
* Translation updates:
Basque
Brazilian Portuguese
British English
Catalan
Croatian
Czech
French
Galician
German
Greek
Hebrew
Hungarian
Indonesian
Italian
Kazakh
Latvian
Lithuanian
Persian
Polish
Portuguese
Slovak
Slovenian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.23
===================================
+90 -8
View File
@@ -15,6 +15,8 @@ the same compiler is used for at least GDK-Pixbuf, Pango, atk and glib
so that crashes and errors caused by different CRTs can be avoided. Currently
building with Visual Studio 2008 or later is supported, either via Visual Studio
project files or via the Meson build system, as described in the below sections.
For Visual Studio 2008, 2010, a special setup making use of the Windows 8.0 SDK
is required, see at the bottom of this document for guidance.
Interchanging between Visual Studio 2015, 2017 and 2019 builds should be fine
as they use the same CRT (UCRT) DLLs.
@@ -175,6 +177,27 @@ instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
If desiring to build binaries for ARM64 (aarch64), one needs to use the
Visual Studio 2017 or 2019 solution files, or use Meson with a
cross-compilation file, with a Windows 10 SDK that supports ARM64
builds. At this point, building the introspection files is not supported
for ARM64 builds, and you will need a Python interpreter and
glib-compile-resources binaries that run on the build machine. For Visual Studio
2017 ARM64 builds, do also check the Directory.Build.props file in $(srcroot)/win32/vs15
indicates a Windows 10 SDK version that supports ARM64 builds exists on the build machine.
For building ARM64 binaries with the Visual Studio projects, prior to the build,
you may need to update gtk3-gen-srcs.props to pass in the variables GLIB_MKENUMS,
GLIB_GENMARSHAL, GDBUS_CODEGEN and/or GLIB_COMPILE_RESOURCES in the nmake command line
indicated by <GenerateRequiredSourcesBase> so that they point to the glib-mkenums,
glib-genmarshal, gdbus-codegen and glib-compile-resources that will run on the build
machine. You may also need to update gtk3-version-paths.props to update PythonDir to
the installation of the Python interpreter that will run on the build machine. To carry
out the actual build using the solution files, use the "Configuration Manager" to add the
ARM64 build configs by copying the settings from the x64 configs, and then build the solution.
The build instructions for such builds otherwise follow the standard Win32 (x86) and
x64 builds, but you need to ensure that you have ARM64 builds of the various dependencies.
3) Using Meson (for Visual Studio and MinGW builds)
---
@@ -265,6 +288,73 @@ If you are building with Visual Studio 2008, note the following items as well:
- The more modern visual style for the print dialog is not applied for Visual
Studio 2008 builds. Any solutions to this is really appreciated.
Support for pre-2012 Visual Studio
==================================
This release of GTK+ requires at least the Windows 8.0 SDK in order to be built
successfully using Visual Studio, which means that building with Visual Studio
2008 or 2010 is possible only with a special setup and must be done in the
command line with Ninja. Please see
https://devblogs.microsoft.com/cppblog/using-the-windows-software-development-kit-sdk-for-windows-8-consumer-preview-with-visual-studio-2010/
for references; basically, assuming that your Windows 8.0 SDK is installed in
`C:\Program Files (x86)\Windows Kits\8.0` (`$(WIN8SDKDIR)` in short), you need
to ensure the following before invoking Meson to configure the build:
- Your `%INCLUDE%` must not include the Windows 7.0/7.1 SDK include directories,
and `$(WIN8SDKDIR)\include\um`, `$(WIN8SDKDIR)\include\um\share` and
`$(WIN8SDKDIR)\include\winrt` (in this order) must be before your stock
Visual Studio 2008/2010 header directories. If you have the DirectX SDK installed,
you should remove its include directory from your `%INCLUDE%` as well.
- You must replace the Windows 7.0/7.1 SDK library directory in `%LIB%` with the
Windows 8.0 SDK library directory, i.e. `$(WIN8SDKDIR)\lib\win8\um\[x86|x64]`.
If you have the DirectX SDK installed, you should remove its library directory
from your `%INCLUDE%` as well.
- You must replace the Windows 7.0/7.1 SDK tools directory from your `%PATH%` with
the Windows 8.0 SDK tools directory, i.e. `$(WIN8SDKDIR)\bin\[x86|x64]`.
If you have the DirectX SDK installed, you should remove its utility directory
from your `%PATH%` as well.
The Windows 8.0 SDK headers may contain an `roapi.h` that cannot be used under plain
C, so to remedy that, change the following lines (around lines 55-57):
// RegisterActivationFactory/RevokeActivationFactory registration cookie
typedef struct {} *RO_REGISTRATION_COOKIE;
// RegisterActivationFactory/DllGetActivationFactory callback
to
// RegisterActivationFactory/RevokeActivationFactory registration cookie
#ifdef __cplusplus
typedef struct {} *RO_REGISTRATION_COOKIE;
#else
typedef struct _RO_REGISTRATION_COOKIE *RO_REGISTRATION_COOKIE; /* make this header includable in C files */
#endif
// RegisterActivationFactory/DllGetActivationFactory callback
This follows what is done in the Windows 8.1 SDK, which contains an `roapi.h`
that is usable under plain C. Please note that you might need to copy that file
into a location that is in your `%INCLUDE%` which precedes the include path for the
Windows 8.0 SDK headers, if you do not have administrative privileges.
Visual Studio 2008 hacks
========================
- You need to run the following lines from your build directory, to embed the
manifests that are generated during the build, assuming the built binaries
are installed to `$(PREFIX)`, after a successful build/installation:
```cmd
> for /r %f in (*.dll.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f (PREFIX)\bin\%~nf;2
> for /r %f in (*.exe.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f (PREFIX)\bin\%~nf;1
```
- If building for amd64/x86_64/x64, sometimes the compilation of sources may seem to hang, which
is caused by an optimization issue in the 2008 x64 compiler. You need to use Task Manager to
remove all running instances of `cl.exe`, which will cause the build process to terminate. Update
the build flags of the sources that hang on compilation by changing its `"/O2"` flag to `"/O1"`
in `build.ninja`, and retry the build, where things should continue to build normally.
Using GTK+ on Win32
===================
@@ -281,13 +371,5 @@ cases, but not in general. Sorry. If you have all GTK+ and GDK calls
in the same thread, it might work. Otherwise, probably not at
all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit is
no longer required. The wintab.h header file is bundled with GTK+
sources. Unfortunately it seems that only Wacom tablets come with
support for the Wintab API nowadays.
--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
--Updated by Fan, Chun-wei <fanc999@yahoo.com.tw>
+6
View File
@@ -44,6 +44,9 @@
/* Define to 1 if you have the `flockfile' function. */
#mesondefine HAVE_FLOCKFILE
/* Define to 1 if you have the `fmin' function. */
#mesondefine HAVE_FMIN
/* Define to 1 if you have the <ftw.h> header file. */
#mesondefine HAVE_FTW_H
@@ -241,6 +244,9 @@
/* Define to 1 if XInput 2.2 is available */
#mesondefine XINPUT_2_2
/* Define to 1 if XInput 2.4 is available */
#mesondefine XINPUT_2_4
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
+13
View File
@@ -52,6 +52,11 @@
/* Define to 1 if you have the `flockfile' function. */
#undef HAVE_FLOCKFILE
/* Define to 1 if you have the `fmin' function. */
#if !defined (_MSC_VER) || (_MSC_VER >= 1800)
# define HAVE_FMIN 1
#endif
/* Define to 1 if you have the <ftw.h> header file. */
/* #undef HAVE_FTW_H */
@@ -139,6 +144,11 @@
#define HAVE_ROUND 1
#endif
/* Define to 1 if SetupDiGetDevicePropertyW() is available */
#ifdef _MSC_VER
#define HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W 1
#endif
/* Define to 1 if sincos() is available */
/* #undef HAVE_SINCOS */
@@ -290,6 +300,9 @@
/* Define to 1 if XInput 2.2 is available */
/* #undef XINPUT_2_2 */
/* Define to 1 if XInput 2.4 is available */
/* #undef XINPUT_2_4 */
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
+41 -47
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [23])
m4_define([gtk_interface_age], [19])
m4_define([gtk_micro_version], [31])
m4_define([gtk_interface_age], [27])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -439,7 +439,8 @@ fi
PKG_PROG_PKG_CONFIG
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version wayland-protocols >= wayland_protocols_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
WAYLAND_RUNTIME_DEPENDENCIES="wayland-client >= wayland_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
WAYLAND_DEPENDENCIES="wayland-protocols >= wayland_protocols_required_version $WAYLAND_RUNTIME_DEPENDENCIES"
if test "$enable_wayland_backend" = "maybe" ; then
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
PKG_CHECK_EXISTS($WAYLAND_DEPENDENCIES, [have_wayland_deps=yes], [have_wayland_deps=no])
@@ -460,7 +461,7 @@ if test "$enable_wayland_backend" = "yes"; then
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_WAYLAND"
backend_immodules="$backend_immodules,wayland"
WAYLAND_PACKAGES="$WAYLAND_DEPENDENCIES"
WAYLAND_PACKAGES="$WAYLAND_RUNTIME_DEPENDENCIES"
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
AS_IF([test "x$WAYLAND_SCANNER" = "xno"],
[AC_MSG_ERROR([Could not find wayland-scanner in your PATH, required for parsing wayland extension protocols])])
@@ -843,7 +844,7 @@ AC_TYPE_UID_T
# Check for round(), rint(), isnan() and isinf()
# Check for log2(), exp2(), nearbyint() and trunc()
AC_CHECK_LIB(m,round,,)
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc)
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc fmin)
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
AC_MSG_CHECKING(whether to build dynamic modules)
@@ -1166,13 +1167,23 @@ if test "x$enable_x11_backend" = xyes; then
AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
have_xinput2_2=no,
[[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"
if test "x$have_xinput2_2" = "xyes"; then
X_EXTENSIONS="$X_EXTENSIONS XI2.2"
else
X_EXTENSIONS="$X_EXTENSIONS XI2"
fi
AC_CHECK_MEMBER([XIGesturePinchEvent.type],
have_xinput2_4=yes
AC_DEFINE(XINPUT_2_4, 1, [Define to 1 if XInput 2.4 is available]),
have_xinput2_4=no,
[[#include <X11/extensions/XInput2.h>]])
if test "x$have_xinput2_4" = "xyes"; then
X_EXTENSIONS="$X_EXTENSIONS XI2.4"
fi
LIBS="$gtk_save_LIBS"
fi
AS_IF([test "x$have_xinput2" != "xyes"],
@@ -1394,17 +1405,35 @@ fi
##################################################
# Check for harfbuzz and pangoft2
##################################################
PKG_CHECK_MODULES(GTK_FONT_CHOOSER_WIDGET,
harfbuzz >= 0.9 pangoft2,
harfbuzz >= 2.2.0 pango >= 1.44.0,
build_font_demo=yes,
build_font_demo=no)
PKG_CHECK_MODULES(GTK_FONT_CHOOSER_WIDGET_FT,
harfbuzz >= 0.9 pangoft2,
build_font_demo_ft=yes,
build_font_demo_ft=no)
if test "x$build_font_demo" = xno; then
if test "x$build_font_demo_ft" = xyes; then
build_font_demo=yes
else
build_font_demo=no
fi
fi
AM_CONDITIONAL(BUILD_FONT_DEMO, [ test "x$build_font_demo" = xyes ])
if test "x$build_font_demo" = xyes; then
AC_DEFINE([HAVE_HARFBUZZ], 1, [defines whether we have HarfBuzz])
AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2])
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_CFLAGS"
GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_LIBS"
if test "x$build_font_demo_ft" = xyes; then
AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2])
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_FT_CFLAGS"
GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_FT_LIBS"
else
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_CFLAGS"
GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_LIBS"
fi
fi
if $PKG_CONFIG --exists x11; then
@@ -1576,38 +1605,6 @@ fi
AM_CONDITIONAL(HAVE_TRACKER3, test "x$have_tracker3" = "xyes")
# Checks to see if we should compile with cloudprint backend for GTK+
#
AC_ARG_ENABLE(cloudprint,
[AS_HELP_STRING([--disable-cloudprint],
[disable cloudprint print backend])],,
[enable_cloudprint=auto])
if test "x$enable_cloudprint" = "xno"; then
AM_CONDITIONAL(HAVE_CLOUDPRINT, false)
else
PKG_CHECK_MODULES(REST, [rest-0.7], have_rest=yes, have_rest=no)
PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0], have_json_glib=yes, have_json_glib=no)
if test "x$have_rest" = "xyes" -a "x$have_json_glib" = "xyes"; then
PRINT_BACKENDS="$PRINT_BACKENDS cloudprint"
have_cloudprint=yes
fi
AM_CONDITIONAL(HAVE_CLOUDPRINT, test "x$have_cloudprint" = "xyes")
fi
if test "x$enable_cloudprint" = "xyes" -a "x$have_rest" = "xno"; then
AC_MSG_ERROR([
*** rest not found.
])
fi
if test "x$enable_cloudprint" = "xyes" -a "x$have_json_glib" = "xno"; then
AC_MSG_ERROR([
*** json-glib not found.
])
fi
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
@@ -1650,9 +1647,6 @@ fi
if test "$have_papi" != "yes" -a "$have_cups" != "yes"; then
GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,lpr"
fi
if test "$have_cloudprint" = "yes"; then
GTK_PRINT_BACKENDS="$GTK_PRINT_BACKENDS,cloudprint"
fi
AC_SUBST(GTK_PRINT_BACKENDS)
################################################################
@@ -1975,6 +1969,7 @@ win32/vs12/Makefile
win32/vs14/Makefile
win32/vs15/Makefile
win32/vs16/Makefile
win32/vs17/Makefile
gdk/Makefile
gdk/broadway/Makefile
gdk/x11/Makefile
@@ -1994,7 +1989,6 @@ modules/Makefile
modules/input/Makefile
modules/printbackends/Makefile
modules/printbackends/cups/Makefile
modules/printbackends/cloudprint/Makefile
modules/printbackends/lpr/Makefile
modules/printbackends/file/Makefile
modules/printbackends/papi/Makefile
+3 -75
View File
@@ -1,87 +1,15 @@
## Makefile.am for gtk+/demos
include $(top_srcdir)/Makefile.decl
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos_base = \
application_demo.c \
assistant.c \
builder.c \
button_box.c \
changedisplay.c \
clipboard.c \
colorsel.c \
combobox.c \
css_accordion.c \
css_basics.c \
css_blendmodes.c \
css_multiplebgs.c \
css_pixbufs.c \
css_shadows.c \
cursors.c \
dialog.c \
drawingarea.c \
editable_cells.c \
entry_buffer.c \
entry_completion.c \
event_axes.c \
expander.c \
filtermodel.c \
fishbowl.c \
foreigndrawing.c \
gestures.c \
glarea.c \
headerbar.c \
hypertext.c \
iconview.c \
iconview_edit.c \
images.c \
infobar.c \
links.c \
listbox.c \
flowbox.c \
list_store.c \
markup.c \
menus.c \
modelbutton.c \
offscreen_window.c \
offscreen_window2.c \
overlay.c \
overlay2.c \
paint.c \
panes.c \
pickers.c \
pixbufs.c \
popover.c \
printing.c \
revealer.c \
rotated_text.c \
scale.c \
search_entry.c \
search_entry2.c \
shortcuts.c \
sidebar.c \
sizegroup.c \
spinbutton.c \
spinner.c \
stack.c \
tabs.c \
textmask.c \
textview.c \
textscroll.c \
theming_style_classes.c \
toolpalette.c \
transparent.c \
tree_store.c
include $(srcdir)/demos-sources.mak
demos_opt =
if BUILD_FONT_DEMO
demos_opt += font_features.c
demos_opt += $(font_features_demo)
endif
if OS_UNIX
demos_opt += pagesetup.c
demos_opt += $(page_setup_demo)
endif
demos = $(demos_base) $(demos_opt)
+75
View File
@@ -0,0 +1,75 @@
## These should be in the order you want them to appear in the
## demo app, which means alphabetized by demo title, not filename
demos_base = \
application_demo.c \
assistant.c \
builder.c \
button_box.c \
changedisplay.c \
clipboard.c \
colorsel.c \
combobox.c \
css_accordion.c \
css_basics.c \
css_blendmodes.c \
css_multiplebgs.c \
css_pixbufs.c \
css_shadows.c \
cursors.c \
dialog.c \
drawingarea.c \
editable_cells.c \
entry_buffer.c \
entry_completion.c \
event_axes.c \
expander.c \
filtermodel.c \
fishbowl.c \
foreigndrawing.c \
gestures.c \
glarea.c \
headerbar.c \
hypertext.c \
iconview.c \
iconview_edit.c \
images.c \
infobar.c \
links.c \
listbox.c \
flowbox.c \
list_store.c \
markup.c \
menus.c \
modelbutton.c \
offscreen_window.c \
offscreen_window2.c \
overlay.c \
overlay2.c \
paint.c \
panes.c \
pickers.c \
pixbufs.c \
popover.c \
printing.c \
revealer.c \
rotated_text.c \
scale.c \
search_entry.c \
search_entry2.c \
shortcuts.c \
sidebar.c \
sizegroup.c \
spinbutton.c \
spinner.c \
stack.c \
tabs.c \
textmask.c \
textview.c \
textscroll.c \
theming_style_classes.c \
toolpalette.c \
transparent.c \
tree_store.c
font_features_demo = font_features.c
page_setup_demo = pagesetup.c
+60 -11
View File
@@ -9,10 +9,23 @@
*/
#include <gtk/gtk.h>
#if PANGO_VERSION_CHECK(1,44,0)
# if !HB_VERSION_ATLEAST(2,2,0)
# define FONT_FEATURES_USE_PANGOFT2 1
# endif
#else
# define FONT_FEATURES_USE_PANGOFT2 1
#endif
#ifdef FONT_FEATURES_USE_PANGOFT2
#include <pango/pangofc-font.h>
#include <hb.h>
#include <hb-ot.h>
#include <hb-ft.h>
#else
#include <hb-ot.h>
#endif
static GtkWidget *label;
static GtkWidget *settings;
@@ -205,19 +218,32 @@ static void
update_script_combo (void)
{
GtkListStore *store;
hb_font_t *hb_font;
hb_font_t *hb_font = NULL;
gint i, j, k, l;
FT_Face ft_face;
PangoFont *pango_font;
GHashTable *tags;
GHashTableIter iter;
TagPair *pair;
gboolean cleanup_hb_face = FALSE;
#ifdef FONT_FEATURES_USE_PANGOFT2
FT_Face ft_face;
#endif
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
pango_font = get_pango_font ();
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
hb_font = hb_ft_font_create (ft_face, NULL);
#ifdef FONT_FEATURES_USE_PANGOFT2
if (PANGO_IS_FC_FONT (pango_font))
{
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
hb_font = hb_ft_font_create (ft_face, NULL);
cleanup_hb_face = TRUE;
}
#else
hb_font = pango_font_get_hb_font (pango_font);
#endif
tags = g_hash_table_new_full (tag_pair_hash, tag_pair_equal, g_free, NULL);
@@ -264,10 +290,15 @@ update_script_combo (void)
}
}
hb_face_destroy (hb_face);
if (cleanup_hb_face)
hb_face_destroy (hb_face);
}
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
#ifdef FONT_FEATURES_USE_PANGOFT2
if (PANGO_IS_FC_FONT (pango_font))
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
#endif
g_object_unref (pango_font);
g_hash_table_iter_init (&iter, tags);
@@ -346,8 +377,12 @@ update_features (void)
GtkTreeIter iter;
guint script_index, lang_index;
PangoFont *pango_font;
hb_font_t *hb_font = NULL;
gboolean cleanup_hb_face = FALSE;
#ifdef FONT_FEATURES_USE_PANGOFT2
FT_Face ft_face;
hb_font_t *hb_font;
#endif
for (i = 0; i < num_features; i++)
gtk_widget_set_opacity (icon[i], 0);
@@ -364,8 +399,17 @@ update_features (void)
-1);
pango_font = get_pango_font ();
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
hb_font = hb_ft_font_create (ft_face, NULL);
#ifdef FONT_FEATURES_USE_PANGOFT2
if (PANGO_IS_FC_FONT (pango_font))
{
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
hb_font = hb_ft_font_create (ft_face, NULL);
cleanup_hb_face = TRUE;
}
#else
hb_font = pango_font_get_hb_font (pango_font);
#endif
if (hb_font)
{
@@ -397,10 +441,15 @@ update_features (void)
}
}
hb_face_destroy (hb_face);
if (cleanup_hb_face)
hb_face_destroy (hb_face);
}
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
#ifdef FONT_FEATURES_USE_PANGOFT2
if (PANGO_IS_FC_FONT (pango_font))
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
#endif
g_object_unref (pango_font);
}
+1 -1
View File
@@ -160,7 +160,7 @@ do_gestures (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), drawing_area);
gtk_widget_add_events (drawing_area,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK);
GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK | GDK_TOUCHPAD_GESTURE_MASK);
g_signal_connect (drawing_area, "draw",
G_CALLBACK (drawing_area_draw), NULL);
+7 -1
View File
@@ -76,7 +76,13 @@ demos = files([
gtkdemo_deps = [libgtk_dep]
if harfbuzz_dep.found() and pangoft_dep.found()
if pango_dep.version().version_compare('>=1.44.0') and harfbuzz_dep.found() and cc.has_header_symbol(
'hb-ot.h',
'hb_ot_var_get_axis_count',
dependencies: harfbuzz_dep
)
demos += files('font_features.c')
elif harfbuzz_dep.found() and pangoft_dep.found()
demos += files('font_features.c')
gtkdemo_deps += [harfbuzz_dep, pangoft_dep]
endif
@@ -2,7 +2,6 @@
Name=Icon Browser
Comment=An application that shows themed icons
Exec=gtk3-icon-browser
Icon=gtk3-icon-browser
Terminal=false
Type=Application
StartupNotify=true
+2
View File
@@ -1279,6 +1279,8 @@ GdkWaylandWindowExported
gdk_wayland_window_export_handle
gdk_wayland_window_unexport_handle
gdk_wayland_window_set_transient_for_exported
gdk_wayland_window_add_frame_callback_surface
gdk_wayland_window_remove_frame_callback_surface
<SUBSECTION Standard>
GDK_TYPE_WAYLAND_DEVICE
+9 -4
View File
@@ -503,14 +503,19 @@ if get_option('man') and xsltproc.found()
[ 'gtk-update-icon-cache', '1', ],
[ 'gtk-encode-symbolic-svg', '1', ],
[ 'gtk-launch', '1', ],
[ 'gtk3-demo', '1', ],
[ 'gtk3-demo-application', '1', ],
[ 'gtk3-widget-factory', '1', ],
[ 'gtk3-icon-browser', '1', ],
[ 'gtk-builder-tool', '1', ],
[ 'gtk-query-settings', '1', ],
]
if get_option('demos')
man_files += [
[ 'gtk3-demo', '1', ],
[ 'gtk3-demo-application', '1', ],
[ 'gtk3-widget-factory', '1', ],
[ 'gtk3-icon-browser', '1', ],
]
endif
if broadway_enabled
man_files += [[ 'broadwayd', '1', ]]
endif
+18 -87
View File
@@ -20,12 +20,8 @@ Getting help with GTK+
<title>Filing a bug report or feature request</title>
<para>
If you encounter a bug, misfeature, or missing feature in GTK+, please
file a bug report on
<ulink url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
We'd also appreciate reports of incomplete or misleading information in
the GTK+ documentation; file those against the "docs" component of the "gtk+"
product in Bugzilla.
If you encounter a bug, misfeature, or missing feature in GTK, please
file a bug report on <ulink url="https://gitlab.gnome.org/GNOME/gtk/issues">GitLab</ulink>.
</para>
<para>
@@ -37,103 +33,38 @@ discussed, we'll add a note to that effect in the report.
<para>
The bug tracker should definitely be used for feature requests, it's
not only for bugs. We track all GTK+ development in Bugzilla, so it's
the way to be sure the GTK+ developers won't forget about an issue.
not only for bugs. We track all GTK development in GitLab, so it's
the way to be sure the GTK developers won't forget about an issue.
</para>
<para>
Just make sure that any issue filed is actionable, and contains clear
instructions on how to reproduce an issue, and the conditions to close
the bug report or feature request. Non-actionable, or user support
questions will be directed to Discourse.
</para>
</refsect1>
<refsect1>
<title>Submitting Patches</title>
<title>Contributing</title>
<para>
If you develop a bugfix or enhancement for GTK+, please file that in
Bugzilla as well. Bugzilla allows you to attach files; please attach a
patch generated by the <command>diff</command> utility, using the
<option>-u</option> option to make the patch more readable. All patches
must be offered under the terms of the GNU LGPL license, so be sure you
are authorized to give us the patch under those terms.
</para>
<para>
If you want to discuss your patch before or after developing it, mail
<ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink>.
But be sure to file the Bugzilla report as well; if the patch is only on the
list and not in Bugzilla, it's likely to slip through the cracks.
Please, follow the instructions outlined in the
<ulink url="https://gitlab.gnome.org/GNOME/gtk/-/blob/master/CONTRIBUTING.md">Contribution Guide</ulink> available in the GTK
source code repository.
</para>
</refsect1>
<refsect1>
<title>Mailing lists</title>
<title>User support</title>
<para>
There are several mailing lists dedicated to GTK+ and related
libraries. Discussion of GLib, Pango, and ATK in addition to GTK+
proper is welcome on these lists. You can subscribe or view the
archives of these lists on
<ulink url="https://mail.gnome.org">http://mail.gnome.org</ulink>.
If you aren't subscribed to the list, any message you post to
the list will be held for manual moderation, which might take
some days to happen.
</para>
<para>
<variablelist>
<varlistentry>
<term><ulink url="mailto:gtk-list@gnome.org">gtk-list@gnome.org</ulink></term>
<listitem><para>
gtk-list covers general GTK+ topics; questions about using GTK+ in programs,
GTK+ from a user standpoint, announcements of GTK+-related projects
such as themes or GTK+ modules would all be on-topic. The bulk of the
traffic consists of GTK+ programming questions.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-app-devel-list@gnome.org">gtk-app-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-app-devel-list covers writing applications in GTK+. It's narrower
in scope than gtk-list, but the two lists overlap quite a
bit. gtk-app-devel-list is a good place to ask questions about GTK+
programming. </para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org</ulink></term>
<listitem><para>
gtk-devel-list is for discussion of work on GTK+ itself, it is
<emphasis>not</emphasis> for
asking questions about how to use GTK+ in applications. gtk-devel-list
is appropriate for discussion of patches, bugs, proposed features,
and so on.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-i18n-list@gnome.org">gtk-i18n-list@gnome.org</ulink></term>
<listitem><para>
gtk-i18n-list is for discussion of internationalization in GTK+;
Pango is the main focus of the list. Questions about the details of
using Pango, and discussion of proposed Pango patches or features, are
all on topic.
</para></listitem>
</varlistentry>
<varlistentry>
<term><ulink url="mailto:gtk-doc-list@gnome.org">gtk-doc-list@gnome.org</ulink></term>
<listitem><para>
gtk-doc-list is for discussion of the <application>gtk-doc</application>
documentation system (used to document GTK+), and for work on the GTK+
documentation.
</para></listitem>
</varlistentry>
</variablelist>
If you have questions about building, using, or contributing to GTK, please
open a topic on <ulink url="https://discourse.gnome.org/tag/gtk">Discourse</ulink>.
</para>
</refsect1>
</refentry>
+3 -3
View File
@@ -134,9 +134,9 @@ additional environment variables.
<title><envar>GTK_DEBUG</envar></title>
<para>
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
this variable can be set to a list of debug options, which cause GTK+
to print out different types of debugging information.
This variable can be set to a list of debug options, which cause GTK to
print out different types of debugging information. Some of these options
are only available when GTK has been configured with <option>--enable-debug=yes</option>.
<variablelist>
<varlistentry>
<term>actions</term>
+3 -1
View File
@@ -5,7 +5,7 @@ app10_resources = gnome.compile_resources(
source_dir: '.'
)
app10_schemas = gnome.compile_schemas()
app10_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app10 = executable(
@@ -21,3 +21,5 @@ app10 = executable(
app10_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+3 -1
View File
@@ -5,7 +5,7 @@ app5_resources = gnome.compile_resources(
source_dir: '.'
)
app5_schemas = gnome.compile_schemas()
app5_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app5 = executable(
@@ -19,3 +19,5 @@ app5 = executable(
app5_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+3 -1
View File
@@ -5,7 +5,7 @@ app6_resources = gnome.compile_resources(
source_dir: '.'
)
app6_schemas = gnome.compile_schemas()
app6_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app6 = executable(
@@ -21,3 +21,5 @@ app6 = executable(
app6_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+3 -1
View File
@@ -5,7 +5,7 @@ app7_resources = gnome.compile_resources(
source_dir: '.'
)
app7_schemas = gnome.compile_schemas()
app7_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app7 = executable(
@@ -21,3 +21,5 @@ app7 = executable(
app7_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+3 -1
View File
@@ -5,7 +5,7 @@ app8_resources = gnome.compile_resources(
source_dir: '.'
)
app8_schemas = gnome.compile_schemas()
app8_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app8 = executable(
@@ -21,3 +21,5 @@ app8 = executable(
app8_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+3 -1
View File
@@ -5,7 +5,7 @@ app9_resources = gnome.compile_resources(
source_dir: '.'
)
app9_schemas = gnome.compile_schemas()
app9_schemas = gnome.compile_schemas(depend_files: files(['org.gtk.exampleapp.gschema.xml']))
app9 = executable(
@@ -21,3 +21,5 @@ app9 = executable(
app9_schemas,
dependencies: libgtk_dep
)
install_data('org.gtk.exampleapp.gschema.xml', install_dir: gtk_schemasdir)
+11 -51
View File
@@ -1,5 +1,7 @@
## Makefile.am for gtk+/gdk
include $(top_srcdir)/Makefile.decl
include gdk-pub-headers.mak
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
@@ -63,54 +65,10 @@ LDADD = \
#
# setup source file variables
#
#
# GDK header files for public installation (non-generated)
#
#
gdk_public_h_sources = \
gdk.h \
gdk-autocleanup.h \
gdkapplaunchcontext.h \
gdkcairo.h \
gdkcursor.h \
gdkdevice.h \
gdkdevicepad.h \
gdkdevicetool.h \
gdkdevicemanager.h \
gdkdisplay.h \
gdkdisplaymanager.h \
gdkdnd.h \
gdkdrawingcontext.h \
gdkevents.h \
gdkframetimings.h \
gdkglcontext.h \
gdkkeys.h \
gdkkeysyms.h \
gdkkeysyms-compat.h \
gdkmain.h \
gdkmonitor.h \
gdkpango.h \
gdkframeclock.h \
gdkpixbuf.h \
gdkprivate.h \
gdkproperty.h \
gdkrectangle.h \
gdkrgba.h \
gdkscreen.h \
gdkseat.h \
gdkselection.h \
gdktestutils.h \
gdkthreads.h \
gdktypes.h \
gdkvisual.h \
gdkwindow.h
deprecated_h_sources = \
deprecated/gdkcolor.h
gdk_h_sources = \
$(gdk_public_h_sources) \
$(deprecated_h_sources)
$(gdk_deprecated_h_sources)
gdk_private_headers = \
gdk-private.h \
@@ -201,7 +159,7 @@ gdkinclude_HEADERS = $(gdk_public_h_sources)
nodist_gdkinclude_HEADERS = gdkconfig.h gdkenumtypes.h gdkversionmacros.h
deprecatedincludedir = $(includedir)/gtk-3.0/gdk/deprecated
deprecatedinclude_HEADERS = $(deprecated_h_sources)
deprecatedinclude_HEADERS = $(gdk_deprecated_h_sources)
common_sources = \
$(gdk_private_headers) \
@@ -499,14 +457,13 @@ gdkresources.c: gdk.gresource.xml $(resource_files)
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk-3
gdk_3_FILES = $(libgdk_3_la_SOURCES)
gdk_3_FILES = $(gdk_c_sources)
gdk_3_EXCLUDES = dummy
gdk_3_HEADERS_DIR = $(gdkincludedir)
gdk_3_HEADERS_INST = \
$(gdkinclude_HEADERS) \
$(deprecatedinclude_HEADERS) \
$(nodist_gdkinclude_HEADERS)
$(deprecatedinclude_HEADERS)
gdk_3_HEADERS_EXCLUDES = dummy
@@ -518,7 +475,9 @@ MSVC_INTROSPECT_GIRS = Gdk-3.0.gir GdkWin32-3.0.gir
BASE_MSVC_GIR_CFLAGS = \
$(GDK_CFLAGS_DEFINES) \
-I.. -I../gdk -I../gdk/win32
-I'./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/obj/gdk-3' -I.. \
-I'./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/obj/gdk-3/gdk' -I../gdk \
-I../gdk/win32
INTROSPECTION_INTERMEDIATE_ITEMS = \
$(top_builddir)/win32/Gdk-3.0.gir.msvc.introspect \
@@ -526,7 +485,8 @@ INTROSPECTION_INTERMEDIATE_ITEMS = \
$(top_builddir)/win32/GdkWin32-3.0.gir.msvc.introspect \
$(top_builddir)/win32/GdkWin32_3_0_gir_list
Gdk_3_0_gir_MSVC_FILES = $(introspection_files)
Gdk_3_0_gir_MSVC_FILES = $(filter-out gdkkeysyms-compat.h, $(gdk_h_sources)) \
$(gdk_c_sources) \
Gdk_3_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_3_0_gir_EXPORT_PACKAGES)
Gdk_3_0_gir_MSVC_INCLUDE_GIRS = $(Gdk_3_0_gir_INCLUDES)
Gdk_3_0_gir_MSVC_LIBS = gdk-3.0
+142 -20
View File
@@ -1,3 +1,27 @@
/* check if we are on Android and using Chrome */
var isAndroidChrome = false;
{
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("android") > -1 && ua.indexOf("chrom") > -1) {
isAndroidChrome = true;
}
}
/* check for the passive option for Event listener */
let passiveSupported = false;
try {
const options = {
get passive() { // This function will be called when the browser
// attempts to access the passive property.
passiveSupported = true;
return false;
}
};
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch(err) {
passiveSupported = false;
}
/* Helper functions for debugging */
var logDiv = null;
function log(str) {
@@ -10,6 +34,25 @@ function log(str) {
logDiv.appendChild(document.createTextNode(str));
logDiv.appendChild(document.createElement('br'));
}
/* Helper functions for touch identifier to make it unique on Android */
var globalTouchIdentifier = Math.round(Date.now() / 1000);
function touchIdentifierStart(tId)
{
if (isAndroidChrome) {
if (tId == 0) {
return ++globalTouchIdentifier;
}
return globalTouchIdentifier + tId;
}
return tId;
}
function touchIdentifier(tId)
{
if (isAndroidChrome) {
return globalTouchIdentifier + tId;
}
return tId;
}
function getStackTrace()
{
@@ -91,6 +134,7 @@ grab.window = null;
grab.ownerEvents = false;
grab.implicit = false;
var keyDownList = [];
var inputList = [];
var lastSerial = 0;
var lastX = 0;
var lastY = 0;
@@ -223,6 +267,7 @@ function cmdSetTransientFor(id, parentId)
{
var surface = surfaces[id];
if (surface === undefined) return;
if (surface.transientParent == parentId)
return;
@@ -253,8 +298,9 @@ function moveToHelper(surface, position) {
for (var cid in surfaces) {
var child = surfaces[cid];
if (child.transientParent == surface.id)
if (child.transientParent == surface.id) {
moveToHelper(child, stackingOrder.indexOf(surface) + 1);
}
}
}
@@ -269,6 +315,13 @@ function cmdDeleteSurface(id)
stackingOrder.splice(i, 1);
var canvas = surface.canvas;
canvas.parentNode.removeChild(canvas);
if (id == windowWithMouse) {
windowWithMouse = 0;
}
if (id == realWindowWithMouse) {
realWindowWithMouse = 0;
firstTouchDownId = null;
}
delete surfaces[id];
}
@@ -307,6 +360,7 @@ function cmdRaiseSurface(id)
{
var surface = surfaces[id];
if (surface === undefined) return;
moveToHelper(surface);
restackWindows();
}
@@ -315,6 +369,7 @@ function cmdLowerSurface(id)
{
var surface = surfaces[id];
if (surface === undefined) return;
moveToHelper(surface, 0);
restackWindows();
}
@@ -520,6 +575,7 @@ function cmdPutBuffer(id, w, h, compressed)
var data = inflate.decompress();
var imageData = decodeBuffer (context, surface.imageData, w, h, data, debugDecoding);
context.imageSmoothingEnabled = false;
context.putImageData(imageData, 0, 0);
if (debugDecoding)
@@ -776,8 +832,15 @@ function getEffectiveEventTarget (id) {
function updateKeyboardStatus() {
if (fakeInput != null && showKeyboardChanged) {
showKeyboardChanged = false;
if (showKeyboard)
if (showKeyboard) {
if (isAndroidChrome) {
fakeInput.blur();
fakeInput.value = ' '.repeat(80); // TODO: Should be exchange with broadway server
// to bring real value here.
}
fakeInput.focus();
//if (isAndroidChrome) fakeInput.click();
}
else
fakeInput.blur();
}
@@ -2329,6 +2392,19 @@ function pushKeyEvent(fev) {
keyDownList.push(fev);
}
function copyInputEvent(ev) {
var members = ['inputType', 'data'], i, obj = {};
for (i = 0; i < members.length; i++) {
if (typeof ev[members[i]] !== "undefined")
obj[members[i]] = ev[members[i]];
}
return obj;
}
function pushInputEvent(fev) {
inputList.push(fev);
}
function getKeyEvent(keyCode, pop) {
var i, fev = null;
for (i = keyDownList.length-1; i >= 0; i--) {
@@ -2366,8 +2442,9 @@ function handleKeyDown(e) {
// If it is a key or key combination that might trigger
// browser behaviors or it has no corresponding keyPress
// event, then send it immediately
if (!ignoreKeyEvent(ev))
if (!ignoreKeyEvent(ev)) {
sendInput("k", [keysym, lastState]);
}
suppress = true;
}
@@ -2411,8 +2488,9 @@ function handleKeyPress(e) {
}
// Send the translated keysym
if (keysym > 0)
if (keysym > 0) {
sendInput ("k", [keysym, lastState]);
}
// Stop keypress events just in case
return cancelEvent(ev);
@@ -2427,11 +2505,45 @@ function handleKeyUp(e) {
keysym = fev.keysym;
else {
//log("Key event (keyCode = " + ev.keyCode + ") not found on keyDownList");
if (isAndroidChrome && (ev.keyCode == 229)) {
var i, fev = null, len = inputList.length, str;
for (i = 0; i < len; i++) {
fev = inputList[i];
switch(fev.inputType) {
case "deleteContentBackward":
sendInput ("k", [65288, lastState]);
sendInput ("K", [65288, lastState]);
break;
case "insertText":
if (fev.data !== undefined) {
for (let sym of fev.data) {
sendInput ("k", [sym.codePointAt(0), lastState]);
sendInput ("K", [sym.codePointAt(0), lastState]);
}
}
break;
default:
break;
}
}
inputList.splice(0, len);
}
keysym = 0;
}
if (keysym > 0)
if (keysym > 0) {
sendInput ("K", [keysym, lastState]);
}
return cancelEvent(ev);
}
function handleInput (e) {
var fev = null, ev = (e ? e : window.event), keysym = null, suppress = false;
fev = copyInputEvent(ev);
pushInputEvent(fev);
// Stop keypress events just in case
return cancelEvent(ev);
}
@@ -2450,6 +2562,11 @@ function onKeyUp (ev) {
return handleKeyUp(ev);
}
function onInput (ev) {
updateForEvent(ev);
return handleInput(ev);
}
function cancelEvent(ev)
{
ev = ev ? ev : window.event;
@@ -2481,13 +2598,14 @@ function onMouseWheel(ev)
}
function onTouchStart(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifierStart(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
@@ -2495,7 +2613,7 @@ function onTouchStart(ev) {
var isEmulated = 0;
if (firstTouchDownId == null) {
firstTouchDownId = touch.identifier;
firstTouchDownId = touchId;
isEmulated = 1;
if (realWindowWithMouse != origId || id != windowWithMouse) {
@@ -2510,52 +2628,54 @@ function onTouchStart(ev) {
}
}
sendInput ("t", [0, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [0, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchMove(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
}
sendInput ("t", [1, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [1, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchEnd(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
firstTouchDownId = null;
}
sendInput ("t", [2, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [2, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
@@ -2572,11 +2692,11 @@ function setupDocument(document)
document.onkeyup = onKeyUp;
if (document.addEventListener) {
document.addEventListener('DOMMouseScroll', onMouseWheel, false);
document.addEventListener('mousewheel', onMouseWheel, false);
document.addEventListener('touchstart', onTouchStart, false);
document.addEventListener('touchmove', onTouchMove, false);
document.addEventListener('touchend', onTouchEnd, false);
document.addEventListener('DOMMouseScroll', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('mousewheel', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchstart', onTouchStart, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchmove', onTouchMove, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchend', onTouchEnd, passiveSupported ? { passive: false, capture: false } : false);
} else if (document.attachEvent) {
element.attachEvent("onmousewheel", onMouseWheel);
}
@@ -2630,12 +2750,14 @@ function connect()
};
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
if (iOS) {
if (iOS || isAndroidChrome) {
fakeInput = document.createElement("input");
fakeInput.type = "text";
fakeInput.style.position = "absolute";
fakeInput.style.left = "-1000px";
fakeInput.style.top = "-1000px";
document.body.appendChild(fakeInput);
if (isAndroidChrome)
fakeInput.addEventListener('input', onInput, passiveSupported ? { passive: false, capture: false } : false);
}
}
+1 -1
View File
@@ -109,7 +109,7 @@ _gdk_broadway_display_open (const gchar *display_name)
broadway_display->server = _gdk_broadway_server_new (display_name, &error);
if (broadway_display->server == NULL)
{
g_printerr ("Unable to init server: %s\n", error->message);
GDK_NOTE (MISC, g_message ("Unable to init Broadway server: %s\n", error->message));
g_error_free (error);
return NULL;
}
+1
View File
@@ -224,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->scroll.y = message->pointer.win_y;
event->scroll.x_root = message->pointer.root_x;
event->scroll.y_root = message->pointer.root_y;
event->scroll.state = message->pointer.state;
event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
+44
View File
@@ -0,0 +1,44 @@
#
# GDK header files for public installation (non-generated)
#
#
gdk_public_h_sources = \
gdk.h \
gdk-autocleanup.h \
gdkapplaunchcontext.h \
gdkcairo.h \
gdkcursor.h \
gdkdevice.h \
gdkdevicepad.h \
gdkdevicetool.h \
gdkdevicemanager.h \
gdkdisplay.h \
gdkdisplaymanager.h \
gdkdnd.h \
gdkdrawingcontext.h \
gdkevents.h \
gdkframetimings.h \
gdkglcontext.h \
gdkkeys.h \
gdkkeysyms.h \
gdkkeysyms-compat.h \
gdkmain.h \
gdkmonitor.h \
gdkpango.h \
gdkframeclock.h \
gdkpixbuf.h \
gdkprivate.h \
gdkproperty.h \
gdkrectangle.h \
gdkrgba.h \
gdkscreen.h \
gdkseat.h \
gdkselection.h \
gdktestutils.h \
gdkthreads.h \
gdktypes.h \
gdkvisual.h \
gdkwindow.h
gdk_deprecated_h_sources = \
deprecated/gdkcolor.h
+17 -17
View File
@@ -370,7 +370,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
paint_data = gdk_gl_context_get_paint_data (paint_context);
if (paint_data->tmp_framebuffer == 0)
glGenFramebuffersEXT (1, &paint_data->tmp_framebuffer);
glGenFramebuffers (1, &paint_data->tmp_framebuffer);
if (source_type == GL_RENDERBUFFER)
{
@@ -423,10 +423,10 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
framebuffer = paint_data->tmp_framebuffer;
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, source);
glBindFramebuffer (GL_DRAW_FRAMEBUFFER, 0);
/* Translate to impl coords */
cairo_region_translate (clip_region, dx, dy);
@@ -481,11 +481,11 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
{
int clipped_src_x = x + (dest.x - dx * window_scale);
int clipped_src_y = y + (height - dest.height - (dest.y - dy * window_scale));
glBlitFramebufferEXT(clipped_src_x, clipped_src_y,
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
dest.x, FLIP_Y(dest.y + dest.height),
dest.x + dest.width, FLIP_Y(dest.y),
GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBlitFramebuffer (clipped_src_x, clipped_src_y,
(clipped_src_x + dest.width), (clipped_src_y + dest.height),
dest.x, FLIP_Y(dest.y + dest.height),
dest.x + dest.width, FLIP_Y(dest.y),
GL_COLOR_BUFFER_BIT, GL_NEAREST);
if (impl_window->current_paint.flushed_region)
{
cairo_rectangle_int_t flushed_rect;
@@ -505,7 +505,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glDisable (GL_SCISSOR_TEST);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
glBindFramebuffer (GL_FRAMEBUFFER, 0);
#undef FLIP_Y
@@ -671,19 +671,19 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
framebuffer = paint_data->tmp_framebuffer;
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer);
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
if (source_type == GL_RENDERBUFFER)
{
/* Create a framebuffer with the source renderbuffer and
make it the current target for reads */
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, source);
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, source);
}
else
{
glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, source, 0);
glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, source, 0);
}
glPixelStorei (GL_PACK_ALIGNMENT, 4);
@@ -699,7 +699,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
glBindFramebuffer (GL_FRAMEBUFFER, 0);
cairo_surface_mark_dirty (image);
+1
View File
@@ -288,6 +288,7 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
if (cairo_surface_status (surface) || dest == NULL)
{
cairo_surface_destroy (surface);
g_clear_object (&dest);
return NULL;
}
+2 -1
View File
@@ -43,7 +43,8 @@ struct _GdkSeatDefaultPrivate
GDK_ENTER_NOTIFY_MASK | \
GDK_LEAVE_NOTIFY_MASK | \
GDK_PROXIMITY_IN_MASK | \
GDK_PROXIMITY_OUT_MASK)
GDK_PROXIMITY_OUT_MASK | \
GDK_TOUCHPAD_GESTURE_MASK)
G_DEFINE_TYPE_WITH_PRIVATE (GdkSeatDefault, gdk_seat_default, GDK_TYPE_SEAT)
+2 -2
View File
@@ -1286,7 +1286,7 @@ get_native_device_event_mask (GdkWindow *private,
if (gdk_window_is_toplevel (private) ||
mask & GDK_BUTTON_PRESS_MASK)
mask |=
GDK_TOUCH_MASK |
GDK_TOUCH_MASK | GDK_TOUCHPAD_GESTURE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_SCROLL_MASK;
@@ -10200,7 +10200,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
* gdk_window_create_similar_image_surface:
* @window: (nullable): window to make new surface similar to, or
* %NULL if none
* @format: (type int): the format for the new surface
* @format: the format for the new surface
* @width: width of the new surface
* @height: height of the new surface
* @scale: the scale of the new surface, or 0 to use same as @window
+1 -2
View File
@@ -803,8 +803,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
gdk_event_free (event);
g_object_unref (_gdk_quartz_drag_source_context);
_gdk_quartz_drag_source_context = NULL;
_gdk_quartz_drag_source_context_destroy_gtk_only ();
}
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+19 -1
View File
@@ -289,6 +289,24 @@
gdk_screen_get_rgba_visual (_gdk_screen);
}
- (void) viewWillDraw
{
/* MacOS 11 (Big Sur) has added a new, dynamic "accent" as default.
* This uses a 10-bit colorspace so every GIMP drawing operation
* has the additional cost of an 8-bit (ARGB) to 10-bit conversion.
* Let's disable this mode to regain the lost performance.
*/
if(gdk_quartz_osx_version() >= GDK_OSX_BIGSUR)
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
CALayer* layer = self.layer;
layer.contentsFormat = kCAContentsFormatRGBA8Uint;
#endif
}
[super viewWillDraw];
}
-(void)drawRect: (NSRect)rect
{
GdkRectangle gdk_rect;
@@ -416,7 +434,7 @@
{
if (GDK_WINDOW_DESTROYED (gdk_window))
return;
[super setFrame: frame];
if ([self window])
+1
View File
@@ -60,6 +60,7 @@ libgdkinclude_HEADERS = \
gdkquartz.h
libgdkquartzinclude_HEADERS = \
gdkquartz-cocoa-access.h \
gdkquartz-gtk-only.h \
gdkquartzcursor.h \
gdkquartzdevice-core.h \
+24 -3
View File
@@ -32,6 +32,8 @@
#include "gdkdisplay-quartz.h"
#include "gdkmonitor-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkwindow.h"
/* Note about coordinates: There are three coordinate systems at play:
*
@@ -452,10 +454,29 @@ static GdkMonitor *
gdk_quartz_display_get_monitor_at_window (GdkDisplay *display,
GdkWindow *window)
{
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
NSWindow *nswindow = impl->toplevel;
NSScreen *screen = [nswindow screen];
GdkWindowImplQuartz *impl = NULL;
NSWindow *nswindow = NULL;
NSScreen *screen = NULL;
GdkMonitor *monitor = NULL;
GdkWindow *onscreen_window = window;
/*
* This stops crashes when there is no NSWindow available on
* an offscreen window which occurs for children of children
* of an onscreen window (children of an onscreen window do
* have NSWindow set)
* https://gitlab.gnome.org/GNOME/gimp/-/issues/7608
*/
while (onscreen_window && onscreen_window->window_type == GDK_WINDOW_OFFSCREEN)
onscreen_window = onscreen_window->parent;
if (!onscreen_window)
return NULL;
impl = GDK_WINDOW_IMPL_QUARTZ (onscreen_window->impl);
nswindow = impl->toplevel;
screen = [nswindow screen];
if (screen)
{
GdkQuartzDisplay *quartz_display = GDK_QUARTZ_DISPLAY (display);
+2 -1
View File
@@ -20,12 +20,13 @@
#ifndef __GDK_QUARTZ_DISPLAY__
#define __GDK_QUARTZ_DISPLAY__
#include <AppKit/AppKit.h>
#include "gdkdisplayprivate.h"
#include "gdkkeys.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
#include "gdkinternal-quartz.h"
G_BEGIN_DECLS
+8
View File
@@ -59,6 +59,14 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
return _gdk_quartz_drag_source_context;
}
void
_gdk_quartz_drag_source_context_destroy_gtk_only ()
{
if (_gdk_quartz_drag_source_context)
g_object_unref (_gdk_quartz_drag_source_context);
_gdk_quartz_drag_source_context = NULL;
}
static gboolean
gdk_quartz_drag_context_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
+1 -1
View File
@@ -28,7 +28,7 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz-gtk-only.h"
#include "gdkquartz-cocoa-access.h"
#include "gdkinternals.h"
+7 -9
View File
@@ -29,28 +29,26 @@ GdkWindow *_gdk_root = NULL;
GdkOSXVersion
gdk_quartz_osx_version (void)
{
static gint32 minor = GDK_OSX_UNSUPPORTED;
static gint32 vkey = GDK_OSX_UNSUPPORTED;
if (minor == GDK_OSX_UNSUPPORTED)
if (vkey == GDK_OSX_UNSUPPORTED)
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&vkey);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
#else
NSOperatingSystemVersion version;
version = [[NSProcessInfo processInfo] operatingSystemVersion];
minor = version.minorVersion;
if (version.majorVersion == 11)
minor += 16;
vkey = version.majorVersion == 10 ? version.minorVersion : version.majorVersion + 5;
#endif
}
if (minor < GDK_OSX_MIN)
if (vkey < GDK_OSX_MIN)
return GDK_OSX_UNSUPPORTED;
else if (minor > GDK_OSX_CURRENT)
else if (vkey > GDK_OSX_CURRENT)
return GDK_OSX_NEW;
else
return minor;
return vkey;
}
+8 -8
View File
@@ -42,16 +42,16 @@ typedef float CGFloat;
#define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
#define GDK_QUARTZ_RELEASE_POOL [pool release]
#include <gdk/gdkprivate.h>
#include <gdk/quartz/gdkquartz.h>
#include <gdk/quartz/gdkdevicemanager-core-quartz.h>
#include <gdk/quartz/gdkdnd-quartz.h>
#include <gdk/quartz/gdkscreen-quartz.h>
#include <gdk/quartz/gdkwindow-quartz.h>
#include "../gdkprivate.h"
#include "gdkquartz.h"
#include "gdkdevicemanager-core-quartz.h"
#include "gdkdnd-quartz.h"
#include "gdkscreen-quartz.h"
#include "gdkwindow-quartz.h"
#include <gdk/gdk.h>
#include "config.h"
#include <config.h>
extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen;
@@ -75,7 +75,7 @@ typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 10130
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSEventTypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSEventSubtypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSEventSubtypeTabletPoint
+1 -1
View File
@@ -812,13 +812,13 @@ input_sources_changed_notification (CFNotificationCenterRef center,
static void
gdk_quartz_keymap_init (GdkQuartzKeymap *keymap)
{
update_keymap ();
CFNotificationCenterAddObserver (CFNotificationCenterGetDistributedCenter (),
keymap,
input_sources_changed_notification,
CFSTR ("AppleSelectedInputSourcesChangedNotification"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
update_keymap ();
}
static void
+1
View File
@@ -22,6 +22,7 @@
#include "gdkmonitor-quartz.h"
#include "gdkdisplay-quartz.h"
#include "gdkinternal-quartz.h"
G_DEFINE_TYPE (GdkQuartzMonitor, gdk_quartz_monitor, GDK_TYPE_MONITOR)
+1 -1
View File
@@ -20,12 +20,12 @@
#include <glib.h>
#include <gio/gio.h>
#include <AppKit/AppKit.h>
#include "gdkmonitorprivate.h"
#include "gdkquartzmonitor.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
struct _GdkQuartzMonitor
{
+37
View File
@@ -0,0 +1,37 @@
/* gdkquartz-gtk-only.h
*
* Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_QUARTZ_COCOA_ACCESS_H__
#define __GDK_QUARTZ_COCOA_ACCESS_H__
#ifndef __OBJC__
#error "This header declares Cocoa types and can be included only from source files compiled with Objective-C."
#endif
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include "gdkquartz.h"
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
#endif
-8
View File
@@ -38,13 +38,5 @@ NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom
/* Utilities */
GDK_AVAILABLE_IN_ALL
NSImage *gdk_quartz_pixbuf_to_ns_image_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
/* Window */
GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window);
#endif
+2 -1
View File
@@ -42,7 +42,8 @@ typedef enum
GDK_OSX_MOJAVE = 14,
GDK_OSX_CATALINA = 15,
GDK_OSX_BIGSUR = 16,
GDK_OSX_CURRENT = 15,
GDK_OSX_MONTEREY = 17,
GDK_OSX_CURRENT = 17,
GDK_OSX_NEW = 99
} GdkOSXVersion;
+3
View File
@@ -51,6 +51,9 @@ id gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext
GDK_AVAILABLE_IN_ALL
GdkDragContext *gdk_quartz_drag_source_context_libgtk_only (void);
GDK_AVAILABLE_IN_3_24
void _gdk_quartz_drag_source_context_destroy_gtk_only ();
G_END_DECLS
#endif /* __GDK_QUARTZ_DRAG_CONTEXT_H__ */
+1 -1
View File
@@ -25,7 +25,7 @@
#include "gdkprivate-quartz.h"
#include "gdkdisplay-quartz.h"
#include "gdkmonitor-quartz.h"
#include "gdkinternal-quartz.h"
/* A couple of notes about this file are in order. In GDK, a
* GdkScreen can contain multiple monitors. A GdkScreen has an
+5
View File
@@ -180,6 +180,7 @@ _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSStringPboardType
#define GDK_QUARTZ_TIFF_PBOARD_TYPE NSTIFFPboardType
#else
#define GDK_QUARTZ_FILE_PBOARD_TYPE NSPasteboardTypeFileURL
#define GDK_QUARTZ_URL_PBOARD_TYPE NSPasteboardTypeURL
#define GDK_QUARTZ_COLOR_PBOARD_TYPE NSPasteboardTypeColor
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSPasteboardTypeString
@@ -197,6 +198,10 @@ gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type)
return gdk_atom_intern_static_string ("application/x-color");
else if ([type isEqualToString:GDK_QUARTZ_URL_PBOARD_TYPE])
return gdk_atom_intern_static_string ("text/uri-list");
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
else if ([type isEqualToString:GDK_QUARTZ_FILE_PBOARD_TYPE])
return gdk_atom_intern_static_string ("text/uri-list");
#endif
else
return gdk_atom_intern ([type UTF8String], FALSE);
}
+1
View File
@@ -23,6 +23,7 @@
#include <gdkinternals.h>
#include "gdkquartz-gtk-only.h"
#include "gdkquartz-cocoa-access.h"
#include <gdkquartzutils.h>
NSImage *
+28 -8
View File
@@ -30,7 +30,8 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
#include "gdkquartz-gtk-only.h"
#include "gdkquartz-cocoa-access.h"
#include "gdkinternal-quartz.h"
#include <Carbon/Carbon.h>
#include <AvailabilityMacros.h>
@@ -161,8 +162,16 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
*/
if (window_impl->in_paint_rect_count == 0)
{
if (![window_impl->view lockFocusIfCanDraw])
return NULL;
/* The NSView focus-locking API set was deprecated in MacOS 10.14 and
* has a significant cost in MacOS 11 - every lock/unlock seems to
* trigger a drawRect: call for the entire window. To return the
* lost performance, do not use the locking API in MacOS 11+
*/
if(gdk_quartz_osx_version() < GDK_OSX_BIGSUR)
{
if (![window_impl->view lockFocusIfCanDraw])
return NULL;
}
}
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101000
cg_context = [[NSGraphicsContext currentContext] graphicsPort];
@@ -182,8 +191,7 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
* in gdk_quartz_ref_cairo_surface () */
scale = CGContextConvertSizeToDeviceSpace (cg_context,
CGSizeMake (1.0, 1.0));
CGContextScaleCTM (cg_context, 1.0 / scale.width, 1.0 / scale.height);
CGContextScaleCTM (cg_context, 1.0 / fabs(scale.width), 1.0 / fabs(scale.height));
return cg_context;
}
@@ -201,7 +209,15 @@ gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl,
if (window_impl->in_paint_rect_count == 0)
{
_gdk_quartz_window_flush (window_impl);
[window_impl->view unlockFocus];
/* As per gdk_window_impl_quartz_get_context(), the NSView
* focus-locking API set was deprecated in MacOS 10.14 and has
* a significant cost in MacOS 11 - every lock/unlock seems to
* trigger a drawRect: call for the entire window. To return the
* lost performance, do not use the locking API in MacOS 11+
*/
if(gdk_quartz_osx_version() < GDK_OSX_BIGSUR)
[window_impl->view unlockFocus];
}
}
@@ -879,6 +895,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
NULL));
impl->view = NULL;
impl->toplevel = NULL;
if (attributes_mask & GDK_WA_TYPE_HINT)
{
@@ -2228,7 +2245,7 @@ _gdk_quartz_window_set_collection_behavior (NSWindow *nswindow,
GdkWindowTypeHint hint)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 10110
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
#define GDK_QUARTZ_ALLOWS_TILING NSWindowCollectionBehaviorFullScreenAllowsTiling
#define GDK_QUARTZ_DISALLOWS_TILING NSWindowCollectionBehaviorFullScreenDisallowsTiling
#else
@@ -2441,11 +2458,14 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
if (decorations == 0 || GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN )
{
new_mask = GDK_QUARTZ_BORDERLESS_WINDOW;
}
else if (decorations == 0) {
new_mask = GDK_QUARTZ_BORDERLESS_WINDOW | GDK_QUARTZ_MINIATURIZABLE_WINDOW;
}
else
{
/* FIXME: Honor other GDK_DECOR_* flags. */
-1
View File
@@ -22,7 +22,6 @@
#import <gdk/quartz/GdkQuartzView.h>
#import <gdk/quartz/GdkQuartzNSWindow.h>
#include "gdk/gdkwindowimpl.h"
#include "gdkinternal-quartz.h"
G_BEGIN_DECLS
+3 -1
View File
@@ -26,6 +26,7 @@ gdk_quartz_sources = files(
)
gdk_quartz_public_headers = files(
'gdkquartz-cocoa-access.h',
'gdkquartzcursor.h',
'gdkquartzdevice-core.h',
'gdkquartzdevicemanager-core.h',
@@ -47,8 +48,9 @@ core_graphics_dep = dependency('appleframeworks', modules : 'CoreGraphics', requ
appkit_dep = dependency('appleframeworks', modules : 'AppKit', required : true)
cocoa_dep = dependency('appleframeworks', modules : 'Cocoa', required : true)
carbon_dep = dependency('appleframeworks', modules : 'Carbon', required : true)
quartzcore_dep = dependency('appleframeworks', modules : 'QuartzCore', required : true)
gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep ]
gdk_quartz_deps = [ core_graphics_dep, appkit_dep, cocoa_dep, carbon_dep, quartzcore_dep ]
libgdk_quartz = static_library('gdk-quartz',
gdk_quartz_sources, gdkconfig, gdkenum_h,
+74 -16
View File
@@ -2195,6 +2195,7 @@ deliver_key_event (GdkWaylandSeat *seat,
struct xkb_keymap *xkb_keymap;
GdkKeymap *keymap;
xkb_keysym_t sym;
int layout;
guint delay, interval, timeout;
gint64 begin_time, now;
@@ -2207,6 +2208,7 @@ deliver_key_event (GdkWaylandSeat *seat,
xkb_keymap = _gdk_wayland_keymap_get_xkb_keymap (keymap);
sym = xkb_state_key_get_one_sym (xkb_state, key);
layout = xkb_state_key_get_layout (xkb_state, key);
if (sym == XKB_KEY_NoSymbol)
return;
@@ -2220,7 +2222,7 @@ deliver_key_event (GdkWaylandSeat *seat,
gdk_event_set_seat (event, GDK_SEAT (seat));
event->key.time = time_;
event->key.state = device_get_modifiers (seat->master_pointer);
event->key.group = 0;
event->key.group = layout;
event->key.hardware_keycode = key;
gdk_event_set_scancode (event, key);
event->key.keyval = sym;
@@ -2506,6 +2508,9 @@ touch_handle_down (void *data,
_gdk_wayland_display_update_serial (display, serial);
if (!wl_surface)
return;
touch = gdk_wayland_seat_add_touch (seat, id, wl_surface);
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
@@ -2541,6 +2546,9 @@ touch_handle_up (void *data,
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_seat_get_touch (seat, id);
if (!touch)
return;
event = _create_touch_event (seat, touch, GDK_TOUCH_END, time);
GDK_NOTE (EVENTS,
@@ -2567,6 +2575,9 @@ touch_handle_motion (void *data,
GdkEvent *event;
touch = gdk_wayland_seat_get_touch (seat, id);
if (!touch)
return;
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
@@ -3680,19 +3691,21 @@ tablet_tool_handle_proximity_in (void *data,
struct zwp_tablet_tool_v2 *wp_tablet_tool,
uint32_t serial,
struct zwp_tablet_v2 *wp_tablet,
struct wl_surface *surface)
struct wl_surface *wl_surface)
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GdkWindow *window = wl_surface_get_user_data (surface);
GdkWindow *window;
GdkEvent *event;
if (!surface)
return;
if (!wl_surface)
return;
window = wl_surface_get_user_data (wl_surface);
if (!GDK_IS_WINDOW (window))
return;
return;
tool->current_tablet = tablet;
tablet->current_tool = tool;
@@ -3731,6 +3744,9 @@ tablet_tool_handle_proximity_out (void *data,
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
#endif
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("proximity out, seat %p, tool %d", seat,
gdk_device_tool_get_tool_type (tool->tool)));
@@ -3787,7 +3803,7 @@ tablet_tool_handle_down (void *data,
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
_gdk_wayland_display_update_serial (display_wayland, serial);
@@ -3804,7 +3820,7 @@ tablet_tool_handle_up (void *data,
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
tablet_create_button_event_frame (tablet, GDK_BUTTON_RELEASE, GDK_BUTTON_PRIMARY);
@@ -3823,6 +3839,9 @@ tablet_tool_handle_motion (void *data,
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
GdkEvent *event;
if (!tablet)
return;
tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
@@ -3855,7 +3874,12 @@ tablet_tool_handle_pressure (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
_gdk_device_translate_axis (tablet->current_device, axis_index,
pressure, &tablet->axes[axis_index]);
@@ -3872,7 +3896,12 @@ tablet_tool_handle_distance (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
_gdk_device_translate_axis (tablet->current_device, axis_index,
distance, &tablet->axes[axis_index]);
@@ -3890,8 +3919,14 @@ tablet_tool_handle_tilt (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
gint ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
gint xtilt_axis_index;
gint ytilt_axis_index;
if (!tablet)
return;
xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
_gdk_device_translate_axis (tablet->current_device, xtilt_axis_index,
wl_fixed_to_double (xtilt),
@@ -3918,7 +3953,7 @@ tablet_tool_handle_button (void *data,
GdkEventType evtype;
guint n_button;
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
tablet->pointer_info.press_serial = serial;
@@ -3949,7 +3984,12 @@ tablet_tool_handle_rotation (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
_gdk_device_translate_axis (tablet->current_device, axis_index,
wl_fixed_to_double (degrees),
@@ -3968,7 +4008,12 @@ tablet_tool_handle_slider (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
_gdk_device_translate_axis (tablet->current_device, axis_index,
position, &tablet->axes[axis_index]);
@@ -3986,9 +4031,12 @@ tablet_tool_handle_wheel (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandSeat *seat;
GdkEvent *event;
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("tablet tool %d wheel %d/%d",
gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
@@ -3996,6 +4044,8 @@ tablet_tool_handle_wheel (void *data,
if (clicks == 0)
return;
seat = GDK_WAYLAND_SEAT (tablet->seat);
/* Send smooth event */
event = create_scroll_event (seat, &tablet->pointer_info,
tablet->master, tablet->current_device, FALSE);
@@ -4021,6 +4071,9 @@ tablet_tool_handle_frame (void *data,
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkEvent *frame_event;
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("tablet frame, time %d", time));
@@ -4644,6 +4697,9 @@ pointer_surface_update_scale (GdkDevice *device)
return;
}
if (!pointer->pointer_surface_outputs)
return;
scale = 1;
for (l = pointer->pointer_surface_outputs; l != NULL; l = l->next)
{
@@ -4653,6 +4709,8 @@ pointer_surface_update_scale (GdkDevice *device)
scale = MAX (scale, output_scale);
}
if (pointer->current_output_scale == scale)
return;
pointer->current_output_scale = scale;
if (pointer->cursor)
+17 -25
View File
@@ -84,7 +84,7 @@
#define MIN_SYSTEM_BELL_DELAY_MS 20
#define GTK_SHELL1_VERSION 3
#define GTK_SHELL1_VERSION 4
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
@@ -124,10 +124,6 @@ xdg_wm_base_ping (void *data,
struct xdg_wm_base *xdg_wm_base,
uint32_t serial)
{
GdkWaylandDisplay *display_wayland = data;
_gdk_wayland_display_update_serial (display_wayland, serial);
GDK_NOTE (EVENTS,
g_message ("ping, shell %p, serial %u\n", xdg_wm_base, serial));
@@ -434,26 +430,19 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "wl_seat") == 0)
{
SeatAddedClosure *closure;
static const char *required_device_manager_globals[] = {
"wl_compositor",
"wl_data_device_manager",
NULL
};
if (has_required_globals (display_wayland,
required_device_manager_globals))
_gdk_wayland_display_add_seat (display_wayland, id, version);
else
{
SeatAddedClosure *closure;
closure = g_new0 (SeatAddedClosure, 1);
closure->base.handler = seat_added_closure_run;
closure->base.required_globals = required_device_manager_globals;
closure->id = id;
closure->version = version;
postpone_on_globals_closure (display_wayland, &closure->base);
}
closure = g_new0 (SeatAddedClosure, 1);
closure->base.handler = seat_added_closure_run;
closure->base.required_globals = required_device_manager_globals;
closure->id = id;
closure->version = version;
postpone_on_globals_closure (display_wayland, &closure->base);
}
else if (strcmp (interface, "wl_data_device_manager") == 0)
{
@@ -467,12 +456,12 @@ gdk_registry_handle_global (void *data,
display_wayland->subcompositor =
wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
}
else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0 &&
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION)
else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0)
{
display_wayland->pointer_gestures =
wl_registry_bind (display_wayland->wl_registry,
id, &zwp_pointer_gestures_v1_interface, version);
id, &zwp_pointer_gestures_v1_interface,
MIN (version, GDK_ZWP_POINTER_GESTURES_V1_VERSION));
}
else if (strcmp (interface, "gtk_primary_selection_device_manager") == 0)
{
@@ -533,8 +522,6 @@ gdk_registry_handle_global (void *data,
g_hash_table_insert (display_wayland->known_globals,
GUINT_TO_POINTER (id), g_strdup (interface));
process_on_globals_closures (display_wayland);
}
static void
@@ -625,8 +612,13 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
wl_registry_add_listener (display_wayland->wl_registry, &registry_listener, display_wayland);
if (wl_display_roundtrip (display_wayland->wl_display) < 0)
{
g_object_unref (display);
return NULL;
}
_gdk_wayland_display_async_roundtrip (display_wayland);
process_on_globals_closures (display_wayland);
/* Wait for initializing to complete. This means waiting for all
* asynchrounous roundtrips that were triggered during initial roundtrip. */
+72 -14
View File
@@ -380,15 +380,11 @@ update_xft_settings (GdkScreen *screen)
}
else
{
GSettingsSchemaSource *source;
GSettingsSchema *schema;
TranslationEntry *entry;
source = g_settings_schema_source_get_default ();
schema = g_settings_schema_source_lookup (source,
"org.gnome.desktop.interface",
FALSE);
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
if (schema && g_settings_schema_has_key (schema, "font-antialiasing"))
if (entry && entry->valid)
{
settings = g_hash_table_lookup (screen_wayland->settings,
"org.gnome.desktop.interface");
@@ -546,19 +542,20 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, CLASSIC_WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "text-scaling-factor", "gtk-xft-dpi" , G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-double-click-titlebar", "gtk-titlebar-double-click", G_TYPE_STRING, { .s = "toggle-maximize" } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
{ FALSE, "org.gnome.desktop.a11y.interface", "high-contrast", "high-contrast", G_TYPE_NONE, { .b = FALSE } },
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_INT, { .i = 0 } }
};
@@ -606,6 +603,13 @@ find_translation_entry_by_setting (const gchar *setting)
return NULL;
}
static void
high_contrast_changed (GdkScreen *screen)
{
notify_setting (screen, "gtk-theme-name");
notify_setting (screen, "gtk-icon-theme-name");
}
static void
settings_changed (GSettings *settings,
const gchar *key,
@@ -619,6 +623,8 @@ settings_changed (GSettings *settings,
{
if (entry->type != G_TYPE_NONE)
notify_setting (screen, entry->setting);
else if (strcmp (key, "high-contrast") == 0)
high_contrast_changed (screen);
else
update_xft_settings (screen);
}
@@ -749,6 +755,14 @@ init_settings (GdkScreen *screen)
goto fallback;
}
if (g_variant_n_children (ret) == 0)
{
g_debug ("Received no portal settings");
g_clear_pointer (&ret, g_variant_unref);
goto fallback;
}
g_variant_get (ret, "(a{sa{sv}})", &iter);
while (g_variant_iter_loop (iter, "{s@a{sv}}", &schema, &val))
@@ -765,6 +779,7 @@ init_settings (GdkScreen *screen)
char *a = g_variant_print (v, FALSE);
g_debug ("Using portal setting for %s %s: %s\n", schema, key, a);
g_free (a);
entry->valid = TRUE;
apply_portal_setting (entry, v, screen);
}
else
@@ -992,6 +1007,32 @@ set_decoration_layout_from_entry (GdkScreen *screen,
}
}
static void
set_theme_from_entry (GdkScreen *screen,
TranslationEntry *entry,
GValue *value)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
GSettings *settings = NULL;
GSettingsSchema *schema = NULL;
gboolean hc = FALSE;
settings = (GSettings *)g_hash_table_lookup (screen_wayland->settings, "org.gnome.desktop.a11y.interface");
if (settings)
g_object_get (settings, "settings-schema", &schema, NULL);
if (schema && g_settings_schema_has_key (schema, "high-contrast"))
hc = g_settings_get_boolean (settings, "high-contrast");
g_clear_pointer (&schema, g_settings_schema_unref);
if (hc)
g_value_set_static_string (value, "HighContrast");
else
set_value_from_entry (screen, entry, value);
}
static gboolean
set_capability_setting (GdkScreen *screen,
GValue *value,
@@ -1023,6 +1064,9 @@ gdk_wayland_screen_get_setting (GdkScreen *screen,
{
if (strcmp (name, "gtk-decoration-layout") == 0)
set_decoration_layout_from_entry (screen, entry, value);
else if (strcmp (name, "gtk-theme-name") == 0 ||
strcmp (name, "gtk-icon-theme-name") == 0)
set_theme_from_entry (screen, entry, value);
else
set_value_from_entry (screen, entry, value);
return TRUE;
@@ -1633,7 +1677,21 @@ output_handle_geometry (void *data,
monitor->x = x;
monitor->y = y;
gdk_monitor_set_physical_size (GDK_MONITOR (monitor), physical_width, physical_height);
switch (transform)
{
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
gdk_monitor_set_physical_size (GDK_MONITOR (monitor),
physical_height, physical_width);
break;
default:
gdk_monitor_set_physical_size (GDK_MONITOR (monitor),
physical_width, physical_height);
}
gdk_monitor_set_subpixel_layout (GDK_MONITOR (monitor), subpixel);
gdk_monitor_set_manufacturer (GDK_MONITOR (monitor), make);
gdk_monitor_set_model (GDK_MONITOR (monitor), model);
+29 -19
View File
@@ -100,7 +100,7 @@ struct _GdkWaylandSelection
/* Source-side data */
GPtrArray *stored_selections; /* Array of StoredSelection */
GdkAtom current_request_selection;
StoredSelection *current_request_selection;
GArray *source_targets;
GdkAtom requested_target;
@@ -858,7 +858,12 @@ gdk_wayland_selection_reset_selection (GdkWaylandSelection *wayland_selection,
stored_selection = g_ptr_array_index (wayland_selection->stored_selections, i);
if (stored_selection->selection_atom == selection)
g_ptr_array_remove_index_fast (wayland_selection->stored_selections, i);
{
if (wayland_selection->current_request_selection == stored_selection)
wayland_selection->current_request_selection = NULL;
g_ptr_array_remove_index_fast (wayland_selection->stored_selections, i);
}
else
i++;
}
@@ -877,21 +882,10 @@ gdk_wayland_selection_store (GdkWindow *window,
if (type == gdk_atom_intern_static_string ("NULL"))
return;
if (selection->current_request_selection == GDK_NONE)
if (!selection->current_request_selection)
return;
stored_selection =
gdk_wayland_selection_find_stored_selection (selection, window,
selection->current_request_selection,
type);
if (!stored_selection)
{
stored_selection = stored_selection_new (selection, window,
selection->current_request_selection,
type);
g_ptr_array_add (selection->stored_selections, stored_selection);
}
stored_selection = selection->current_request_selection;
if ((mode == GDK_PROP_MODE_PREPEND ||
mode == GDK_PROP_MODE_REPLACE) &&
@@ -915,7 +909,7 @@ gdk_wayland_selection_store (GdkWindow *window,
}
/* Handle the next GDK_SELECTION_REQUEST / store, if any */
selection->current_request_selection = GDK_NONE;
selection->current_request_selection = NULL;
gdk_wayland_selection_handle_next_request (selection);
}
@@ -979,7 +973,7 @@ gdk_wayland_selection_handle_next_request (GdkWaylandSelection *wayland_selectio
gdk_wayland_selection_emit_request (stored_selection->source,
stored_selection->selection_atom,
stored_selection->type);
wayland_selection->current_request_selection = stored_selection->selection_atom;
wayland_selection->current_request_selection = stored_selection;
break;
}
}
@@ -1023,7 +1017,7 @@ gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
write_data = async_write_data_new (stored_selection, fd);
if (wayland_selection->current_request_selection == GDK_NONE)
if (!wayland_selection->current_request_selection)
gdk_wayland_selection_handle_next_request (wayland_selection);
return TRUE;
@@ -1435,13 +1429,29 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
}
void
_gdk_wayland_display_send_selection_notify (GdkDisplay *dispay,
_gdk_wayland_display_send_selection_notify (GdkDisplay *display,
GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time)
{
GdkWaylandSelection *wayland_selection;
if (property != GDK_NONE)
return;
wayland_selection = gdk_wayland_display_get_selection (display);
if (!wayland_selection->current_request_selection)
return;
g_ptr_array_remove_fast (wayland_selection->stored_selections,
wayland_selection->current_request_selection);
/* Handle the next GDK_SELECTION_REQUEST / store, if any */
wayland_selection->current_request_selection = NULL;
gdk_wayland_selection_handle_next_request (wayland_selection);
}
gint
+8
View File
@@ -87,6 +87,14 @@ void gdk_wayland_window_announce_csd (GdkWindow *window);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_announce_ssd (GdkWindow *window);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface);
G_END_DECLS
#endif /* __GDK_WAYLAND_WINDOW_H__ */
+149 -8
View File
@@ -236,6 +236,9 @@ struct _GdkWindowImplWayland
struct zxdg_imported_v1 *imported_transient_for;
GHashTable *shortcuts_inhibitors;
struct wl_callback *surface_callback;
GHashTable *frame_callback_surfaces;
};
struct _GdkWindowImplWaylandClass
@@ -572,9 +575,25 @@ frame_callback (void *data,
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
GdkFrameTimings *timings;
GDK_NOTE (EVENTS,
g_message ("frame %p", window));
if (callback == impl->surface_callback)
{
impl->surface_callback = NULL;
}
else
{
GHashTableIter iter;
gpointer surface_callback;
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
while (g_hash_table_iter_next (&iter, NULL, &surface_callback))
{
if (callback == surface_callback)
{
g_hash_table_iter_replace (&iter, NULL);
break;
}
}
}
wl_callback_destroy (callback);
if (GDK_WINDOW_DESTROYED (window))
@@ -583,6 +602,9 @@ frame_callback (void *data,
if (!impl->awaiting_frame)
return;
GDK_NOTE (EVENTS,
g_message ("frame %p", window));
impl->awaiting_frame = FALSE;
_gdk_frame_clock_thaw (clock);
@@ -660,6 +682,8 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
struct wl_callback *callback;
GHashTableIter iter;
gpointer surface, surface_callback;
if (!impl->pending_commit)
return;
@@ -667,8 +691,6 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
if (window->update_freeze_count > 0)
return;
callback = wl_surface_frame (impl->display_server.wl_surface);
wl_callback_add_listener (callback, &frame_listener, window);
_gdk_frame_clock_freeze (clock);
/* Before we commit a new buffer, make sure we've backfilled
@@ -677,6 +699,24 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
if (impl->pending_buffer_attached)
read_back_cairo_surface (window);
if (impl->surface_callback == NULL)
{
callback = wl_surface_frame (impl->display_server.wl_surface);
wl_callback_add_listener (callback, &frame_listener, window);
impl->surface_callback = callback;
}
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
while (g_hash_table_iter_next (&iter, &surface, &surface_callback))
{
if (surface_callback)
continue;
callback = wl_surface_frame (surface);
wl_callback_add_listener (callback, &frame_listener, window);
g_hash_table_iter_replace (&iter, callback);
}
/* From this commit forward, we can't write to the buffer,
* it's "live". In the future, if we need to stage more changes
* we have to allocate a new staging buffer and draw to it instead.
@@ -756,6 +796,8 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
impl->wrapper = GDK_WINDOW (window);
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
impl->using_csd = TRUE;
impl->surface_callback = NULL;
impl->frame_callback_surfaces = g_hash_table_new (NULL, NULL);
if (window->width > 65535)
{
@@ -1067,6 +1109,7 @@ gdk_window_impl_wayland_finalize (GObject *object)
g_clear_pointer (&impl->staged_updates_region, cairo_region_destroy);
g_clear_pointer (&impl->shortcuts_inhibitors, g_hash_table_unref);
g_clear_pointer (&impl->frame_callback_surfaces, g_hash_table_unref);
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
}
@@ -1156,6 +1199,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
gboolean is_xdg_popup;
gboolean is_visible;
gboolean size_changed;
impl->unconfigured_width = calculate_width_without_margin (window, width);
impl->unconfigured_height = calculate_height_without_margin (window, height);
@@ -1163,9 +1207,8 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
if (should_inhibit_resize (window))
return;
if (window->width == width &&
window->height == height &&
impl->scale == scale)
size_changed = (window->width != width || window->height != height);
if (!size_changed && impl->scale == scale)
return;
/* For xdg_popup using an xdg_positioner, there is a race condition if
@@ -1179,6 +1222,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
if (is_xdg_popup &&
is_visible &&
size_changed &&
!impl->initial_configure_received &&
!impl->configuring_popup)
gdk_window_hide (window);
@@ -1187,6 +1231,7 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
if (is_xdg_popup &&
is_visible &&
size_changed &&
!impl->initial_configure_received &&
!impl->configuring_popup)
gdk_window_show (window);
@@ -1349,6 +1394,9 @@ gdk_wayland_window_sync_margin (GdkWindow *window)
return;
gdk_wayland_window_get_window_geometry (window, &geometry);
g_return_if_fail (geometry.width > 0 && geometry.height > 0);
gdk_window_set_geometry_hints (window,
&impl->geometry_hints,
impl->geometry_mask);
@@ -1474,6 +1522,14 @@ surface_enter (void *data,
{
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
gboolean output_is_unmanaged;
output_is_unmanaged =
_gdk_wayland_screen_get_output_scale (display_wayland->screen, output) == 0;
if (output_is_unmanaged)
return;
GDK_NOTE (EVENTS,
g_message ("surface enter, window %p output %p", window, output));
@@ -3284,6 +3340,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->display_server.xdg_popup = NULL;
display_wayland->current_popups =
g_list_remove (display_wayland->current_popups, window);
if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT)
{
window->x = 0;
window->y = 0;
}
}
if (impl->display_server.xdg_surface)
{
@@ -3306,6 +3368,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->display_server.zxdg_popup_v6 = NULL;
display_wayland->current_popups =
g_list_remove (display_wayland->current_popups, window);
if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT)
{
window->x = 0;
window->y = 0;
}
}
if (impl->display_server.zxdg_surface_v6)
{
@@ -3332,7 +3400,11 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
if (impl->display_server.gtk_surface)
{
gtk_surface1_destroy (impl->display_server.gtk_surface);
if (display_wayland->gtk_shell_version >=
GTK_SURFACE1_RELEASE_SINCE_VERSION)
gtk_surface1_release (impl->display_server.gtk_surface);
else
gtk_surface1_destroy (impl->display_server.gtk_surface);
impl->display_server.gtk_surface = NULL;
impl->application.was_set = FALSE;
}
@@ -3345,6 +3417,7 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
wl_surface_destroy (impl->display_server.wl_surface);
impl->display_server.wl_surface = NULL;
impl->surface_callback = NULL;
g_slist_free (impl->display_server.outputs);
impl->display_server.outputs = NULL;
@@ -5390,3 +5463,71 @@ gdk_wayland_window_restore_shortcuts (GdkWindow *window,
g_hash_table_remove (impl->shortcuts_inhibitors, seat);
}
/**
* gdk_wayland_window_add_frame_callback_surface:
* @window: the #GdkWindow requesting callbacks
* @surface: the wl_surface to add
*
* Add @surface to a list of surfaces for which frame callback
* listeners will get set up, additionally to the one of @window.
*
* This is useful when clients use subsurfaces independently of GDK.
* For example if a client creates a subsurface that covers @window
* entirely. If this subsurface is opaque, Wayland compositors may not
* emit callbacks for the surface of @window any more.
* Adding the covering subsurface via this function ensures the
* @window will continue to update.
*
* A single callback is sufficient to trigger the next update. If more
* than one are triggered, the later ones will get ignored.
*
* Before @surface gets destroyed it must get removed again using
* gdk_wayland_window_remove_frame_callback_surface().
*
* Note that the client is responsible to commit the @surface.
* One way to archive this is to always commit after the
* #GdkSurface::after-paint signal was triggered.
*
* Since: 3.24.25
*/
void
gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
g_return_if_fail (surface != NULL);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
g_hash_table_insert (impl->frame_callback_surfaces, surface, NULL);
}
/**
* gdk_wayland_window_remove_frame_callback_surface:
* @window: the #GdkWindow requesting callbacks
* @surface: the surface to remove
*
* Remove @surface from the list of surfaces again that got added via
* gdk_wayland_window_add_frame_callback_surface().
*
* This function must be called before @surface gets destroyed.
*
* Since: 3.24.25
*/
void
gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
g_return_if_fail (surface != NULL);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
g_hash_table_remove (impl->frame_callback_surfaces, surface);
}
+5 -2
View File
@@ -1,6 +1,6 @@
<protocol name="gtk">
<interface name="gtk_shell1" version="3">
<interface name="gtk_shell1" version="4">
<description summary="gtk specific extensions">
gtk_shell is a protocol extension providing additional features for
clients implementing it.
@@ -35,7 +35,7 @@
</request>
</interface>
<interface name="gtk_surface1" version="3">
<interface name="gtk_surface1" version="4">
<request name="set_dbus_properties">
<arg name="application_id" type="string" allow-null="true"/>
<arg name="app_menu_path" type="string" allow-null="true"/>
@@ -82,6 +82,9 @@
<request name="request_focus" since="3">
<arg name="startup_id" type="string" allow-null="true"/>
</request>
<!-- Version 4 additions -->
<request name="release" type="destructor" since="4"/>
</interface>
</protocol>
+14 -1
View File
@@ -21,7 +21,10 @@ if WIN32_GLES
AM_CPPFLAGS += "-DGDK_WIN32_ENABLE_EGL=1"
endif #WIN32_GLES
LDADDS = $(GDK_DEP_LIBS)
libgdk_win32_DEP_LIBS = \
-lhid
LDADDS = $(libgdk_win32_DEP_LIBS) $(GDK_DEP_LIBS)
noinst_LTLIBRARIES = libgdk-win32.la
@@ -40,6 +43,8 @@ libgdk_win32_la_SOURCES = \
gdkdevice-virtual.h \
gdkdevice-win32.c \
gdkdevice-win32.h \
gdkdevice-winpointer.c \
gdkdevice-winpointer.h \
gdkdevice-wintab.c \
gdkdevice-wintab.h \
gdkdisplay-win32.c \
@@ -52,6 +57,9 @@ libgdk_win32_la_SOURCES = \
gdkglcontext-win32.h \
gdkglobals-win32.c \
gdkkeys-win32.c \
gdkkeys-win32.h \
gdkkeys-win32-impl.c \
gdkkeys-win32-impl-wow64.c \
gdkmain-win32.c \
gdkmonitor-win32.c \
gdkmonitor-win32.h \
@@ -78,9 +86,14 @@ libgdk_win32_la_SOURCES = \
gdkwindow-win32.c \
gdkwindow-win32.h \
pktdef.h \
winpointer.h \
wintab.h \
xcursors.h
libgdk_win32_la_LIBADD = \
$(LDADDS) \
$(NULL)
libgdkinclude_HEADERS = \
gdkwin32.h
+54 -72
View File
@@ -117,40 +117,47 @@ gdk_device_win32_query_state (GdkDevice *device,
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = GDK_WINDOW_HWND (window);
GetCursorPos (&point);
_gdk_win32_get_cursor_pos (&point);
if (root_x)
*root_x = point.x / impl->window_scale;
*root_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (root_y)
*root_y = point.y / impl->window_scale;
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x / impl->window_scale;
if (win_y)
*win_y = point.y / impl->window_scale;
*root_y = (point.y + _gdk_offset_y) / impl->window_scale;
if (window == gdk_screen_get_root_window (screen))
{
if (win_x)
*win_x += _gdk_offset_x;
*win_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y += _gdk_offset_y;
*win_y = (point.y + _gdk_offset_y) / impl->window_scale;
}
else
{
ScreenToClient (hwnd, &point);
if (root_x)
*root_x += _gdk_offset_x;
if (win_x)
*win_x = point.x / impl->window_scale;
if (root_y)
*root_y += _gdk_offset_y;
if (win_y)
*win_y = point.y / impl->window_scale;
}
if (child_window)
{
hwndc = ChildWindowFromPoint (hwnd, point);
if (window == gdk_screen_get_root_window (screen))
{
/* Always use WindowFromPoint when searching from the root window.
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwndc = GetAncestor (WindowFromPoint (point), GA_ROOT);
}
else
{
hwndc = ChildWindowFromPoint (hwnd, point);
}
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup (hwndc);
@@ -201,71 +208,46 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
GdkWindow *window = NULL;
GdkWindowImplWin32 *impl = NULL;
POINT screen_pt, client_pt;
HWND hwnd, hwndc;
HWND hwnd;
RECT rect;
GetCursorPos (&screen_pt);
if (!_gdk_win32_get_cursor_pos (&screen_pt))
return NULL;
hwnd = WindowFromPoint (screen_pt);
if (get_toplevel)
{
/* Only consider visible children of the desktop to avoid the various
* non-visible windows you often find on a running Windows box. These
* might overlap our windows and cause our walk to fail. As we assume
* WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows.
*/
hwnd = GetDesktopWindow ();
do {
window = gdk_win32_handle_table_lookup (hwnd);
if (window != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_ROOT &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
screen_to_client (hwnd, screen_pt, &client_pt);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE);
/* Verify that we're really inside the client area of the window */
if (hwndc != hwnd)
{
GetClientRect (hwndc, &rect);
screen_to_client (hwndc, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwndc = hwnd;
}
} while (hwndc != hwnd && (hwnd = hwndc, 1));
/* Use WindowFromPoint instead of ChildWindowFromPoint(Ex).
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwnd = GetAncestor (hwnd, GA_ROOT);
}
else
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
if (!get_toplevel && hwnd == NULL)
{
hwnd = WindowFromPoint (screen_pt);
/* If we didn't hit any window, return the root window */
/* note that the root window ain't a toplevel window */
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
/* If we didn't hit any window at that point, return the desktop */
if (hwnd == NULL)
{
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
return window;
}
window = gdk_win32_handle_table_lookup (hwnd);
return window;
}
window = gdk_win32_handle_table_lookup (hwnd);
if (window && (win_x || win_y))
{
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
+317
View File
@@ -0,0 +1,317 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2020 the GTK team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk/gdkwindow.h>
#include <windows.h>
#include "gdkwin32.h"
#include "gdkdevice-winpointer.h"
G_DEFINE_TYPE (GdkDeviceWinpointer, gdk_device_winpointer, GDK_TYPE_DEVICE)
static GdkModifierType
get_keyboard_mask (void)
{
GdkModifierType mask;
BYTE kbd[256];
GetKeyboardState (kbd);
mask = 0;
if (kbd[VK_SHIFT] & 0x80)
mask |= GDK_SHIFT_MASK;
if (kbd[VK_CAPITAL] & 0x80)
mask |= GDK_LOCK_MASK;
if (kbd[VK_CONTROL] & 0x80)
mask |= GDK_CONTROL_MASK;
if (kbd[VK_MENU] & 0x80)
mask |= GDK_MOD1_MASK;
return mask;
}
static gboolean
gdk_device_winpointer_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events)
{
return FALSE;
}
static void
gdk_device_winpointer_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
if (axes)
{
gsize size = sizeof (double) * device_winpointer->num_axes;
memcpy (axes, device_winpointer->last_axis_data, size);
}
}
static void
gdk_device_winpointer_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
{
}
static void
gdk_device_winpointer_warp (GdkDevice *device,
GdkScreen *screen,
gdouble x,
gdouble y)
{
}
static void
gdk_device_winpointer_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gdouble *root_x,
gdouble *root_y,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
GdkScreen *screen = gdk_window_get_screen (window);
HWND hwnd = GDK_WINDOW_HWND (window);
HWND hwndc = NULL;
POINT point;
_gdk_win32_get_cursor_pos (&point);
if (root_x)
*root_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (root_y)
*root_y = (point.y + _gdk_offset_y) / impl->window_scale;
if (window == gdk_screen_get_root_window (screen))
{
if (win_x)
*win_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (point.y + _gdk_offset_y) / impl->window_scale;
}
else
{
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x / impl->window_scale;
if (win_y)
*win_y = point.y / impl->window_scale;
}
if (child_window)
{
if (window == gdk_screen_get_root_window (screen))
{
/* Always use WindowFromPoint when searching from the root window.
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwndc = GetAncestor (WindowFromPoint (point), GA_ROOT);
}
else
{
hwndc = ChildWindowFromPoint (hwnd, point);
}
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup (hwndc);
else
*child_window = NULL; /* Direct child unknown to gdk */
}
if (root_window)
*root_window = gdk_screen_get_root_window (screen);
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
}
static GdkGrabStatus
gdk_device_winpointer_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_)
{
return GDK_GRAB_SUCCESS;
}
static void
gdk_device_winpointer_ungrab (GdkDevice *device,
guint32 time_)
{
}
static void
screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
{
*client_pt = screen_pt;
ScreenToClient (hwnd, client_pt);
}
GdkWindow *
_gdk_device_winpointer_window_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (device);
GdkWindow *window = NULL;
GdkWindowImplWin32 *impl = NULL;
POINT screen_pt, client_pt;
HWND hwnd;
RECT rect;
if (!_gdk_win32_get_cursor_pos (&screen_pt))
return NULL;
hwnd = WindowFromPoint (screen_pt);
if (get_toplevel)
{
/* Use WindowFromPoint instead of ChildWindowFromPoint(Ex).
* Only WindowFromPoint is able to look through transparent
* layered windows.
*/
hwnd = GetAncestor (hwnd, GA_ROOT);
}
/* Verify that we're really inside the client area of the window */
GetClientRect (hwnd, &rect);
screen_to_client (hwnd, screen_pt, &client_pt);
if (!PtInRect (&rect, client_pt))
hwnd = NULL;
if (!get_toplevel && hwnd == NULL)
{
/* If we didn't hit any window, return the root window */
/* note that the root window ain't a toplevel window */
window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = (screen_pt.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y = (screen_pt.y + _gdk_offset_y) / impl->window_scale;
return window;
}
window = gdk_win32_handle_table_lookup (hwnd);
if (window && (win_x || win_y))
{
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (win_x)
*win_x = client_pt.x / impl->window_scale;
if (win_y)
*win_y = client_pt.y / impl->window_scale;
}
if (mask)
{
*mask = get_keyboard_mask ();
*mask |= device_winpointer->last_button_mask;
}
return window;
}
static void
gdk_device_winpointer_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
{
}
static void
gdk_device_winpointer_init (GdkDeviceWinpointer *device_winpointer)
{
device_winpointer->device_handle = NULL;
device_winpointer->start_cursor_id = 0;
device_winpointer->end_cursor_id = 0;
device_winpointer->origin_x = 0;
device_winpointer->origin_y = 0;
device_winpointer->scale_x = 0.0;
device_winpointer->scale_y = 0.0;
device_winpointer->last_axis_data = NULL;
device_winpointer->num_axes = 0;
device_winpointer->last_button_mask = 0;
}
static void
gdk_device_winpointer_finalize (GObject *object)
{
GdkDeviceWinpointer *device_winpointer = GDK_DEVICE_WINPOINTER (object);
g_free (device_winpointer->last_axis_data);
G_OBJECT_CLASS (gdk_device_winpointer_parent_class)->finalize (object);
}
static void
gdk_device_winpointer_class_init (GdkDeviceWinpointerClass *klass)
{
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_device_winpointer_finalize;
device_class->get_history = gdk_device_winpointer_get_history;
device_class->get_state = gdk_device_winpointer_get_state;
device_class->set_window_cursor = gdk_device_winpointer_set_window_cursor;
device_class->warp = gdk_device_winpointer_warp;
device_class->query_state = gdk_device_winpointer_query_state;
device_class->grab = gdk_device_winpointer_grab;
device_class->ungrab = gdk_device_winpointer_ungrab;
device_class->window_at_position = _gdk_device_winpointer_window_at_position;
device_class->select_window_events = gdk_device_winpointer_select_window_events;
}
+64
View File
@@ -0,0 +1,64 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2020 the GTK team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DEVICE_WINPOINTER_H__
#define __GDK_DEVICE_WINPOINTER_H__
#include <gdk/gdkdeviceprivate.h>
#include <windows.h>
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE_WINPOINTER (gdk_device_winpointer_get_type ())
#define GDK_DEVICE_WINPOINTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointer))
#define GDK_DEVICE_WINPOINTER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointerClass))
#define GDK_IS_DEVICE_WINPOINTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_WINPOINTER))
#define GDK_IS_DEVICE_WINPOINTER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_WINPOINTER))
#define GDK_DEVICE_WINPOINTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_WINPOINTER, GdkDeviceWinpointerClass))
typedef struct _GdkDeviceWinpointer GdkDeviceWinpointer;
typedef struct _GdkDeviceWinpointerClass GdkDeviceWinpointerClass;
struct _GdkDeviceWinpointer
{
GdkDevice parent_instance;
HANDLE device_handle;
UINT32 start_cursor_id;
UINT32 end_cursor_id;
int origin_x;
int origin_y;
double scale_x;
double scale_y;
double *last_axis_data;
unsigned num_axes;
GdkModifierType last_button_mask;
};
struct _GdkDeviceWinpointerClass
{
GdkDeviceClass parent_class;
};
GType gdk_device_winpointer_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GDK_DEVICE_WINPOINTER_H__ */
+16 -14
View File
@@ -128,29 +128,31 @@ gdk_device_wintab_query_state (GdkDevice *device,
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = GDK_WINDOW_HWND (window);
GetCursorPos (&point);
_gdk_win32_get_cursor_pos (&point);
if (root_x)
*root_x = point.x / impl->window_scale;
*root_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (root_y)
*root_y = point.y / impl->window_scale;
*root_y = (point.y + _gdk_offset_y) / impl->window_scale;
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x / impl->window_scale;
if (win_y)
*win_y = point.y / impl->window_scale;
if (window == gdk_get_default_root_window ())
if (window == gdk_screen_get_root_window (screen))
{
if (win_x)
*win_x += _gdk_offset_x;
*win_x = (point.x + _gdk_offset_x) / impl->window_scale;
if (win_y)
*win_y += _gdk_offset_y;
*win_y = (point.y + _gdk_offset_y) / impl->window_scale;
}
else
{
ScreenToClient (hwnd, &point);
if (win_x)
*win_x = point.x / impl->window_scale;
if (win_y)
*win_y = point.y / impl->window_scale;
}
if (child_window)
+2 -2
View File
@@ -49,8 +49,8 @@ struct _GdkDeviceWintab
UINT cursor;
/* The cursor's CSR_PKTDATA */
WTPKT pktdata;
/* Azimuth and altitude axis */
AXIS orientation_axes[2];
/* Azimuth, altitude and twist axis */
AXIS orientation_axes[3];
};
struct _GdkDeviceWintabClass
File diff suppressed because it is too large Load Diff
+27 -5
View File
@@ -41,6 +41,8 @@ struct _GdkDeviceManagerWin32
/* Fake slave devices */
GdkDevice *system_pointer;
GdkDevice *system_keyboard;
GList *winpointer_devices;
GList *wintab_devices;
/* Bumped up every time a wintab device enters the proximity
@@ -57,11 +59,31 @@ 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 (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window);
typedef void
(*crossing_cb_t)(GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
POINT *screen_pt,
guint32 time_);
void gdk_winpointer_initialize_window (GdkWindow *window);
gboolean gdk_winpointer_should_forward_message (MSG *msg);
void gdk_winpointer_input_events (GdkDisplay *display,
GdkWindow *window,
crossing_cb_t crossing_cb,
MSG *msg);
gboolean gdk_winpointer_get_message_info (GdkDisplay *display,
MSG *msg,
GdkDevice **device,
guint32 *time_);
void gdk_winpointer_interaction_ended (MSG *msg);
void gdk_winpointer_finalize_window (GdkWindow *window);
void _gdk_wintab_set_tablet_active (void);
gboolean gdk_wintab_input_events (GdkDisplay *display,
GdkEvent *event,
MSG *msg,
GdkWindow *window);
G_END_DECLS
+42 -14
View File
@@ -31,10 +31,6 @@
#include "gdkmonitor-win32.h"
#include "gdkwin32.h"
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
#include "gdkwin32langnotification.h"
#ifndef IMAGE_FILE_MACHINE_ARM64
@@ -1038,38 +1034,71 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
}
}
static void
_gdk_win32_check_on_arm64 (GdkWin32Display *display)
gboolean
_gdk_win32_check_processor (GdkWin32ProcessorCheckType check_type)
{
static gsize checked = 0;
static gboolean is_arm64 = FALSE;
static gboolean is_wow64 = FALSE;
if (g_once_init_enter (&checked))
{
gboolean fallback_wow64_check = FALSE;
HMODULE kernel32 = LoadLibraryW (L"kernel32.dll");
if (kernel32 != NULL)
{
display->cpu_funcs.isWow64Process2 =
typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
funcIsWow64Process2 isWow64Process2 =
(funcIsWow64Process2) GetProcAddress (kernel32, "IsWow64Process2");
if (display->cpu_funcs.isWow64Process2 != NULL)
if (isWow64Process2 != NULL)
{
USHORT proc_cpu = 0;
USHORT native_cpu = 0;
display->cpu_funcs.isWow64Process2 (GetCurrentProcess (),
&proc_cpu,
&native_cpu);
isWow64Process2 (GetCurrentProcess (), &proc_cpu, &native_cpu);
if (native_cpu == IMAGE_FILE_MACHINE_ARM64)
display->running_on_arm64 = TRUE;
is_arm64 = TRUE;
if (proc_cpu != IMAGE_FILE_MACHINE_UNKNOWN)
is_wow64 = TRUE;
}
else
{
fallback_wow64_check = TRUE;
}
FreeLibrary (kernel32);
}
else
{
fallback_wow64_check = TRUE;
}
if (fallback_wow64_check)
IsWow64Process (GetCurrentProcess (), &is_wow64);
g_once_init_leave (&checked, 1);
}
switch (check_type)
{
case GDK_WIN32_ARM64:
return is_arm64;
break;
case GDK_WIN32_WOW64:
return is_wow64;
break;
default:
g_warning ("unknown CPU check type");
return FALSE;
break;
}
}
static void
@@ -1080,7 +1109,6 @@ gdk_win32_display_init (GdkWin32Display *display)
display->monitors = g_ptr_array_new_with_free_func (g_object_unref);
_gdk_win32_enable_hidpi (display);
_gdk_win32_check_on_arm64 (display);
/* if we have DPI awareness, set up fixed scale if set */
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE &&
@@ -1299,7 +1327,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->convert_selection = _gdk_win32_display_convert_selection;
display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_win32_display_utf8_to_string_target;
display_class->make_gl_context_current = _gdk_win32_display_make_gl_context_current;
display_class->make_gl_context_current = gdk_win32_display_make_gl_context_current;
display_class->get_n_monitors = gdk_win32_display_get_n_monitors;
display_class->get_monitor = gdk_win32_display_get_monitor;
+23 -26
View File
@@ -18,10 +18,7 @@
*/
#include "gdkdisplayprivate.h"
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
#include "gdkglcontext-win32.h"
#ifndef __GDK_DISPLAY__WIN32_H__
#define __GDK_DISPLAY__WIN32_H__
@@ -33,6 +30,15 @@ typedef enum _GdkWin32ProcessDpiAwareness {
PROCESS_PER_MONITOR_DPI_AWARE = 2
} GdkWin32ProcessDpiAwareness;
/* Define values for GL type used */
typedef enum _GdkWin32GLContextType
{
GDK_WIN32_GL_PENDING,
GDK_WIN32_GL_NONE,
GDK_WIN32_GL_WGL,
GDK_WIN32_GL_EGL
} GdkWin32GLContextType;
/* APIs from shcore.dll */
typedef HRESULT (WINAPI *funcSetProcessDpiAwareness) (GdkWin32ProcessDpiAwareness value);
typedef HRESULT (WINAPI *funcGetProcessDpiAwareness) (HANDLE handle,
@@ -60,13 +66,6 @@ typedef struct _GdkWin32User32DPIFuncs
funcIsProcessDPIAware isDpiAwareFunc;
} GdkWin32User32DPIFuncs;
/* Detect running architecture */
typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
typedef struct _GdkWin32KernelCPUFuncs
{
funcIsWow64Process2 isWow64Process2;
} GdkWin32KernelCPUFuncs;
struct _GdkWin32Display
{
GdkDisplay display;
@@ -81,33 +80,33 @@ struct _GdkWin32Display
HWND hwnd;
HWND clipboard_hwnd;
/* WGL/OpenGL Items */
guint have_wgl : 1;
/* OpenGL Items */
GdkWin32GLContextType gl_type;
guint gl_version;
HWND gl_hwnd;
#ifdef GDK_WIN32_ENABLE_EGL
/* EGL (Angle) Items */
guint have_egl : 1;
guint egl_version;
EGLDisplay egl_disp;
HDC hdc_egl_temp;
#endif
GPtrArray *monitors;
/* WGL Items */
guint hasWglARBCreateContext : 1;
guint hasWglEXTSwapControl : 1;
guint hasWglOMLSyncControl : 1;
guint hasWglARBPixelFormat : 1;
guint hasWglARBmultisample : 1;
/* compensate around Intel OpenGL driver issues on blitting, see issue #3487 */
guint needIntelGLWorkaround : 1;
/* EGL (Angle) Items */
HDC hdc_egl_temp;
#ifdef GDK_WIN32_ENABLE_EGL
EGLDisplay egl_disp;
EGLConfig egl_config;
guint hasEglKHRCreateContext : 1;
guint hasEglSurfacelessContext : 1;
EGLint egl_min_swap_interval;
#endif
GPtrArray *monitors;
/* HiDPI Items */
guint have_at_least_win81 : 1;
GdkWin32ProcessDpiAwareness dpi_aware_type;
@@ -118,8 +117,6 @@ struct _GdkWin32Display
GdkWin32User32DPIFuncs user32_dpi_funcs;
/* Running CPU items */
guint running_on_arm64 : 1;
GdkWin32KernelCPUFuncs cpu_funcs;
};
struct _GdkWin32DisplayClass
+60 -82
View File
@@ -588,8 +588,8 @@ idroptarget_dragenter (LPDROPTARGET This,
ctx->context->suggested_action = get_suggested_action (grfKeyState);
set_data_object (&sel_win32->dnd_data_object_target, pDataObj);
pt_x = pt.x / context_win32->scale + _gdk_offset_x;
pt_y = pt.y / context_win32->scale + _gdk_offset_y;
pt_x = (pt.x + _gdk_offset_x) / context_win32->scale;
pt_y = (pt.y + _gdk_offset_y) / context_win32->scale;
dnd_event_put (GDK_DRAG_ENTER, ctx->context, pt_x, pt_y, TRUE);
dnd_event_put (GDK_DRAG_MOTION, ctx->context, pt_x, pt_y, TRUE);
context_win32->last_key_state = grfKeyState;
@@ -611,8 +611,8 @@ idroptarget_dragover (LPDROPTARGET This,
{
target_drag_context *ctx = (target_drag_context *) This;
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (ctx->context);
gint pt_x = pt.x / context_win32->scale + _gdk_offset_x;
gint pt_y = pt.y / context_win32->scale + _gdk_offset_y;
gint pt_x = (pt.x + _gdk_offset_x) / context_win32->scale;
gint pt_y = (pt.y + _gdk_offset_y) / context_win32->scale;
ctx->context->suggested_action = get_suggested_action (grfKeyState);
@@ -664,8 +664,8 @@ idroptarget_drop (LPDROPTARGET This,
{
target_drag_context *ctx = (target_drag_context *) This;
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (ctx->context);
gint pt_x = pt.x / context_win32->scale + _gdk_offset_x;
gint pt_y = pt.y / context_win32->scale + _gdk_offset_y;
gint pt_x = (pt.x + _gdk_offset_x) / context_win32->scale;
gint pt_y = (pt.y + _gdk_offset_y) / context_win32->scale;
GdkWin32Selection *sel_win32 = _gdk_win32_selection_get ();
GDK_NOTE (DND, g_print ("idroptarget_drop %p ", This));
@@ -774,6 +774,7 @@ send_change_events (GdkDragContext *context,
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
POINT pt;
POINT pt_client;
HMONITOR monitor = NULL;
gboolean changed = FALSE;
HWND hwnd = GDK_WINDOW_HWND (context->source_window);
LPARAM lparam;
@@ -784,13 +785,31 @@ send_change_events (GdkDragContext *context,
if (!API_CALL (GetCursorPos, (&pt)))
return FALSE;
/* Move the DND IPC window to the monitor the cursor is currently on.
This esures that OLE2 DND works correctly even if the DPI awareness
isn't per-monitor.
*/
monitor = MonitorFromPoint (pt, MONITOR_DEFAULTTONEAREST);
if (monitor != context_win32->last_monitor)
{
MONITORINFO mi;
mi.cbSize = sizeof(mi);
if (GetMonitorInfoW (monitor, &mi))
{
MoveWindow (hwnd, mi.rcWork.left, mi.rcWork.top, 1, 1, FALSE);
}
context_win32->last_monitor = monitor;
}
pt_client = pt;
if (!API_CALL (ScreenToClient, (hwnd, &pt_client)))
return FALSE;
pt_x = pt.x / context_win32->scale + _gdk_offset_x;
pt_y = pt.y / context_win32->scale + _gdk_offset_y;
pt_x = (pt.x + _gdk_offset_x) / context_win32->scale;
pt_y = (pt.y + _gdk_offset_y) / context_win32->scale;
if (pt_x != context_win32->last_x || pt_y != context_win32->last_y ||
key_state != context_win32->last_key_state)
@@ -909,8 +928,8 @@ idropsource_givefeedback (LPDROPSOURCE This,
else if (ctx->context->dest_window == NULL)
ctx->context->dest_window = g_object_ref (gdk_get_default_root_window ());
context_win32->last_x = pt.x / context_win32->scale + _gdk_offset_x;
context_win32->last_y = pt.y / context_win32->scale + _gdk_offset_y;
context_win32->last_x = (pt.x + _gdk_offset_x) / context_win32->scale;
context_win32->last_y = (pt.y + _gdk_offset_y) / context_win32->scale;
e = gdk_event_new (GDK_DRAG_STATUS);
@@ -1708,8 +1727,8 @@ gdk_dropfiles_filter (GdkXEvent *xev,
DragQueryPoint (hdrop, &pt);
ClientToScreen (msg->hwnd, &pt);
event->dnd.x_root = pt.x / context_win32->scale + _gdk_offset_x;
event->dnd.y_root = pt.y / context_win32->scale + _gdk_offset_y;
event->dnd.x_root = (pt.x + _gdk_offset_x) / context_win32->scale;
event->dnd.y_root = (pt.y + _gdk_offset_y) / context_win32->scale;
event->dnd.time = _gdk_win32_get_next_tick (msg->time);
nfiles = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0);
@@ -2204,43 +2223,6 @@ _gdk_win32_window_get_drag_protocol (GdkWindow *window,
return protocol;
}
typedef struct {
gint x;
gint y;
HWND ignore;
HWND result;
} find_window_enum_arg;
static BOOL CALLBACK
find_window_enum_proc (HWND hwnd,
LPARAM lparam)
{
RECT rect;
POINT tl, br;
find_window_enum_arg *a = (find_window_enum_arg *) lparam;
if (hwnd == a->ignore)
return TRUE;
if (!IsWindowVisible (hwnd))
return TRUE;
tl.x = tl.y = 0;
ClientToScreen (hwnd, &tl);
GetClientRect (hwnd, &rect);
br.x = rect.right;
br.y = rect.bottom;
ClientToScreen (hwnd, &br);
if (a->x >= tl.x && a->y >= tl.y && a->x < br.x && a->y < br.y)
{
a->result = hwnd;
return FALSE;
}
else
return TRUE;
}
static GdkWindow *
gdk_win32_drag_context_find_window (GdkDragContext *context,
GdkWindow *drag_window,
@@ -2250,51 +2232,47 @@ gdk_win32_drag_context_find_window (GdkDragContext *context,
GdkDragProtocol *protocol)
{
GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context);
GdkWindow *dest_window, *dw;
find_window_enum_arg a;
GdkWindow *toplevel = NULL;
HWND hwnd = NULL;
POINT pt;
a.x = x_root * context_win32->scale - _gdk_offset_x;
a.y = y_root * context_win32->scale - _gdk_offset_y;
a.ignore = drag_window ? GDK_WINDOW_HWND (drag_window) : NULL;
a.result = NULL;
pt.x = x_root * context_win32->scale - _gdk_offset_x;
pt.y = y_root * context_win32->scale - _gdk_offset_y;
GDK_NOTE (DND,
g_print ("gdk_drag_find_window_real: %p %+d%+d\n",
(drag_window ? GDK_WINDOW_HWND (drag_window) : NULL),
a.x, a.y));
g_print ("gdk_drag_find_window_real: %+d%+d\n",
(int) pt.x, (int) pt.y));
EnumWindows (find_window_enum_proc, (LPARAM) &a);
hwnd = WindowFromPoint (pt);
if (a.result == NULL)
dest_window = NULL;
else
if (hwnd)
{
dw = gdk_win32_handle_table_lookup (a.result);
if (dw)
GdkWindow *window = gdk_win32_handle_table_lookup (hwnd);
if (window)
{
dest_window = gdk_window_get_toplevel (dw);
g_object_ref (dest_window);
toplevel = gdk_window_get_toplevel (window);
g_object_ref (toplevel);
}
else
dest_window = gdk_win32_window_foreign_new_for_display (gdk_screen_get_display (screen), a.result);
if (use_ole2_dnd)
*protocol = GDK_DRAG_PROTO_OLE2;
else if (context->source_window)
*protocol = GDK_DRAG_PROTO_LOCAL;
else
*protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
toplevel = gdk_win32_window_foreign_new_for_display (gdk_screen_get_display (screen), hwnd);
}
GDK_NOTE (DND,
g_print ("gdk_drag_find_window: %p %+d%+d: %p: %p %s\n",
(drag_window ? GDK_WINDOW_HWND (drag_window) : NULL),
x_root, y_root,
a.result,
(dest_window ? GDK_WINDOW_HWND (dest_window) : NULL),
_gdk_win32_drag_protocol_to_string (*protocol)));
if (use_ole2_dnd)
*protocol = GDK_DRAG_PROTO_OLE2;
else if (context->source_window)
*protocol = GDK_DRAG_PROTO_LOCAL;
else
*protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
return dest_window;
GDK_NOTE (DND,
g_print ("gdk_drag_find_window: %+d%+d: %p: %p %s\n",
x_root, y_root,
hwnd,
(toplevel ? GDK_WINDOW_HWND (toplevel) : NULL),
_gdk_win32_drag_protocol_to_string (*protocol)));
return toplevel;
}
static gboolean
+341 -75
View File
@@ -19,7 +19,7 @@
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* Modified by the GTK+ Team and others 1997-2020. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
@@ -54,6 +54,7 @@
#include "gdkglcontext-win32.h"
#include "gdkdevicemanager-win32.h"
#include "gdkdeviceprivate.h"
#include "gdkdevice-virtual.h"
#include "gdkdevice-wintab.h"
#include "gdkwin32dnd.h"
#include "gdkdisplay-win32.h"
@@ -61,6 +62,8 @@
#include "gdkdndprivate.h"
#include <windowsx.h>
#include <tpcshrd.h>
#include "winpointer.h"
#ifdef G_WITH_CYGWIN
#include <fcntl.h>
@@ -153,6 +156,10 @@ static int both_shift_pressed[2]; /* to store keycodes for shift keys */
static HHOOK keyboard_hook = NULL;
static UINT aerosnap_message;
static gboolean pen_touch_input;
static POINT pen_touch_cursor_position;
static LONG last_digitizer_time;
static void
track_mouse_event (DWORD dwFlags,
HWND hwnd)
@@ -187,6 +194,18 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
return cur_tick = suggested_tick;
}
BOOL
_gdk_win32_get_cursor_pos (LPPOINT lpPoint)
{
if (pen_touch_input)
{
*lpPoint = pen_touch_cursor_position;
return TRUE;
}
else
return GetCursorPos (lpPoint);
}
static void
generate_focus_event (GdkDeviceManager *device_manager,
GdkWindow *window,
@@ -228,6 +247,7 @@ generate_grab_broken_event (GdkDeviceManager *device_manager,
{
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_pointer;
_gdk_device_virtual_set_active (device, source_device);
}
event->grab_broken.window = window;
@@ -635,11 +655,9 @@ build_key_event_state (GdkEvent *event,
BYTE *key_state)
{
GdkWin32Keymap *keymap;
keymap = GDK_WIN32_KEYMAP (_gdk_win32_display_get_keymap (_gdk_display));
event->key.state = 0;
if (key_state[VK_SHIFT] & 0x80)
event->key.state |= GDK_SHIFT_MASK;
event->key.state = _gdk_win32_keymap_get_mod_mask (keymap);
if (key_state[VK_CAPITAL] & 0x01)
event->key.state |= GDK_LOCK_MASK;
@@ -655,26 +673,7 @@ build_key_event_state (GdkEvent *event,
if (key_state[VK_XBUTTON2] & 0x80)
event->key.state |= GDK_BUTTON5_MASK;
keymap = GDK_WIN32_KEYMAP (_gdk_win32_display_get_keymap (_gdk_display));
event->key.group = _gdk_win32_keymap_get_active_group (keymap);
if (_gdk_win32_keymap_has_altgr (keymap) &&
(key_state[VK_LCONTROL] & 0x80) &&
(key_state[VK_RMENU] & 0x80))
{
event->key.state |= GDK_MOD2_MASK;
if (key_state[VK_RCONTROL] & 0x80)
event->key.state |= GDK_CONTROL_MASK;
if (key_state[VK_LMENU] & 0x80)
event->key.state |= GDK_MOD1_MASK;
}
else
{
if (key_state[VK_CONTROL] & 0x80)
event->key.state |= GDK_CONTROL_MASK;
if (key_state[VK_MENU] & 0x80)
event->key.state |= GDK_MOD1_MASK;
}
}
static gint
@@ -1237,6 +1236,7 @@ do_show_window (GdkWindow *window, gboolean hide_window)
static void
send_crossing_event (GdkDisplay *display,
GdkDevice *source_device,
GdkWindow *window,
GdkEventType type,
GdkCrossingMode mode,
@@ -1271,7 +1271,7 @@ send_crossing_event (GdkDisplay *display,
event = gdk_event_new (type);
event->crossing.window = window;
event->crossing.subwindow = subwindow;
event->crossing.time = _gdk_win32_get_next_tick (time_);
event->crossing.time = time_;
event->crossing.x = pt.x / impl->window_scale;
event->crossing.y = pt.y / impl->window_scale;
event->crossing.x_root = (screen_pt->x + _gdk_offset_x) / impl->window_scale;
@@ -1283,9 +1283,11 @@ send_crossing_event (GdkDisplay *display,
event->crossing.focus = FALSE;
event->crossing.state = mask;
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, device_manager->system_pointer);
gdk_event_set_source_device (event, source_device);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
_gdk_device_virtual_set_active (device_manager->core_pointer, source_device);
_gdk_win32_append_event (event);
}
@@ -1336,6 +1338,7 @@ find_common_ancestor (GdkWindow *win1,
void
synthesize_crossing_events (GdkDisplay *display,
GdkDevice *source_device,
GdkWindow *src,
GdkWindow *dest,
GdkCrossingMode mode,
@@ -1370,6 +1373,7 @@ synthesize_crossing_events (GdkDisplay *display,
else
notify_type = GDK_NOTIFY_ANCESTOR;
send_crossing_event (display,
source_device,
a, GDK_LEAVE_NOTIFY,
mode,
notify_type,
@@ -1389,6 +1393,7 @@ synthesize_crossing_events (GdkDisplay *display,
while (win != c && win->window_type != GDK_WINDOW_ROOT)
{
send_crossing_event (display,
source_device,
win, GDK_LEAVE_NOTIFY,
mode,
notify_type,
@@ -1431,6 +1436,7 @@ synthesize_crossing_events (GdkDisplay *display,
next = b;
send_crossing_event (display,
source_device,
win, GDK_ENTER_NOTIFY,
mode,
notify_type,
@@ -1450,6 +1456,7 @@ synthesize_crossing_events (GdkDisplay *display,
notify_type = GDK_NOTIFY_INFERIOR;
send_crossing_event (display,
source_device,
b, GDK_ENTER_NOTIFY,
mode,
notify_type,
@@ -1459,6 +1466,27 @@ synthesize_crossing_events (GdkDisplay *display,
}
}
static void
make_crossing_event (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
POINT *screen_pt,
guint32 time_)
{
GDK_NOTE (EVENTS, g_print (" mouse_window %p -> %p",
mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
window ? GDK_WINDOW_HWND (window) : NULL));
synthesize_crossing_events (display,
device,
mouse_window, window,
GDK_CROSSING_NORMAL,
screen_pt,
0, /* TODO: Set right mask */
time_,
FALSE);
g_set_object (&mouse_window, window);
}
/* The check_extended flag controls whether to check if the windows want
* events from extended input devices and if the message should be skipped
* because an extended input device is active
@@ -1579,8 +1607,8 @@ _gdk_win32_get_window_rect (GdkWindow *window,
if (gdk_window_get_parent (window) == gdk_get_default_root_window ())
{
ClientToScreen (hwnd, &point);
point.x += _gdk_offset_x * window_impl->window_scale;
point.y += _gdk_offset_y * window_impl->window_scale;
point.x += _gdk_offset_x;
point.y += _gdk_offset_y;
}
rect->left = point.x;
@@ -1838,7 +1866,7 @@ generate_button_event (GdkEventType type,
GdkWindow *window,
MSG *msg)
{
GdkEvent *event = gdk_event_new (type);
GdkEvent *event;
GdkDeviceManagerWin32 *device_manager;
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
@@ -1847,6 +1875,7 @@ generate_button_event (GdkEventType type,
device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (gdk_display_get_default ()));
event = gdk_event_new (type);
event->button.window = window;
event->button.time = _gdk_win32_get_next_tick (msg->time);
event->button.x = current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->window_scale;
@@ -1860,6 +1889,8 @@ generate_button_event (GdkEventType type,
gdk_event_set_source_device (event, device_manager->system_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
_gdk_device_virtual_set_active (device_manager->core_pointer, device_manager->system_pointer);
_gdk_win32_append_event (event);
}
@@ -2103,6 +2134,8 @@ gdk_event_translate (MSG *msg,
GdkDeviceGrabInfo *pointer_grab = NULL;
GdkWindow *grab_window = NULL;
crossing_cb_t crossing_cb = NULL;
gint button;
GdkAtom target;
@@ -2599,6 +2632,8 @@ gdk_event_translate (MSG *msg,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
g_set_object (&window, find_window_for_mouse_event (window, msg));
/* TODO_CSW?: there used to some synthesize and propagate */
if (GDK_WINDOW_DESTROYED (window))
@@ -2638,6 +2673,8 @@ gdk_event_translate (MSG *msg,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
g_set_object (&window, find_window_for_mouse_event (window, msg));
if (pointer_grab != NULL && pointer_grab->implicit)
@@ -2664,11 +2701,12 @@ gdk_event_translate (MSG *msg,
}
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
native_window, new_window,
GDK_CROSSING_UNGRAB,
&msg->pt,
0, /* TODO: Set right mask */
msg->time,
_gdk_win32_get_next_tick (msg->time),
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = NULL;
@@ -2694,6 +2732,13 @@ gdk_event_translate (MSG *msg,
(gpointer) msg->wParam,
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER &&
( (msg->time - last_digitizer_time) < 200 ||
-(msg->time - last_digitizer_time) < 200 ))
break;
pen_touch_input = FALSE;
new_window = window;
if (pointer_grab != NULL)
@@ -2721,15 +2766,16 @@ gdk_event_translate (MSG *msg,
if (mouse_window != new_window)
{
GDK_NOTE (EVENTS, g_print (" mouse_sinwod %p -> %p",
GDK_NOTE (EVENTS, g_print (" mouse_window %p -> %p",
mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
new_window ? GDK_WINDOW_HWND (new_window) : NULL));
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
mouse_window, new_window,
GDK_CROSSING_NORMAL,
&msg->pt,
0, /* TODO: Set right mask */
msg->time,
_gdk_win32_get_next_tick (msg->time),
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = NULL;
@@ -2781,6 +2827,8 @@ gdk_event_translate (MSG *msg,
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_pointer));
_gdk_device_virtual_set_active (device_manager_win32->core_pointer, device_manager_win32->system_pointer);
_gdk_win32_append_event (event);
}
@@ -2791,12 +2839,17 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
pen_touch_input = FALSE;
break;
case WM_MOUSELEAVE:
GDK_NOTE (EVENTS, g_print (" %d (%ld,%ld)",
HIWORD (msg->wParam), msg->pt.x, msg->pt.y));
pen_touch_input = FALSE;
new_window = NULL;
hwnd = WindowFromPoint (msg->pt);
ignore_leave = FALSE;
@@ -2822,11 +2875,12 @@ gdk_event_translate (MSG *msg,
if (!ignore_leave)
synthesize_crossing_events (display,
device_manager_win32->system_pointer,
mouse_window, new_window,
GDK_CROSSING_NORMAL,
&msg->pt,
0, /* TODO: Set right mask */
msg->time,
_gdk_win32_get_next_tick (msg->time),
FALSE);
g_set_object (&mouse_window, new_window);
mouse_window_ignored_leave = ignore_leave ? new_window : NULL;
@@ -2835,6 +2889,215 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_POINTERDOWN:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != window)
crossing_cb = make_crossing_event;
gdk_winpointer_input_events (display, window, crossing_cb, msg);
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERUP:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
gdk_winpointer_input_events (display, window, NULL, msg);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_end_move_resize_drag (window);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERUPDATE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != window)
crossing_cb = make_crossing_event;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_do_move_resize_drag (window, current_root_x, current_root_y);
}
else
{
gdk_winpointer_input_events (display, window, crossing_cb, msg);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_NCPOINTERUPDATE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) &&
!IS_POINTER_INCONTACT_WPARAM (msg->wParam) &&
mouse_window != NULL)
{
GdkDevice *event_device = NULL;
guint32 event_time = 0;
if (gdk_winpointer_get_message_info (display, msg, &event_device, &event_time))
{
make_crossing_event(display,
event_device,
NULL,
&pen_touch_cursor_position,
event_time);
}
}
return_val = FALSE; /* forward to DefWindowProc */
break;
case WM_POINTERENTER:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (pointer_grab != NULL &&
!pointer_grab->implicit &&
!pointer_grab->owner_events)
g_set_object (&window, pointer_grab->native_window);
if (IS_POINTER_NEW_WPARAM (msg->wParam))
{
gdk_winpointer_input_events (display, window, NULL, msg);
}
*ret_valp = 0;
return_val = TRUE;
break;
case WM_POINTERLEAVE:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINPOINTER ||
gdk_winpointer_should_forward_message (msg))
{
return_val = FALSE;
break;
}
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
if (!IS_POINTER_INRANGE_WPARAM (msg->wParam))
{
gdk_winpointer_input_events (display, window, NULL, msg);
}
else if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != NULL)
{
GdkDevice *event_device = NULL;
guint32 event_time = 0;
if (gdk_winpointer_get_message_info (display, msg, &event_device, &event_time))
{
make_crossing_event(display,
event_device,
NULL,
&pen_touch_cursor_position,
event_time);
}
}
gdk_winpointer_interaction_ended (msg);
*ret_valp = 0;
return_val = TRUE;
break;
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
GDK_NOTE (EVENTS, g_print (" %d", (short) HIWORD (msg->wParam)));
@@ -2913,6 +3176,8 @@ gdk_event_translate (MSG *msg,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_pointer));
gdk_event_set_pointer_emulated (event, FALSE);
_gdk_device_virtual_set_active (device_manager_win32->core_pointer, device_manager_win32->system_pointer);
_gdk_win32_append_event (gdk_event_copy (event));
/* Append the discrete version too */
@@ -2931,44 +3196,6 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_HSCROLL:
/* Just print more debugging information, don't actually handle it. */
GDK_NOTE (EVENTS,
(g_print (" %s",
(LOWORD (msg->wParam) == SB_ENDSCROLL ? "ENDSCROLL" :
(LOWORD (msg->wParam) == SB_LEFT ? "LEFT" :
(LOWORD (msg->wParam) == SB_RIGHT ? "RIGHT" :
(LOWORD (msg->wParam) == SB_LINELEFT ? "LINELEFT" :
(LOWORD (msg->wParam) == SB_LINERIGHT ? "LINERIGHT" :
(LOWORD (msg->wParam) == SB_PAGELEFT ? "PAGELEFT" :
(LOWORD (msg->wParam) == SB_PAGERIGHT ? "PAGERIGHT" :
(LOWORD (msg->wParam) == SB_THUMBPOSITION ? "THUMBPOSITION" :
(LOWORD (msg->wParam) == SB_THUMBTRACK ? "THUMBTRACK" :
"???")))))))))),
(LOWORD (msg->wParam) == SB_THUMBPOSITION ||
LOWORD (msg->wParam) == SB_THUMBTRACK) ?
(g_print (" %d", HIWORD (msg->wParam)), 0) : 0));
break;
case WM_VSCROLL:
/* Just print more debugging information, don't actually handle it. */
GDK_NOTE (EVENTS,
(g_print (" %s",
(LOWORD (msg->wParam) == SB_ENDSCROLL ? "ENDSCROLL" :
(LOWORD (msg->wParam) == SB_BOTTOM ? "BOTTOM" :
(LOWORD (msg->wParam) == SB_TOP ? "TOP" :
(LOWORD (msg->wParam) == SB_LINEDOWN ? "LINDOWN" :
(LOWORD (msg->wParam) == SB_LINEUP ? "LINEUP" :
(LOWORD (msg->wParam) == SB_PAGEDOWN ? "PAGEDOWN" :
(LOWORD (msg->wParam) == SB_PAGEUP ? "PAGEUP" :
(LOWORD (msg->wParam) == SB_THUMBPOSITION ? "THUMBPOSITION" :
(LOWORD (msg->wParam) == SB_THUMBTRACK ? "THUMBTRACK" :
"???")))))))))),
(LOWORD (msg->wParam) == SB_THUMBPOSITION ||
LOWORD (msg->wParam) == SB_THUMBTRACK) ?
(g_print (" %d", HIWORD (msg->wParam)), 0) : 0));
break;
case WM_MOUSEACTIVATE:
{
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
@@ -2987,6 +3214,17 @@ gdk_event_translate (MSG *msg,
break;
case WM_POINTERACTIVATE:
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP ||
!window->accept_focus ||
_gdk_modal_blocked (gdk_window_get_toplevel (window)))
{
*ret_valp = PA_NOACTIVATE;
return_val = TRUE;
}
break;
case WM_KILLFOCUS:
if (keyboard_grab != NULL &&
!GDK_WINDOW_DESTROYED (keyboard_grab->window) &&
@@ -3089,7 +3327,7 @@ gdk_event_translate (MSG *msg,
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
if (msg->wParam == SC_RESTORE)
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
break;
case SC_MAXIMIZE:
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
@@ -3177,7 +3415,7 @@ gdk_event_translate (MSG *msg,
{
MINMAXINFO our_mmi;
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
if (_gdk_win32_window_fill_min_max_info (window, &our_mmi))
{
@@ -3565,6 +3803,14 @@ gdk_event_translate (MSG *msg,
return_val = TRUE;
break;
case WM_DESTROY:
/* we have to call RemoveProp before the window is destroyed */
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
gdk_winpointer_finalize_window (window);
return_val = FALSE;
break;
case WM_NCDESTROY:
if ((pointer_grab != NULL && pointer_grab -> window == window) ||
(keyboard_grab && keyboard_grab -> window == window))
@@ -3734,14 +3980,21 @@ gdk_event_translate (MSG *msg,
* instead
*/
if (LOWORD(msg->wParam) != WA_INACTIVE)
_gdk_input_set_tablet_active ();
{
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINTAB)
_gdk_wintab_set_tablet_active ();
}
break;
case WM_ACTIVATEAPP:
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
msg->wParam ? "YES" : "NO",
(gint64) msg->lParam));
// Clear graphics tablet state
_gdk_input_ignore_core = 0;
break;
case WM_NCHITTEST:
/* TODO: pass all messages to DwmDefWindowProc() first! */
return_val = handle_nchittest (msg->hwnd, window,
@@ -3770,17 +4023,30 @@ gdk_event_translate (MSG *msg,
HIWORD (msg->lParam)));
/* Fall through */
wintab:
if (_gdk_win32_tablet_input_api != GDK_WIN32_TABLET_INPUT_API_WINTAB)
break;
event = gdk_event_new (GDK_NOTHING);
event->any.window = window;
g_object_ref (window);
if (gdk_input_other_event (display, event, msg, window))
if (gdk_wintab_input_events (display, event, msg, window))
_gdk_win32_append_event (event);
else
gdk_event_free (event);
break;
case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
*ret_valp = TABLET_DISABLE_PRESSANDHOLD |
TABLET_DISABLE_PENTAPFEEDBACK |
TABLET_DISABLE_PENBARRELFEEDBACK |
TABLET_DISABLE_FLICKS |
TABLET_DISABLE_FLICKFALLBACKKEYS;
return_val = TRUE;
break;
}
done:
File diff suppressed because it is too large Load Diff
+10 -47
View File
@@ -32,62 +32,25 @@
#include "gdkdisplayprivate.h"
#include "gdkvisual.h"
#include "gdkwindow.h"
#include "gdkinternals.h"
#include "gdkmain.h"
G_BEGIN_DECLS
struct _GdkWin32GLContext
{
GdkGLContext parent_instance;
/* WGL Context Items */
HGLRC hglrc;
HDC gl_hdc;
guint need_alpha_bits : 1;
/* other items */
guint is_attached : 1;
guint do_frame_sync : 1;
guint do_blit_swap : 1;
#ifdef GDK_WIN32_ENABLE_EGL
/* EGL (Angle) Context Items */
EGLContext egl_context;
EGLConfig egl_config;
#endif
};
struct _GdkWin32GLContextClass
{
GdkGLContextClass parent_class;
};
void
gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
GdkGLContext *
_gdk_win32_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLContext *share,
GError **error);
gdk_win32_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLContext *share,
GError **error);
void
_gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
cairo_region_t *update_area);
void
_gdk_win32_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
cairo_region_t *update_area);
gboolean
_gdk_win32_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);
gboolean
_gdk_win32_gl_context_realize (GdkGLContext *context,
GError **error);
void
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
gdk_win32_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);
G_END_DECLS
+1 -1
View File
@@ -36,12 +36,12 @@ HINSTANCE _gdk_dll_hinstance;
HINSTANCE _gdk_app_hmodule;
gint _gdk_input_ignore_core;
GdkWin32TabletInputAPI _gdk_win32_tablet_input_api;
HKL _gdk_input_locale;
gboolean _gdk_input_locale_is_ime = FALSE;
UINT _gdk_input_codepage;
gint _gdk_input_ignore_wintab = FALSE;
gint _gdk_max_colors = 0;
GdkWin32ModalOpKind _modal_operation_in_progress = GDK_WIN32_MODAL_OP_NONE;
+26
View File
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2021 Philip Zander
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _WIN64
#define GDK_WIN32_COMPILE_FOR_WOW64 1
#include "gdkkeys-win32-impl.c"
#endif
+548
View File
@@ -0,0 +1,548 @@
/*
* Copyright (c) 2021 Philip Zander
* Copyright (c) 2018 Microsoft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* NOTE: When compiling the 32-bit version of the library, in addition to being
* compiled as a regular source file, this file is also included by
* gdkkeys-win32-impl-wow64.c to generate an alternate version of the code
* intended for running on a 64-bit kernel. Because of the way keyboard layout
* DLLs work on Windows, we have to generate two versions and decide at runtime
* which code path to execute. You can read more about the specifics below, in
* the section about KBD_LONG_POINTER. */
#include "gdkkeys-win32.h"
#ifndef GDK_WIN32_COMPILE_FOR_WOW64
#define GDK_WIN32_COMPILE_FOR_WOW64 0
#endif
/* This is our equivalent of the KBD_LONG_POINTER macro in Microsoft's kbd.h.
*
* A KBD_LONG_POINTER represents a pointer native to the *host*.
* I.e. 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.
*
* This is *not* the same as the the bitness of the application, since it is
* possible to execute 32-bit binaries on either a 32-bit *or* a 64-bit host.
* On a 64-bit host, KBD_LONG_PTR will be 64-bits, even if the application
* itself is 32-bit. (Whereas on a 32-bit host, it will be 32-bit.)
*
* For clarity, here is an overview of the bit-size of KBD_LONG_POINTER on all
* possible host & app combinations:
*
* Host 32 64
* App +-----------
* 32 | 32 64
* 64 | - 64
*
* In the official MS headers, KBD_LONG_POINTER is implemented via a macro
* which expands to the attribute `__ptr64` if the keyboard driver is
* compiled for a 64 bit host. Unfortunately, `__ptr64` is only
* supported by MSVC. We use a union here as a workaround.
*
* For all KBD_LONG_POINTERs, we define an alias starting with "KLP".
* Our naming schema (inspired by the Windows headers) is thus the following:
* - FOO: The type FOO itself
* - PFOO: Regular pointer to the type FOO
* - KLPFOO: Keyboard Long Pointer to the type FOO
*/
#if GDK_WIN32_COMPILE_FOR_WOW64
#define DEFINE_KBD_LONG_POINTER(type) \
typedef union { \
P##type ptr; \
UINT64 _align; \
} KLP##type
#else
#define DEFINE_KBD_LONG_POINTER(type) \
typedef union { \
P##type ptr; \
} KLP##type
#endif
DEFINE_KBD_LONG_POINTER (USHORT);
DEFINE_KBD_LONG_POINTER (VOID);
/* Driver definitions
* See
* https://github.com/microsoft/windows-rs/blob/0.28.0/crates/deps/sys/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs
*
* For more information on how these structures work, see also:
* https://github.com/microsoft/Windows-driver-samples/tree/f0adcda012820b1cd44a8b3a1953baf478029738/input/layout
*/
typedef struct
{
BYTE Vk;
BYTE ModBits;
} VK_TO_BIT, *PVK_TO_BIT;
DEFINE_KBD_LONG_POINTER (VK_TO_BIT);
typedef struct
{
KLPVK_TO_BIT pVkToBit;
WORD wMaxModBits;
BYTE ModNumber[1];
} MODIFIERS, *PMODIFIERS;
DEFINE_KBD_LONG_POINTER (MODIFIERS);
typedef struct
{
BYTE Vsc;
USHORT Vk;
} VSC_VK, *PVSC_VK;
DEFINE_KBD_LONG_POINTER (VSC_VK);
typedef struct
{
BYTE Vk;
BYTE Vsc;
} VK_VSC, *PVK_VSC;
DEFINE_KBD_LONG_POINTER (VK_VSC);
typedef struct
{
BYTE VirtualKey;
BYTE Attributes;
WCHAR wch[1];
} VK_TO_WCHARS, *PVK_TO_WCHARS;
DEFINE_KBD_LONG_POINTER (VK_TO_WCHARS);
typedef struct
{
KLPVK_TO_WCHARS pVkToWchars;
BYTE nModifications;
BYTE cbSize;
} VK_TO_WCHAR_TABLE, *PVK_TO_WCHAR_TABLE;
DEFINE_KBD_LONG_POINTER (VK_TO_WCHAR_TABLE);
typedef struct
{
DWORD dwBoth;
WCHAR wchComposed;
USHORT uFlags;
} DEADKEY, *PDEADKEY;
DEFINE_KBD_LONG_POINTER (DEADKEY);
typedef struct
{
KLPMODIFIERS pCharModifiers;
KLPVK_TO_WCHAR_TABLE pVkToWcharTable;
KLPDEADKEY pDeadKey;
KLPVOID pKeyNames;
KLPVOID pKeyNamesExt;
KLPVOID pKeyNamesDead;
KLPUSHORT pusVSCtoVK;
BYTE bMaxVSCtoVK;
KLPVSC_VK pVSCtoVK_E0;
KLPVSC_VK pVSCtoVK_E1;
DWORD fLocaleFlags;
BYTE nLgMaxd;
BYTE cbLgEntry;
KLPVOID pLigature;
} KBDTABLES, *PKBDTABLES;
DEFINE_KBD_LONG_POINTER (KBDTABLES);
/* End of declarations */
static BYTE
keystate_to_modbits (GdkWin32KeymapLayoutInfo *info,
const BYTE keystate[256])
{
PKBDTABLES tables = (PKBDTABLES) info->tables;
PVK_TO_BIT vk_to_bit;
BYTE result = 0;
int i;
g_return_val_if_fail (tables != NULL, 0);
vk_to_bit = tables->pCharModifiers.ptr->pVkToBit.ptr;
for (i = 0; vk_to_bit[i].Vk != 0; ++i)
if (keystate[vk_to_bit[i].Vk] & 0x80)
result |= vk_to_bit[i].ModBits;
return result;
}
static BYTE
modbits_to_level (GdkWin32KeymapLayoutInfo *info,
BYTE modbits)
{
PKBDTABLES tables = (PKBDTABLES) info->tables;
PMODIFIERS modifiers;
g_return_val_if_fail (tables != NULL, 0);
modifiers = tables->pCharModifiers.ptr;
if (modbits > modifiers->wMaxModBits)
return 0;
return modifiers->ModNumber[modbits];
}
#define POPCOUNT(b) (!!(b & 0x01) + !!(b & 0x02) + !!(b & 0x04) + !!(b & 0x08) + \
!!(b & 0x10) + !!(b & 0x20) + !!(b & 0x40) + !!(b & 0x80))
/*
* vk_to_char_fuzzy:
*
* For a given key and keystate, return the best-fit character and the
* modifiers used to produce it. Note that not all modifiers need to be used,
* because some modifier combination aren't actually mapped in the keyboard
* layout (for example the Ctrl key typically has no effect, unless used in
* combination with Alt). Such modifiers will not be consumed.
*
* 'Best-fit' means 'consume as many modifiers as possibe'.
*
* For example (assuming a neutral keystate):
*
* - Shift + a -> 'A', consumed_mod_bits: [Shift]
* - Ctrl + a -> 'a', consumed_mod_bits: []
* - Ctrl + Shift + a -> 'A', consumed_mod_bits: [Shift]
*
* If capslock is active, the result could be:
*
* - Shift + a -> 'a', consumed_mod_bits: [Shift]
*
* The caller can supply additional modifiers to be added to the
* keystate in `extra_mod_bits`.
*
* If the key combination results in a dead key, `is_dead` will be set to TRUE,
* otherwise it will be set to FALSE.
*/
static WCHAR
vk_to_char_fuzzy (GdkWin32KeymapLayoutInfo *info,
const BYTE keystate[256],
BYTE extra_mod_bits,
BYTE *consumed_mod_bits,
gboolean *is_dead,
BYTE vk)
{
PKBDTABLES tables = (PKBDTABLES) info->tables;
PVK_TO_WCHAR_TABLE wch_tables;
PVK_TO_WCHAR_TABLE wch_table;
PVK_TO_WCHARS entry;
int table_index;
int entry_index;
int n_levels;
int entry_size;
/* Initialize with defaults */
if (consumed_mod_bits)
*consumed_mod_bits = 0;
if (is_dead)
*is_dead = FALSE;
g_return_val_if_fail (tables != NULL, WCH_NONE);
wch_tables = tables->pVkToWcharTable.ptr;
table_index = info->vk_lookup_table[vk].table;
entry_index = info->vk_lookup_table[vk].index;
if (table_index == -1 || entry_index == -1)
return WCH_NONE;
wch_table = &wch_tables[table_index];
n_levels = wch_table->nModifications;
entry_size = wch_table->cbSize;
entry = (PVK_TO_WCHARS) ((PBYTE) wch_table->pVkToWchars.ptr
+ entry_size*entry_index);
if (entry->VirtualKey == vk)
{
BYTE modbits;
WCHAR best_char = WCH_NONE;
BYTE best_modifiers = 0;
int best_score = -1;
gboolean best_is_dead = FALSE;
int level;
/* Add modbits of currently pressed keys. */
modbits = keystate_to_modbits (info, keystate);
/* Add modbits supplied by caller. */
modbits |= extra_mod_bits;
/* Take toggled keys into account. For example, capslock normally inverts the
* state of KBDSHIFT (with some exceptions). */
/* Key supporting capslock */
if ((entry->Attributes & CAPLOK) &&
/* Ignore capslock if any modifiers other than shift are pressed.
* E.g. on the German layout, CapsLock + AltGr + q is the same as
* AltGr + q ('@'), but NOT the same as Shift + AltGr + q (not mapped). */
!(modbits & ~KBDSHIFT) &&
(keystate[VK_CAPITAL] & 0x01))
modbits ^= KBDSHIFT;
/* Key supporting combination of capslock + altgr */
if ((entry->Attributes & CAPLOKALTGR) &&
(modbits & KBDALTGR) &&
(keystate[VK_CAPITAL] & 0x01))
modbits ^= KBDSHIFT;
/* In the Swiss German layout, CapsLock + key is different from Shift + key
* for some keys. For such keys, Capslock toggles the KBDCTRL bit. */
if ((entry->Attributes & SGCAPS) &&
(keystate[VK_CAPITAL] & 0x01))
modbits ^= KBDCTRL;
/* I'm not totally sure how kanalok behaves, for now I assume that there
* aren't any special cases. */
if ((entry->Attributes & KANALOK) &&
(keystate[VK_KANA] & 0x01))
modbits ^= KBDKANA;
/* We try to find the entry with the most matching modifiers */
for (level = 0; level < n_levels; ++level)
{
BYTE candidate_modbits = info->level_to_modbits[level];
gboolean candidate_is_dead = FALSE;
WCHAR c;
int score;
if (candidate_modbits & ~modbits)
continue;
c = entry->wch[level];
if (c == WCH_DEAD)
{
/* Next entry contains the undead keys */
PVK_TO_WCHARS next_entry;
next_entry = (PVK_TO_WCHARS) ((PBYTE) wch_table->pVkToWchars.ptr
+ entry_size * (entry_index + 1));
c = next_entry->wch[level];
candidate_is_dead = TRUE;
}
if (c == WCH_DEAD || c == WCH_LGTR || c == WCH_NONE)
continue;
score = POPCOUNT (candidate_modbits & modbits);
if (score > best_score)
{
best_score = score;
best_char = c;
best_modifiers = candidate_modbits;
best_is_dead = candidate_is_dead;
}
}
if (consumed_mod_bits)
*consumed_mod_bits = best_modifiers;
if (is_dead)
*is_dead = best_is_dead;
return best_char;
}
return WCH_NONE;
}
static void
init_vk_lookup_table (GdkWin32KeymapLayoutInfo *info)
{
PKBDTABLES tables = (PKBDTABLES) info->tables;
PVK_TO_WCHAR_TABLE wch_tables;
PMODIFIERS modifiers;
int i, vk, table_idx;
g_return_if_fail (tables != NULL);
wch_tables = tables->pVkToWcharTable.ptr;
/* Initialize empty table */
memset (info->vk_lookup_table, -1, sizeof (info->vk_lookup_table));
/* Initialize level -> modbits lookup table */
memset (info->level_to_modbits, 0, sizeof(info->level_to_modbits));
info->max_level = 0;
modifiers = tables->pCharModifiers.ptr;
for (i = 0; i <= modifiers->wMaxModBits; ++i)
{
if (modifiers->ModNumber[i] != SHFT_INVALID &&
modifiers->ModNumber[i] != 0 /* Workaround for buggy layouts*/)
{
if (modifiers->ModNumber[i] > info->max_level)
info->max_level = modifiers->ModNumber[i];
info->level_to_modbits[modifiers->ModNumber[i]] = i;
}
}
info->max_modbit_value = modifiers->wMaxModBits;
/* For convenience, we add 256 identity-mapped entries corresponding to the VKs.
* This allows us to return a pointer to them from the `gdk_keysym_to_key_entry`
* function.
*/
for (vk = 0; vk < 256; ++vk)
{
GdkWin32KeymapKeyEntry key_entry = {0};
key_entry.vk = vk;
key_entry.mod_bits = 0;
key_entry.next = -1;
g_array_append_val (info->key_entries, key_entry);
}
/* Special entry for ISO_Left_Tab */
{
GdkWin32KeymapKeyEntry key_entry = {0};
key_entry.vk = VK_TAB;
key_entry.mod_bits = KBDSHIFT;
key_entry.next = -1;
g_array_append_val (info->key_entries, key_entry);
}
/* Initialize generic vk <-> char tables */
for (table_idx = 0; ; ++table_idx)
{
PVK_TO_WCHAR_TABLE wch_table = &wch_tables[table_idx];
int entry_size;
int n_levels;
int entry_idx;
if (wch_table->pVkToWchars.ptr == NULL)
break;
entry_size = wch_table->cbSize;
n_levels = wch_table->nModifications;
for (entry_idx = 0; ; ++entry_idx)
{
PVK_TO_WCHARS entry;
int level;
entry = (PVK_TO_WCHARS) ((PBYTE) wch_table->pVkToWchars.ptr
+ entry_size * entry_idx);
if (entry->VirtualKey == 0)
break;
/* Lookup table to find entry for a VK in O(1). */
info->vk_lookup_table[entry->VirtualKey].table = table_idx;
info->vk_lookup_table[entry->VirtualKey].index = entry_idx;
/* Create reverse lookup entries to find a VK+modifier combinations
* that results in a given character. */
for (level = 0; level < n_levels; ++level)
{
GdkWin32KeymapKeyEntry key_entry = {0};
WCHAR c = entry->wch[level];
int inserted_idx;
gintptr next_idx;
key_entry.vk = entry->VirtualKey;
key_entry.mod_bits = info->level_to_modbits[level];
/* There can be multiple combinations that produce the same character.
* We store all of them in a linked list.
* Check if we already have an entry for the character, so we can chain
* them together. */
if (g_hash_table_lookup_extended (info->reverse_lookup_table,
GINT_TO_POINTER (c),
NULL, (gpointer*)&next_idx))
{
key_entry.next = next_idx;
}
else
{
key_entry.next = -1;
}
/* We store the KeyEntry in an array. In the hash table we only store
* the index. */
g_array_append_val (info->key_entries, key_entry);
inserted_idx = info->key_entries->len - 1;
g_hash_table_insert (info->reverse_lookup_table,
GINT_TO_POINTER (c),
GINT_TO_POINTER (inserted_idx));
}
}
}
}
static gboolean
load_layout_dll (const char *dll,
GdkWin32KeymapLayoutInfo *info)
{
typedef KLPKBDTABLES (*KbdLayerDescriptor)(VOID);
HMODULE lib;
KbdLayerDescriptor func;
KLPKBDTABLES tables;
g_return_val_if_fail (dll != NULL, FALSE);
lib = LoadLibraryA (dll);
if (lib == NULL)
goto fail1;
func = (KbdLayerDescriptor) GetProcAddress (lib, "KbdLayerDescriptor");
if (func == NULL)
goto fail2;
tables = func();
info->lib = lib;
info->tables = (PKBDTABLES) tables.ptr;
return TRUE;
fail2:
FreeLibrary (lib);
fail1:
return FALSE;
}
#if GDK_WIN32_COMPILE_FOR_WOW64
#define GDK_WIN32_KEYMAP_IMPL_NAME gdkwin32_keymap_impl_wow64
#else
#define GDK_WIN32_KEYMAP_IMPL_NAME gdkwin32_keymap_impl
#endif
const GdkWin32KeymapImpl GDK_WIN32_KEYMAP_IMPL_NAME =
{
load_layout_dll,
init_vk_lookup_table,
keystate_to_modbits,
modbits_to_level,
vk_to_char_fuzzy
};
+652 -1289
View File
File diff suppressed because it is too large Load Diff
+168
View File
@@ -0,0 +1,168 @@
/*
* Copyright (c) 2021 Philip Zander
* Copyright (c) 2018 Microsoft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <glib.h>
#include <windows.h>
/* For lookup table VK -> chars */
typedef struct
{
int table;
int index;
} GdkWin32KeymapTableAndIndex;
/* For reverse lookup char -> VKs */
typedef struct
{
BYTE mod_bits;
BYTE vk;
/* Index of next KeyEntry. -1 if there is no next entry. */
int next;
} GdkWin32KeymapKeyEntry;
typedef struct
{
HKL handle;
/* Keyboard layout identifier */
char name[KL_NAMELENGTH];
/* Path of the layout DLL */
char *file;
/* Handle of the layout DLL */
HINSTANCE lib;
/* The actual conversion tables provided by the layout DLL.
*
* This is a pointer to a KBDTABLES structure. The exact definition
* of this structure depends on the kernel on which the executable
* run and can in general only be determined at runtime. That's why
* we have to use a generic gpointer instead of the actual type here.
*
* See comment on GdkWin32KeymapImpl below for more information. */
gpointer tables;
/* VK -> chars lookup table so we don't have to do a linear scan
* every time we look up a key. */
GdkWin32KeymapTableAndIndex vk_lookup_table[256];
/* List of entries for reverse (char ->VKs) lookup. */
GArray *key_entries;
/* Reverse lookup table (char -> VKs). Key: Unichar. Value: int.
* The value is used to index into the key_entries array. The key_entries
* array can contain multiple consecutive entries for a given char.
* The end of the list for the char is marked by a key entry that has
* mod_bits and vk set to 0xFF. */
GHashTable *reverse_lookup_table;
/* Map level to modbits */
BYTE level_to_modbits[256];
/* Max Number of levels */
BYTE max_level;
/* Maximum possible value of a modbits bitset. */
BYTE max_modbit_value;
} GdkWin32KeymapLayoutInfo;
/* Some keyboard driver constants
* See https://github.com/microsoft/windows-rs/blob/0.28.0/crates/deps/sys/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs
*/
/* Modifier bits */
#define KBDBASE 0x00
#define KBDSHIFT 0x01
#define KBDCTRL 0x02
#define KBDALT 0x04
#define KBDKANA 0x08
#define KBDROYA 0x10
#define KBDLOYA 0x20
#define KBDGRPSELTAP 0x80
#define KBDALTGR (KBDCTRL| KBDALT)
/* */
#define SHFT_INVALID 0x0F
/* Char table constants */
#define WCH_NONE 0xF000
#define WCH_DEAD 0xF001
#define WCH_LGTR 0xF002
/* Char table flags */
#define CAPLOK 0x01
#define SGCAPS 0x02
#define CAPLOKALTGR 0x04
#define KANALOK 0x08
#define GRPSELTAP 0x80
/* IMPORTANT:
*
* Keyboard layout DLLs are dependent on the host architecture.
*
* - 32 bit systems have just one 32 bit DLL in System32.
* - 64 bit systems contain two versions of each layout DLL: One in System32
* for 64-bit applications, and one in SysWOW64 for 32-bit applications.
*
* Here comes the tricky part:
*
* The 32-bit DLL in SysWOW64 is *not* identical to the DLL you would find
* on a true 32 bit system, because all the pointers there are declared with
* the attribute `__ptr64` (which means they are 64 bits wide, but only the
* lower 32 bits are used).
*
* This leads to the following problems:
*
* (1) GCC does not support `__ptr64`
* (2) When compiling the 32-bit library, we need two versions of the same code
* and decide at run-time which one to execute, because we can't know at
* compile time whether we will be running on a true 32-bit system, or on
* WOW64.
*
* To solve this problem, we generate code for both cases (see
* gdkkeys-win32-impl.c + gdkkeys-win32-impl-wow64.c) and encapsulate
* the resulting functions in a struct of type GdkWin32KeymapImpl,
* allowing us to select the correct implementation at runtime.
*
*/
typedef struct
{
gboolean (*load_layout_dll) (const char *dll,
GdkWin32KeymapLayoutInfo *info);
void (*init_vk_lookup_table) (GdkWin32KeymapLayoutInfo *info);
BYTE (*keystate_to_modbits) (GdkWin32KeymapLayoutInfo *info,
const BYTE keystate[256]);
BYTE (*modbits_to_level) (GdkWin32KeymapLayoutInfo *info,
BYTE modbits);
WCHAR (*vk_to_char_fuzzy) (GdkWin32KeymapLayoutInfo *info,
const BYTE keystate[256],
BYTE extra_mod_bits,
BYTE *consumed_mod_bits,
gboolean *is_dead,
BYTE vk);
} GdkWin32KeymapImpl;
-22
View File
@@ -49,23 +49,6 @@
static gboolean gdk_synchronize = FALSE;
static gboolean dummy;
const GOptionEntry _gdk_windowing_args[] = {
{ "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
/* Description of --sync in --help output */ N_("Don't batch GDI requests"), NULL },
{ "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --no-wintab in --help output */ N_("Don't use the Wintab API for tablet support"), NULL },
{ "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --ignore-wintab in --help output */ N_("Same as --no-wintab"), NULL },
{ "use-wintab", 0, 0, G_OPTION_ARG_NONE, &dummy,
/* Description of --use-wintab in --help output */ N_("Do use the Wintab API [default]"), NULL },
{ "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
/* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
/* Placeholder in --max-colors=COLORS in --help output */ N_("COLORS") },
{ NULL }
};
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD dwReason,
@@ -81,11 +64,6 @@ _gdk_win32_windowing_init (void)
{
gchar buf[10];
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
_gdk_input_ignore_wintab = TRUE;
else if (getenv ("GDK_USE_WINTAB") != NULL)
_gdk_input_ignore_wintab = FALSE;
if (gdk_synchronize)
GdiSetBatchLimit (1);
+14 -9
View File
@@ -523,7 +523,7 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
refresh = &dispconf_paths[path_index].targetInfo.refreshRate;
gdk_monitor_set_refresh_rate (mon,
refresh->Numerator * 1000 / refresh->Denominator);
refresh->Numerator * (UINT64) 1000 / refresh->Denominator);
}
g_free (dispconf_paths);
@@ -618,7 +618,7 @@ enum_monitor (HMONITOR hmonitor,
GdkWin32Monitor *w32mon;
GdkMonitor *mon;
GdkRectangle rect;
guint scale;
int scale;
memset (&dd_monitor, 0, sizeof (dd_monitor));
dd_monitor.cb = sizeof (dd_monitor);
@@ -888,13 +888,15 @@ _gdk_win32_display_get_monitor_list (GdkWin32Display *win32_display)
{
GdkWin32Monitor *m;
GdkRectangle rect;
int scale;
m = g_ptr_array_index (data.monitors, i);
gdk_monitor_get_geometry (GDK_MONITOR (m), &rect);
scale = gdk_monitor_get_scale_factor (GDK_MONITOR (m));
/* Calculate offset */
gdk_monitor_get_geometry (GDK_MONITOR (m), &rect);
_gdk_offset_x = MAX (_gdk_offset_x, -rect.x);
_gdk_offset_y = MAX (_gdk_offset_y, -rect.y);
_gdk_offset_x = MAX (_gdk_offset_x, -rect.x * scale);
_gdk_offset_y = MAX (_gdk_offset_y, -rect.y * scale);
}
GDK_NOTE (MISC, g_print ("Multi-monitor offset: (%d,%d)\n",
@@ -905,16 +907,19 @@ _gdk_win32_display_get_monitor_list (GdkWin32Display *win32_display)
{
GdkWin32Monitor *m;
GdkRectangle rect;
int scale = 0;
m = g_ptr_array_index (data.monitors, i);
gdk_monitor_get_geometry (GDK_MONITOR (m), &rect);
rect.x += _gdk_offset_x;
rect.y += _gdk_offset_y;
scale = gdk_monitor_get_scale_factor (GDK_MONITOR (m));
rect.x += _gdk_offset_x / scale;
rect.y += _gdk_offset_y / scale;
gdk_monitor_set_position (GDK_MONITOR (m), rect.x, rect.y);
m->work_rect.x += _gdk_offset_x;
m->work_rect.y += _gdk_offset_y;
m->work_rect.x += _gdk_offset_x / scale;
m->work_rect.y += _gdk_offset_y / scale;
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@%+d%+d\n", i,
rect.width, rect.height, rect.x, rect.y));
+20 -1
View File
@@ -163,10 +163,18 @@ struct _GdkColormapPrivateWin32
GdkColorInfo *info;
};
typedef enum {
GDK_WIN32_TABLET_INPUT_API_NONE = 0,
GDK_WIN32_TABLET_INPUT_API_WINTAB,
GDK_WIN32_TABLET_INPUT_API_WINPOINTER
} GdkWin32TabletInputAPI;
GType _gdk_gc_win32_get_type (void);
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
BOOL _gdk_win32_get_cursor_pos (LPPOINT lpPoint);
void _gdk_window_init_position (GdkWindow *window);
void _gdk_window_move_resize_child (GdkWindow *window,
gint x,
@@ -262,6 +270,8 @@ void _gdk_other_api_failed (const gchar *where,
#define WIN32_GDI_FAILED(api) WIN32_API_FAILED (api)
#define OTHER_API_FAILED(api) _gdk_other_api_failed (G_STRLOC, api)
#define WIN32_API_FAILED_LOG_ONCE(api) G_STMT_START { static gboolean logged = 0; if (!logged) { _gdk_win32_api_failed (G_STRLOC , api); logged = 1; }} G_STMT_END
/* These two macros call a GDI or other Win32 API and if the return
* value is zero or NULL, print a warning message. The majority of GDI
* calls return zero or NULL on failure. The value of the macros is nonzero
@@ -287,6 +297,7 @@ extern HINSTANCE _gdk_dll_hinstance;
extern HINSTANCE _gdk_app_hmodule;
extern gint _gdk_input_ignore_core;
extern GdkWin32TabletInputAPI _gdk_win32_tablet_input_api;
/* These are thread specific, but GDK/win32 works OK only when invoked
* from a single thread anyway.
@@ -326,7 +337,6 @@ void _gdk_win32_end_modal_call (GdkWin32ModalOpKind kind);
/* Options */
extern gboolean _gdk_input_ignore_wintab;
extern gint _gdk_max_colors;
#define GDK_WIN32_COLORMAP_DATA(cmap) ((GdkColormapPrivateWin32 *) GDK_COLORMAP (cmap)->windowing_data)
@@ -441,6 +451,7 @@ guint8 _gdk_win32_keymap_get_active_group (GdkWin32Keymap *keymap);
guint8 _gdk_win32_keymap_get_rshift_scancode (GdkWin32Keymap *keymap);
void _gdk_win32_keymap_set_active_layout (GdkWin32Keymap *keymap,
HKL hkl);
GdkModifierType _gdk_win32_keymap_get_mod_mask (GdkWin32Keymap *keymap);
GdkKeymap *_gdk_win32_display_get_keymap (GdkDisplay *display);
@@ -531,4 +542,12 @@ void _gdk_win32_windowing_init (void);
void _gdk_dnd_init (void);
void _gdk_events_init (GdkDisplay *display);
typedef enum _GdkWin32ProcessorCheckType
{
GDK_WIN32_ARM64,
GDK_WIN32_WOW64,
} GdkWin32ProcessorCheckType;
gboolean _gdk_win32_check_processor (GdkWin32ProcessorCheckType check_type);
#endif /* __GDK_PRIVATE_WIN32_H__ */
+9
View File
@@ -55,6 +55,15 @@ struct _GdkWin32DragContext
gint start_x; /* Coordinates of the drag start, in GDK space */
gint start_y;
DWORD last_key_state; /* Key state from last event */
HMONITOR last_monitor; /* While dragging we keep track of the monitor the cursor
is currently on. As the cursor moves between monitors,
we move the invisible dnd ipc window to the top-left
corner of the current monitor, because OLE2 does not
work correctly if the source window and the dest window
are on monitors with different scales (say one is 125%
and the other 100%) and the drag-initiating application
(effectively driving the DND) is not per-monitor DPI aware
*/
/* Just like context->targets, but an array, and with format IDs
* stored inside.
+108 -97
View File
@@ -303,10 +303,10 @@ gdk_win32_window_get_queued_window_rect (GdkWindow *window,
_gdk_win32_adjust_client_rect (window, &window_rect);
/* Convert GDK screen coordinates to W32 desktop coordinates */
window_rect.left -= _gdk_offset_x * impl->window_scale;
window_rect.right -= _gdk_offset_x * impl->window_scale;
window_rect.top -= _gdk_offset_y * impl->window_scale;
window_rect.bottom -= _gdk_offset_y * impl->window_scale;
window_rect.left -= _gdk_offset_x;
window_rect.right -= _gdk_offset_x;
window_rect.top -= _gdk_offset_y;
window_rect.bottom -= _gdk_offset_y;
*return_window_rect = window_rect;
}
@@ -555,7 +555,6 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
static ATOM klassTOPLEVEL = 0;
static ATOM klassCHILD = 0;
static ATOM klassTEMP = 0;
static ATOM klassTEMPSHADOW = 0;
static HICON hAppIcon = NULL;
static HICON hAppIconSm = NULL;
static WNDCLASSEXW wcl;
@@ -652,34 +651,16 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
break;
case GDK_WINDOW_TEMP:
if ((wtype_hint == GDK_WINDOW_TYPE_HINT_MENU) ||
(wtype_hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU) ||
(wtype_hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU))
if (klassTEMP == 0)
{
if (klassTEMPSHADOW == 0)
{
wcl.lpszClassName = L"gdkWindowTempShadow";
wcl.style |= CS_SAVEBITS;
wcl.style |= 0x00020000; /* CS_DROPSHADOW */
ONCE_PER_CLASS ();
klassTEMPSHADOW = RegisterClassExW (&wcl);
}
klass = klassTEMPSHADOW;
wcl.lpszClassName = L"gdkWindowTemp";
wcl.style |= CS_SAVEBITS;
ONCE_PER_CLASS ();
klassTEMP = RegisterClassExW (&wcl);
}
else
{
if (klassTEMP == 0)
{
wcl.lpszClassName = L"gdkWindowTemp";
wcl.style |= CS_SAVEBITS;
ONCE_PER_CLASS ();
klassTEMP = RegisterClassExW (&wcl);
}
klass = klassTEMP;
}
klass = klassTEMP;
break;
default:
@@ -860,8 +841,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle);
real_x = (window->x - offset_x) * impl->window_scale;
real_y = (window->y - offset_y) * impl->window_scale;
real_x = window->x * impl->window_scale - offset_x;
real_y = window->y * impl->window_scale - offset_y;
if (window->window_type == GDK_WINDOW_TOPLEVEL)
{
@@ -885,8 +866,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
window_width = impl->unscaled_width;
window_height = impl->unscaled_height;
/* use given position for initial placement, native coordinates */
x = (window->x + window->parent->abs_x - offset_x) * impl->window_scale;
y = (window->y + window->parent->abs_y - offset_y) * impl->window_scale;
x = (window->x + window->parent->abs_x) * impl->window_scale;
y = (window->y + window->parent->abs_y) * impl->window_scale;
}
if (attributes_mask & GDK_WA_TITLE)
@@ -904,13 +885,13 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
dwExStyle |= WS_EX_TOOLWINDOW;
/* WS_EX_TRANSPARENT means "try draw this window last, and ignore input".
* It's the last part we're after. We don't want DND indicator to accept
* input, because that will make it a potential drop target, and if it's
* under the mouse cursor, this will kill any DND.
/* WS_EX_LAYERED | WS_EX_TRANSPARENT makes the window transparent w.r.t.
* pointer input: the system will direct all pointer input to the window
* below. We don't want a DND indicator to accept pointer input, because
* that will make it a potential drop target.
*/
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DND)
dwExStyle |= WS_EX_TRANSPARENT;
dwExStyle |= WS_EX_LAYERED | WS_EX_TRANSPARENT;
klass = RegisterGdkClass (window->window_type, impl->type_hint);
@@ -971,8 +952,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
GDK_NOTE (MISC, g_print ("... \"%s\" %dx%d@%+d%+d %p = %p\n",
title,
window_width, window_height,
window->x - offset_x,
window->y - offset_y,
window->x,
window->y,
hparent,
GDK_WINDOW_HWND (window)));
@@ -994,6 +975,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
if (attributes_mask & GDK_WA_CURSOR)
gdk_window_set_cursor (window, attributes->cursor);
if (_gdk_win32_tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
gdk_winpointer_initialize_window (window);
_gdk_win32_window_enable_transparency (window);
}
@@ -1293,10 +1277,10 @@ show_window_internal (GdkWindow *window,
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
/* Use SetWindowPos to show transparent windows so automatic redraws
* in other windows can be suppressed.
/* If we have to show an input-only window,
* redraws can be safely skipped.
*/
if (exstyle & WS_EX_TRANSPARENT)
if (window->input_only)
{
UINT flags = SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
@@ -1354,8 +1338,8 @@ show_window_internal (GdkWindow *window,
{
GdkWindow *owner = window_impl->transient_owner;
/* Center on transient parent */
center_on_rect.left = (owner->x - _gdk_offset_x) * window_impl->window_scale;
center_on_rect.top = (owner->y - _gdk_offset_y) * window_impl->window_scale;
center_on_rect.left = owner->x * window_impl->window_scale - _gdk_offset_x;
center_on_rect.top = owner->y * window_impl->window_scale - _gdk_offset_y;
center_on_rect.right = center_on_rect.left + owner->width * window_impl->window_scale;
center_on_rect.bottom = center_on_rect.top + owner->height * window_impl->window_scale;
@@ -1432,7 +1416,6 @@ show_window_internal (GdkWindow *window,
}
}
if (window->state & GDK_WINDOW_STATE_FULLSCREEN)
{
gdk_window_fullscreen (window);
@@ -1505,10 +1488,10 @@ gdk_win32_window_hide (GdkWindow *window)
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE);
/* Use SetWindowPos to hide transparent windows so automatic redraws
* in other windows can be suppressed.
/* If we have to hide an input-only window,
* readraws can be safely skipped.
*/
if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
if (window->input_only)
{
SetWindowPos (GDK_WINDOW_HWND (window), SWP_NOZORDER_SPECIFIED,
0, 0, 0, 0,
@@ -1568,13 +1551,13 @@ gdk_win32_window_move (GdkWindow *window,
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,0,0,"
"NOACTIVATE|NOSIZE|NOZORDER)\n",
GDK_WINDOW_HWND (window),
(x - _gdk_offset_x) * impl->window_scale,
(y - _gdk_offset_y) * impl->window_scale));
x * impl->window_scale - _gdk_offset_x,
y * impl->window_scale - _gdk_offset_y));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
SWP_NOZORDER_SPECIFIED,
(x - _gdk_offset_x) * impl->window_scale,
(y - _gdk_offset_y) * impl->window_scale,
x * impl->window_scale - _gdk_offset_x,
y * impl->window_scale - _gdk_offset_y,
0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER));
}
@@ -1667,15 +1650,15 @@ gdk_win32_window_move_resize_internal (GdkWindow *window,
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%ld,%ld,"
"NOACTIVATE|NOZORDER)\n",
GDK_WINDOW_HWND (window),
(x - _gdk_offset_x) * impl->window_scale,
(y - _gdk_offset_y) * impl->window_scale,
x * impl->window_scale - _gdk_offset_x,
y * impl->window_scale - _gdk_offset_y,
outer_rect.right - outer_rect.left,
outer_rect.bottom - outer_rect.top));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
SWP_NOZORDER_SPECIFIED,
(x - _gdk_offset_x) * impl->window_scale,
(y - _gdk_offset_y) * impl->window_scale,
x * impl->window_scale - _gdk_offset_x,
y * impl->window_scale - _gdk_offset_y,
outer_rect.right - outer_rect.left,
outer_rect.bottom - outer_rect.top,
SWP_NOACTIVATE | SWP_NOZORDER));
@@ -1706,7 +1689,7 @@ gdk_win32_window_move_resize (GdkWindow *window,
}
else
{
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
if (with_move)
{
gdk_win32_window_move_resize_internal (window, x, y, width, height);
@@ -2337,10 +2320,10 @@ gdk_win32_window_get_geometry (GdkWindow *window,
if (gdk_screen_get_root_window (screen) == parent)
{
rect.left += _gdk_offset_x * impl->window_scale;
rect.top += _gdk_offset_y * impl->window_scale;
rect.right += _gdk_offset_x * impl->window_scale;
rect.bottom += _gdk_offset_y * impl->window_scale;
rect.left += _gdk_offset_x;
rect.top += _gdk_offset_y;
rect.right += _gdk_offset_x;
rect.bottom += _gdk_offset_y;
}
}
@@ -2437,19 +2420,19 @@ gdk_win32_window_get_frame_extents (GdkWindow *window,
hwnd = GDK_WINDOW_HWND (window);
API_CALL (GetWindowRect, (hwnd, &r));
/* Initialize to real, unscaled size */
rect->x = r.left + _gdk_offset_x * impl->window_scale;
rect->y = r.top + _gdk_offset_y * impl->window_scale;
/* Initialize GdkRectangle to unscaled coordinates */
rect->x = r.left + _gdk_offset_x;
rect->y = r.top + _gdk_offset_y;
rect->width = (r.right - r.left);
rect->height = (r.bottom - r.top);
/* Extend width and height to ensure that they cover the real size when de-scaled,
* and replace everyting with scaled values
* and replace everything with scaled values
*/
rect->width = (rect->width + rect->x % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
rect->height = (rect->height + rect->y % impl->window_scale + impl->window_scale - 1) / impl->window_scale;
rect->x = r.left / impl->window_scale + _gdk_offset_x;
rect->y = r.top / impl->window_scale + _gdk_offset_y;
rect->x = r.left / impl->window_scale;
rect->y = r.top / impl->window_scale;
GDK_NOTE (MISC, g_print ("gdk_window_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n",
GDK_WINDOW_HWND (window),
@@ -2803,6 +2786,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
GdkWindowImplWin32 *impl = (GdkWindowImplWin32 *)window->impl;
GdkWMDecoration decorations;
LONG old_style, new_style, old_exstyle, new_exstyle;
gboolean needs_basic_layering = FALSE;
gboolean all;
RECT rect, before, after;
gboolean was_topmost;
@@ -2858,7 +2842,18 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
else
impl->layered = FALSE;
if (impl->layered)
/* DND windows need to have the WS_EX_TRANSPARENT | WS_EX_LAYERED styles
* set so to behave in input passthrough mode. That's essential for DND
* indicators.
*/
if (!impl->layered &&
GDK_WINDOW_HWND (window) != NULL &&
impl->type_hint == GDK_WINDOW_TYPE_HINT_DND)
{
needs_basic_layering = TRUE;
}
if (impl->layered || needs_basic_layering)
new_exstyle |= WS_EX_LAYERED;
else
new_exstyle &= ~WS_EX_LAYERED;
@@ -2875,6 +2870,19 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
update_single_bit (&new_style, all, decorations & GDK_DECOR_MAXIMIZE, WS_MAXIMIZEBOX);
}
if (needs_basic_layering)
{
/* SetLayeredWindowAttributes may have been already called, e.g. to set an opacity level.
* We only have to call the API in case it has never been called before on the window.
*/
if (SetLastError(0),
!GetLayeredWindowAttributes (GDK_WINDOW_HWND (window), NULL, NULL, NULL) &&
GetLastError() == 0)
{
API_CALL (SetLayeredWindowAttributes, (GDK_WINDOW_HWND (window), 0, 255, LWA_ALPHA));
}
}
if (old_style == new_style && old_exstyle == new_exstyle )
{
GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: no change\n",
@@ -3953,8 +3961,8 @@ redraw_indicator (gpointer user_data)
last_draw = draw_indicator (context, context->draw_timestamp);
window_position.x = (context->indicator_window_rect.x - _gdk_offset_x) * impl->window_scale;
window_position.y = (context->indicator_window_rect.y - _gdk_offset_y) * impl->window_scale;
window_position.x = context->indicator_window_rect.x * impl->window_scale - _gdk_offset_x;
window_position.y = context->indicator_window_rect.y * impl->window_scale - _gdk_offset_y;
window_size.cx = context->indicator_window_rect.width * impl->window_scale;
window_size.cy = context->indicator_window_rect.height * impl->window_scale;
@@ -4611,8 +4619,8 @@ setup_drag_move_resize_context (GdkWindow *window,
GDK_NOTE (MISC, g_print ("W32 WM unmaximized window placement is %ld x %ld @ %ld : %ld\n",
placement.rcNormalPosition.right - placement.rcNormalPosition.left,
placement.rcNormalPosition.bottom - placement.rcNormalPosition.top,
placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale,
placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale));
placement.rcNormalPosition.left + _gdk_offset_x,
placement.rcNormalPosition.top + _gdk_offset_y));
unmax_width = placement.rcNormalPosition.right - placement.rcNormalPosition.left;
unmax_height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top;
@@ -4623,17 +4631,17 @@ setup_drag_move_resize_context (GdkWindow *window,
if (offsetx * impl->window_scale < (shadow_unmax_width / 2) &&
offsety * impl->window_scale < (shadow_unmax_height / 2))
{
placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale;
placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top) * impl->window_scale - _gdk_offset_y;
placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height;
if (left_half)
{
placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left - _gdk_offset_x) * impl->window_scale;
placement.rcNormalPosition.left = (root_x - offsetx + impl->margins.left) * impl->window_scale - _gdk_offset_x;
placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width;
}
else
{
placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right - _gdk_offset_x) * impl->window_scale;
placement.rcNormalPosition.right = (root_x + offsetx + impl->margins.right) * impl->window_scale - _gdk_offset_x;
placement.rcNormalPosition.left = placement.rcNormalPosition.right - unmax_width;
}
}
@@ -4641,22 +4649,22 @@ setup_drag_move_resize_context (GdkWindow *window,
{
placement.rcNormalPosition.left = (root_x * impl->window_scale) -
(unmax_width / 2) -
(_gdk_offset_x * impl->window_scale);
_gdk_offset_x;
if (offsety * impl->window_scale < shadow_unmax_height / 2)
placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top - _gdk_offset_y) * impl->window_scale;
placement.rcNormalPosition.top = (root_y - offsety + impl->margins.top) * impl->window_scale - _gdk_offset_y;
else
placement.rcNormalPosition.top = (root_y * impl->window_scale) -
(unmax_height / 2) -
(_gdk_offset_y * impl->window_scale);
_gdk_offset_y;
placement.rcNormalPosition.right = placement.rcNormalPosition.left + unmax_width;
placement.rcNormalPosition.bottom = placement.rcNormalPosition.top + unmax_height;
}
GDK_NOTE (MISC, g_print ("Unmaximized window will be at %ld : %ld\n",
placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale,
placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale));
placement.rcNormalPosition.left + _gdk_offset_x,
placement.rcNormalPosition.top + _gdk_offset_y));
API_CALL (SetWindowPlacement, (GDK_WINDOW_HWND (window), &placement));
}
@@ -4774,7 +4782,7 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context;
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
context->op = GDK_WIN32_DRAGOP_NONE;
@@ -4839,10 +4847,10 @@ gdk_win32_get_window_size_and_position_from_client_rect (GdkWindow *window,
_gdk_win32_adjust_client_rect (window, window_rect);
/* Convert GDK screen coordinates to W32 desktop coordinates */
window_rect->left -= _gdk_offset_x * impl->window_scale;
window_rect->right -= _gdk_offset_x * impl->window_scale;
window_rect->top -= _gdk_offset_y * impl->window_scale;
window_rect->bottom -= _gdk_offset_y * impl->window_scale;
window_rect->left -= _gdk_offset_x;
window_rect->right -= _gdk_offset_x;
window_rect->top -= _gdk_offset_y;
window_rect->bottom -= _gdk_offset_y;
window_position->x = window_rect->left;
window_position->y = window_rect->top;
@@ -5295,7 +5303,7 @@ gdk_win32_window_unmaximize (GdkWindow *window)
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
if (GDK_WINDOW_IS_MAPPED (window))
GtkShowWindow (window, SW_RESTORE);
@@ -5392,7 +5400,7 @@ gdk_win32_window_unfullscreen (GdkWindow *window)
impl->hint_flags = fi->hint_flags;
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
_gdk_win32_window_invalidate_egl_framebuffer (window);
gdk_win32_window_invalidate_egl_framebuffer (window);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
fi->r.left, fi->r.top,
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
@@ -5814,13 +5822,13 @@ gdk_win32_window_show_window_menu (GdkWindow *window,
}
gdk_event_get_root_coords (event, &event_x, &event_y);
x = event_x - _gdk_offset_x;
y = event_y - _gdk_offset_y;
x = event_x * impl->window_scale - _gdk_offset_x;
y = event_y * impl->window_scale - _gdk_offset_y;
SendMessage (GDK_WINDOW_HWND (window),
WM_SYSMENU,
0,
MAKELPARAM (x * impl->window_scale, y * impl->window_scale));
MAKELPARAM (x, y));
return TRUE;
}
@@ -6295,8 +6303,8 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->get_property = _gdk_win32_window_get_property;
impl_class->change_property = _gdk_win32_window_change_property;
impl_class->delete_property = _gdk_win32_window_delete_property;
impl_class->create_gl_context = _gdk_win32_window_create_gl_context;
impl_class->invalidate_for_new_frame = _gdk_win32_window_invalidate_for_new_frame;
impl_class->create_gl_context = gdk_win32_window_create_gl_context;
impl_class->invalidate_for_new_frame = gdk_win32_window_invalidate_for_new_frame;
impl_class->get_scale_factor = _gdk_win32_window_get_scale_factor;
impl_class->get_unscaled_size = _gdk_win32_window_get_unscaled_size;
}
@@ -6320,8 +6328,8 @@ gdk_win32_window_get_handle (GdkWindow *window)
#ifdef GDK_WIN32_ENABLE_EGL
EGLSurface
_gdk_win32_window_get_egl_surface (GdkWindow *window,
EGLConfig config,
gboolean is_dummy)
EGLConfig config,
gboolean is_dummy)
{
EGLSurface surface;
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
@@ -6341,7 +6349,10 @@ _gdk_win32_window_get_egl_surface (GdkWindow *window,
else
{
if (impl->egl_surface == EGL_NO_SURFACE)
impl->egl_surface = eglCreateWindowSurface (display->egl_disp, config, display->gl_hwnd, NULL);
impl->egl_surface = eglCreateWindowSurface (display->egl_disp,
config,
GDK_WINDOW_HWND (window),
NULL);
return impl->egl_surface;
}
+1 -4
View File
@@ -26,15 +26,12 @@
#define __GDK_WINDOW_WIN32_H__
#include "gdk/win32/gdkprivate-win32.h"
#include "gdk/win32/gdkglcontext-win32.h"
#include "gdk/gdkwindowimpl.h"
#include "gdk/gdkcursor.h"
#include <windows.h>
#ifdef GDK_WIN32_ENABLE_EGL
#include <epoxy/egl.h>
#endif
G_BEGIN_DECLS
/* Window implementation for Win32
+7 -1
View File
@@ -30,9 +30,13 @@ all: \
gdk-win32.lib \
gdk.res
gdk_win32_DEPS = \
hid.lib
gdk_win32_OBJECTS = \
gdkcursor-win32.obj \
gdkdevice-win32.obj \
gdkdevice-winpointer.obj \
gdkdevice-wintab.obj \
gdkdevicemanager-win32.obj \
gdkdnd-win32.obj \
@@ -43,6 +47,8 @@ gdk_win32_OBJECTS = \
gdkglobals-win32.obj \
gdkinput.obj \
gdkkeys-win32.obj \
gdkkeys-win32-impl.obj \
gdkkeys-win32-impl-wow64.obj \
gdkmain-win32.obj \
gdkproperty-win32.obj \
gdkscreen-win32.obj \
@@ -61,7 +67,7 @@ gdk.res : rc\gdk.rc
rc -DBUILDNUMBER=0 -r -fo gdk.res rc\gdk.rc
gdk-win32.lib : $(gdk_win32_OBJECTS)
lib -out:gdk-win32.lib $(gdk_win32_OBJECTS)
lib -out:gdk-win32.lib $(gdk_win32_DEPS) $(gdk_win32_OBJECTS)
clean::
del *.obj
+5 -1
View File
@@ -3,6 +3,7 @@ gdk_win32_sources = files(
'gdkdevicemanager-win32.c',
'gdkdevice-virtual.c',
'gdkdevice-win32.c',
'gdkdevice-winpointer.c',
'gdkdevice-wintab.c',
'gdkdisplay-win32.c',
'gdkdisplaymanager-win32.c',
@@ -12,6 +13,8 @@ gdk_win32_sources = files(
'gdkglcontext-win32.c',
'gdkglobals-win32.c',
'gdkkeys-win32.c',
'gdkkeys-win32-impl.c',
'gdkkeys-win32-impl-wow64.c',
'gdkmain-win32.c',
'gdkmonitor-win32.c',
'gdkproperty-win32.c',
@@ -47,7 +50,8 @@ install_headers(gdk_win32_public_headers, subdir: 'gtk-3.0/gdk/win32')
install_headers('gdkwin32.h', subdir: 'gtk-3.0/gdk')
gdk_win32_deps = [ # FIXME
pangowin32_dep
pangowin32_dep,
meson.get_compiler('c').find_library('hid')
]
libgdk_win32 = static_library('gdk-win32',
+324
View File
@@ -0,0 +1,324 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2021 the GTK team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/* This code is derived from portions provided by the mingw-w64 project
* (mingw-w64.org), originally licensed under the Zope Public License
* (ZPL) version 2.1, with modifications made on May 12, 2021.
* Legal notice of the Zope Public License version 2.1 follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions in source code must retain the accompanying copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the accompanying
* copyright notice, this list of conditions, and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Names of the copyright holders must not be used to endorse or promote
* products derived from this software without prior written permission
* from the copyright holders.
* 4. The right to distribute this software or to use it for any purpose does
* not give you the right to use Servicemarks (sm) or Trademarks (tm) of
* the copyright holders. Use of them is covered by separate agreement
* with the copyright holders.
* 5. If any files are modified, you must cause the modified files to carry
* prominent notices stating that you changed the files and the date of
* any change.
*/
#ifndef POINTER_FLAG_NONE
#include <windows.h>
#include <tchar.h>
#define WM_POINTERDEVICECHANGE 0x238
#define WM_POINTERDEVICEINRANGE 0x239
#define WM_POINTERDEVICEOUTOFRANGE 0x23a
#define WM_NCPOINTERUPDATE 0x0241
#define WM_NCPOINTERDOWN 0x0242
#define WM_NCPOINTERUP 0x0243
#define WM_POINTERUPDATE 0x0245
#define WM_POINTERDOWN 0x0246
#define WM_POINTERUP 0x0247
#define WM_POINTERENTER 0x0249
#define WM_POINTERLEAVE 0x024a
#define WM_POINTERACTIVATE 0x024b
#define WM_POINTERCAPTURECHANGED 0x024c
#define WM_TOUCHHITTESTING 0x024d
#define WM_POINTERWHEEL 0x024e
#define WM_POINTERHWHEEL 0x024f
#define DM_POINTERHITTEST 0x0250
#define WM_POINTERROUTEDTO 0x0251
#define WM_POINTERROUTEDAWAY 0x0252
#define WM_POINTERROUTEDRELEASED 0x0253
#define POINTER_FLAG_NONE 0x00000000
#define POINTER_FLAG_NEW 0x00000001
#define POINTER_FLAG_INRANGE 0x00000002
#define POINTER_FLAG_INCONTACT 0x00000004
#define POINTER_FLAG_FIRSTBUTTON 0x00000010
#define POINTER_FLAG_SECONDBUTTON 0x00000020
#define POINTER_FLAG_THIRDBUTTON 0x00000040
#define POINTER_FLAG_FOURTHBUTTON 0x00000080
#define POINTER_FLAG_FIFTHBUTTON 0x00000100
#define POINTER_FLAG_PRIMARY 0x00002000
#define POINTER_FLAG_CONFIDENCE 0x00004000
#define POINTER_FLAG_CANCELED 0x00008000
#define POINTER_FLAG_DOWN 0x00010000
#define POINTER_FLAG_UPDATE 0x00020000
#define POINTER_FLAG_UP 0x00040000
#define POINTER_FLAG_WHEEL 0x00080000
#define POINTER_FLAG_HWHEEL 0x00100000
#define POINTER_FLAG_CAPTURECHANGED 0x00200000
#define POINTER_FLAG_HASTRANSFORM 0x00400000
#define POINTER_MOD_SHIFT (0x0004)
#define POINTER_MOD_CTRL (0x0008)
#define TOUCH_FLAG_NONE 0x00000000
#define TOUCH_MASK_NONE 0x00000000
#define TOUCH_MASK_CONTACTAREA 0x00000001
#define TOUCH_MASK_ORIENTATION 0x00000002
#define TOUCH_MASK_PRESSURE 0x00000004
#define PEN_FLAG_NONE 0x00000000
#define PEN_FLAG_BARREL 0x00000001
#define PEN_FLAG_INVERTED 0x00000002
#define PEN_FLAG_ERASER 0x00000004
#define PEN_MASK_NONE 0x00000000
#define PEN_MASK_PRESSURE 0x00000001
#define PEN_MASK_ROTATION 0x00000002
#define PEN_MASK_TILT_X 0x00000004
#define PEN_MASK_TILT_Y 0x00000008
#define POINTER_MESSAGE_FLAG_NEW 0x00000001
#define POINTER_MESSAGE_FLAG_INRANGE 0x00000002
#define POINTER_MESSAGE_FLAG_INCONTACT 0x00000004
#define POINTER_MESSAGE_FLAG_FIRSTBUTTON 0x00000010
#define POINTER_MESSAGE_FLAG_SECONDBUTTON 0x00000020
#define POINTER_MESSAGE_FLAG_THIRDBUTTON 0x00000040
#define POINTER_MESSAGE_FLAG_FOURTHBUTTON 0x00000080
#define POINTER_MESSAGE_FLAG_FIFTHBUTTON 0x00000100
#define POINTER_MESSAGE_FLAG_PRIMARY 0x00002000
#define POINTER_MESSAGE_FLAG_CONFIDENCE 0x00004000
#define POINTER_MESSAGE_FLAG_CANCELED 0x00008000
#define GET_POINTERID_WPARAM(wParam) (LOWORD (wParam))
#define IS_POINTER_FLAG_SET_WPARAM(wParam, flag) (((DWORD)HIWORD (wParam) &(flag)) == (flag))
#define IS_POINTER_NEW_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_NEW)
#define IS_POINTER_INRANGE_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_INRANGE)
#define IS_POINTER_INCONTACT_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_INCONTACT)
#define IS_POINTER_FIRSTBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FIRSTBUTTON)
#define IS_POINTER_SECONDBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_SECONDBUTTON)
#define IS_POINTER_THIRDBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_THIRDBUTTON)
#define IS_POINTER_FOURTHBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FOURTHBUTTON)
#define IS_POINTER_FIFTHBUTTON_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_FIFTHBUTTON)
#define IS_POINTER_PRIMARY_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_PRIMARY)
#define HAS_POINTER_CONFIDENCE_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_CONFIDENCE)
#define IS_POINTER_CANCELED_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM (wParam, POINTER_MESSAGE_FLAG_CANCELED)
#define PA_ACTIVATE MA_ACTIVATE
#define PA_NOACTIVATE MA_NOACTIVATE
#ifndef GC_ALLGESTURES
#define GC_ALLGESTURES 0x1
#endif
typedef DWORD POINTER_INPUT_TYPE;
typedef UINT32 POINTER_FLAGS;
typedef UINT32 TOUCH_FLAGS;
typedef UINT32 TOUCH_MASK;
typedef UINT32 PEN_FLAGS;
typedef UINT32 PEN_MASK;
enum tagPOINTER_INPUT_TYPE {
PT_POINTER = 0x00000001,
PT_TOUCH = 0x00000002,
PT_PEN = 0x00000003,
PT_MOUSE = 0x00000004,
PT_TOUCHPAD = 0x00000005
};
typedef enum tagFEEDBACK_TYPE {
FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1,
FEEDBACK_PEN_BARRELVISUALIZATION = 2,
FEEDBACK_PEN_TAP = 3,
FEEDBACK_PEN_DOUBLETAP = 4,
FEEDBACK_PEN_PRESSANDHOLD = 5,
FEEDBACK_PEN_RIGHTTAP = 6,
FEEDBACK_TOUCH_TAP = 7,
FEEDBACK_TOUCH_DOUBLETAP = 8,
FEEDBACK_TOUCH_PRESSANDHOLD = 9,
FEEDBACK_TOUCH_RIGHTTAP = 10,
FEEDBACK_GESTURE_PRESSANDTAP = 11,
FEEDBACK_MAX = 0xffffffff
} FEEDBACK_TYPE;
typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
POINTER_CHANGE_NONE,
POINTER_CHANGE_FIRSTBUTTON_DOWN,
POINTER_CHANGE_FIRSTBUTTON_UP,
POINTER_CHANGE_SECONDBUTTON_DOWN,
POINTER_CHANGE_SECONDBUTTON_UP,
POINTER_CHANGE_THIRDBUTTON_DOWN,
POINTER_CHANGE_THIRDBUTTON_UP,
POINTER_CHANGE_FOURTHBUTTON_DOWN,
POINTER_CHANGE_FOURTHBUTTON_UP,
POINTER_CHANGE_FIFTHBUTTON_DOWN,
POINTER_CHANGE_FIFTHBUTTON_UP,
} POINTER_BUTTON_CHANGE_TYPE;
typedef struct tagPOINTER_INFO {
POINTER_INPUT_TYPE pointerType;
UINT32 pointerId;
UINT32 frameId;
POINTER_FLAGS pointerFlags;
HANDLE sourceDevice;
HWND hwndTarget;
POINT ptPixelLocation;
POINT ptHimetricLocation;
POINT ptPixelLocationRaw;
POINT ptHimetricLocationRaw;
DWORD dwTime;
UINT32 historyCount;
INT32 InputData;
DWORD dwKeyStates;
UINT64 PerformanceCount;
POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
} POINTER_INFO;
typedef struct tagPOINTER_TOUCH_INFO {
POINTER_INFO pointerInfo;
TOUCH_FLAGS touchFlags;
TOUCH_MASK touchMask;
RECT rcContact;
RECT rcContactRaw;
UINT32 orientation;
UINT32 pressure;
} POINTER_TOUCH_INFO;
typedef struct tagPOINTER_PEN_INFO {
POINTER_INFO pointerInfo;
PEN_FLAGS penFlags;
PEN_MASK penMask;
UINT32 pressure;
UINT32 rotation;
INT32 tiltX;
INT32 tiltY;
} POINTER_PEN_INFO;
typedef enum {
POINTER_FEEDBACK_DEFAULT = 1,
POINTER_FEEDBACK_INDIRECT = 2,
POINTER_FEEDBACK_NONE = 3
} POINTER_FEEDBACK_MODE;
typedef struct tagUSAGE_PROPERTIES {
USHORT level;
USHORT page;
USHORT usage;
INT32 logicalMinimum;
INT32 logicalMaximum;
USHORT unit;
USHORT exponent;
BYTE count;
INT32 physicalMinimum;
INT32 physicalMaximum;
} USAGE_PROPERTIES, *PUSAGE_PROPERTIES;
typedef struct tagPOINTER_TYPE_INFO {
POINTER_INPUT_TYPE type;
union {
POINTER_TOUCH_INFO touchInfo;
POINTER_PEN_INFO penInfo;
} DUMMYUNIONNAME;
} POINTER_TYPE_INFO, *PPOINTER_TYPE_INFO;
#define POINTER_DEVICE_PRODUCT_STRING_MAX 520
#define PDC_ARRIVAL 0x001
#define PDC_REMOVAL 0x002
#define PDC_ORIENTATION_0 0x004
#define PDC_ORIENTATION_90 0x008
#define PDC_ORIENTATION_180 0x010
#define PDC_ORIENTATION_270 0x020
#define PDC_MODE_DEFAULT 0x040
#define PDC_MODE_CENTERED 0x080
#define PDC_MAPPING_CHANGE 0x100
#define PDC_RESOLUTION 0x200
#define PDC_ORIGIN 0x400
#define PDC_MODE_ASPECTRATIOPRESERVED 0x800
typedef enum tagPOINTER_DEVICE_TYPE {
POINTER_DEVICE_TYPE_INTEGRATED_PEN = 0x00000001,
POINTER_DEVICE_TYPE_EXTERNAL_PEN = 0x00000002,
POINTER_DEVICE_TYPE_TOUCH = 0x00000003,
POINTER_DEVICE_TYPE_TOUCH_PAD = 0x00000004,
POINTER_DEVICE_TYPE_MAX = 0xffffffff
} POINTER_DEVICE_TYPE;
typedef struct tagPOINTER_DEVICE_INFO {
DWORD displayOrientation;
HANDLE device;
POINTER_DEVICE_TYPE pointerDeviceType;
HMONITOR monitor;
ULONG startingCursorId;
USHORT maxActiveContacts;
WCHAR productString[POINTER_DEVICE_PRODUCT_STRING_MAX];
} POINTER_DEVICE_INFO;
typedef struct tagPOINTER_DEVICE_PROPERTY {
INT32 logicalMin;
INT32 logicalMax;
INT32 physicalMin;
INT32 physicalMax;
UINT32 unit;
UINT32 unitExponent;
USHORT usagePageId;
USHORT usageId;
} POINTER_DEVICE_PROPERTY;
typedef enum tagPOINTER_DEVICE_CURSOR_TYPE {
POINTER_DEVICE_CURSOR_TYPE_UNKNOWN = 0x00000000,
POINTER_DEVICE_CURSOR_TYPE_TIP = 0x00000001,
POINTER_DEVICE_CURSOR_TYPE_ERASER = 0x00000002,
POINTER_DEVICE_CURSOR_TYPE_MAX = 0xffffffff
} POINTER_DEVICE_CURSOR_TYPE;
typedef struct tagPOINTER_DEVICE_CURSOR_INFO {
UINT32 cursorId;
POINTER_DEVICE_CURSOR_TYPE cursor;
} POINTER_DEVICE_CURSOR_INFO;
#endif /* POINTER_FLAG_NONE */
#if WINVER < 0x0601
typedef struct tagGESTURECONFIG {
DWORD dwID;
DWORD dwWant;
DWORD dwBlock;
} GESTURECONFIG,*PGESTURECONFIG;
#endif /* WINVER < 0x0601 */
#ifndef MICROSOFT_TABLETPENSERVICE_PROPERTY
#define MICROSOFT_TABLETPENSERVICE_PROPERTY _T("MicrosoftTabletPenServiceProperty")
#endif
+3
View File
@@ -45,6 +45,9 @@ get_display_name (GFile *file,
if (name == NULL)
{
name = g_file_get_basename (file);
if (name == NULL)
name = g_file_get_uri (file);
if (!g_utf8_validate (name, -1, NULL))
{
tmp = name;
+44 -1
View File
@@ -61,7 +61,6 @@ struct _GdkX11DeviceXI2Class
G_DEFINE_TYPE (GdkX11DeviceXI2, gdk_x11_device_xi2, GDK_TYPE_DEVICE)
static void gdk_x11_device_xi2_finalize (GObject *object);
static void gdk_x11_device_xi2_get_property (GObject *object,
guint prop_id,
@@ -762,6 +761,20 @@ _gdk_x11_device_xi2_translate_event_mask (GdkX11DeviceManagerXI2 *device_manager
}
#endif /* XINPUT_2_2 */
#ifdef XINPUT_2_4
/* XInput 2.4 includes multitouch support */
if (minor >= 4 &&
event_mask & GDK_TOUCHPAD_GESTURE_MASK)
{
XISetMask (mask, XI_GesturePinchBegin);
XISetMask (mask, XI_GesturePinchUpdate);
XISetMask (mask, XI_GesturePinchEnd);
XISetMask (mask, XI_GestureSwipeBegin);
XISetMask (mask, XI_GestureSwipeUpdate);
XISetMask (mask, XI_GestureSwipeEnd);
}
#endif
return mask;
}
@@ -810,6 +823,36 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
return state;
}
#ifdef XINPUT_2_4
guint
_gdk_x11_device_xi2_gesture_type_to_phase (int evtype, int flags)
{
switch (evtype)
{
case XI_GesturePinchBegin:
case XI_GestureSwipeBegin:
return GDK_TOUCHPAD_GESTURE_PHASE_BEGIN;
case XI_GesturePinchUpdate:
case XI_GestureSwipeUpdate:
return GDK_TOUCHPAD_GESTURE_PHASE_UPDATE;
case XI_GesturePinchEnd:
if (flags & XIGesturePinchEventCancelled)
return GDK_TOUCHPAD_GESTURE_PHASE_CANCEL;
return GDK_TOUCHPAD_GESTURE_PHASE_END;
case XI_GestureSwipeEnd:
if (flags & XIGestureSwipeEventCancelled)
return GDK_TOUCHPAD_GESTURE_PHASE_CANCEL;
return GDK_TOUCHPAD_GESTURE_PHASE_END;
default:
g_assert_not_reached ();
return GDK_TOUCHPAD_GESTURE_PHASE_END;
}
}
#endif /* XINPUT_2_4 */
void
_gdk_x11_device_xi2_add_scroll_valuator (GdkX11DeviceXI2 *device,
guint n_valuator,
+3 -2
View File
@@ -48,14 +48,15 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
int major, minor;
major = 2;
minor = 3;
minor = 4;
if (!_gdk_disable_multidevice &&
XIQueryVersion (xdisplay, &major, &minor) != BadRequest)
{
GdkX11DeviceManagerXI2 *device_manager_xi2;
GDK_NOTE (INPUT, g_message ("Creating XI2 device manager"));
GDK_NOTE (INPUT, g_message ("Creating XI2 (version %d.%d) device manager",
major, minor));
device_manager_xi2 = g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_XI2,
"display", display,
+160 -1
View File
@@ -1335,6 +1335,26 @@ get_event_window (GdkEventTranslator *translator,
}
}
break;
#ifdef XINPUT_2_4
case XI_GesturePinchBegin:
case XI_GesturePinchUpdate:
case XI_GesturePinchEnd:
{
XIGesturePinchEvent *xev = (XIGesturePinchEvent *) ev;
window = gdk_x11_window_lookup_for_display (display, xev->event);
}
break;
case XI_GestureSwipeBegin:
case XI_GestureSwipeUpdate:
case XI_GestureSwipeEnd:
{
XIGestureSwipeEvent *xev = (XIGestureSwipeEvent *) ev;
window = gdk_x11_window_lookup_for_display (display, xev->event);
}
break;
#endif /* XINPUT_2_4 */
case XI_Enter:
case XI_Leave:
case XI_FocusIn:
@@ -1950,6 +1970,144 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
break;
#endif /* XINPUT_2_2 */
#ifdef XINPUT_2_4
case XI_GesturePinchBegin:
case XI_GesturePinchUpdate:
case XI_GesturePinchEnd:
{
XIGesturePinchEvent *xev = (XIGesturePinchEvent *) ev;
#ifdef G_ENABLE_DEBUG
const char* event_name = "";
switch (xev->evtype)
{
case XI_GesturePinchBegin:
event_name = "begin";
break;
case XI_GesturePinchUpdate:
event_name = "update";
break;
case XI_GesturePinchEnd:
event_name = "end";
break;
}
#endif
GDK_NOTE(EVENTS,
g_message ("pinch gesture %s:\twindow %ld\n\tfinger_count: %u%s",
event_name,
xev->event,
xev->detail,
xev->flags & XIGesturePinchEventCancelled ? "\n\tcancelled" : ""));
event->touchpad_pinch.type = GDK_TOUCHPAD_PINCH;
event->touchpad_pinch.phase =
_gdk_x11_device_xi2_gesture_type_to_phase (xev->evtype, xev->flags);
event->touchpad_pinch.window = window;
event->touchpad_pinch.time = xev->time;
event->touchpad_pinch.x = (gdouble) xev->event_x / scale;
event->touchpad_pinch.y = (gdouble) xev->event_y / scale;
event->touchpad_pinch.x_root = (gdouble) xev->root_x / scale;
event->touchpad_pinch.y_root = (gdouble) xev->root_y / scale;
event->touchpad_pinch.dx = xev->delta_x;
event->touchpad_pinch.dy = xev->delta_y;
event->touchpad_pinch.scale = xev->scale;
event->touchpad_pinch.angle_delta = xev->delta_angle * G_PI / 180;
event->touchpad_pinch.n_fingers = xev->detail;
device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->deviceid));
gdk_event_set_device (event, device);
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
gdk_event_set_source_device (event, source_device);
gdk_event_set_seat (event, gdk_device_get_seat (device));
event->touchpad_pinch.state = _gdk_x11_device_xi2_translate_state (&xev->mods, NULL, &xev->group);
if (xev->evtype == XI_GesturePinchBegin || xev->evtype == XI_GesturePinchEnd)
{
if (!set_screen_from_root (display, event, xev->root))
{
return_val = FALSE;
break;
}
}
if (ev->evtype == XI_GesturePinchBegin)
set_user_time (event);
}
break;
case XI_GestureSwipeBegin:
case XI_GestureSwipeUpdate:
case XI_GestureSwipeEnd:
{
XIGestureSwipeEvent *xev = (XIGestureSwipeEvent *) ev;
#ifdef G_ENABLE_DEBUG
const char* event_name = "";
switch (xev->evtype)
{
case XI_GestureSwipeBegin:
event_name = "begin";
break;
case XI_GestureSwipeUpdate:
event_name = "update";
break;
case XI_GestureSwipeEnd:
event_name = "end";
break;
}
#endif
GDK_NOTE(EVENTS,
g_message ("swipe gesture %s:\twindow %ld\n\tfinger_count: %u%s",
event_name,
xev->event,
xev->detail,
xev->flags & XIGestureSwipeEventCancelled ? "\n\tcancelled" : ""));
event->touchpad_swipe.type = GDK_TOUCHPAD_SWIPE;
event->touchpad_pinch.phase =
_gdk_x11_device_xi2_gesture_type_to_phase (xev->evtype, xev->flags);
event->touchpad_swipe.window = window;
event->touchpad_swipe.time = xev->time;
event->touchpad_swipe.x = (gdouble) xev->event_x / scale;
event->touchpad_swipe.y = (gdouble) xev->event_y / scale;
event->touchpad_swipe.x_root = (gdouble) xev->root_x / scale;
event->touchpad_swipe.y_root = (gdouble) xev->root_y / scale;
event->touchpad_swipe.dx = xev->delta_x;
event->touchpad_swipe.dy = xev->delta_y;
event->touchpad_swipe.n_fingers = xev->detail;
device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->deviceid));
gdk_event_set_device (event, device);
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
gdk_event_set_source_device (event, source_device);
gdk_event_set_seat (event, gdk_device_get_seat (device));
event->touchpad_swipe.state = _gdk_x11_device_xi2_translate_state (&xev->mods, NULL, &xev->group);
if (xev->evtype == XI_GestureSwipeBegin || xev->evtype == XI_GestureSwipeEnd)
{
if (!set_screen_from_root (display, event, xev->root))
{
return_val = FALSE;
break;
}
}
if (ev->evtype == XI_GestureSwipeBegin)
set_user_time (event);
}
break;
#endif /* XINPUT_2_4 */
case XI_Enter:
case XI_Leave:
{
@@ -2078,7 +2236,8 @@ gdk_x11_device_manager_xi2_get_handled_events (GdkEventTranslator *translator)
GDK_BUTTON3_MOTION_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_TOUCH_MASK);
GDK_TOUCH_MASK |
GDK_TOUCHPAD_GESTURE_MASK);
}
static void
+3
View File
@@ -1964,6 +1964,9 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
static void
gdk_x11_display_beep (GdkDisplay *display)
{
if (!GDK_X11_DISPLAY (display)->trusted_client)
return;
#ifdef HAVE_XKB
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
#else
+2
View File
@@ -634,12 +634,14 @@ gdk_window_cache_new (GdkScreen *screen)
*/
if (gdk_screen_is_composited (screen))
{
gdk_x11_display_error_trap_push (GDK_X11_SCREEN (screen)->display);
cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_window_cache_add (result, cow, 0, 0,
gdk_x11_screen_get_width (screen) * GDK_X11_SCREEN(screen)->window_scale,
gdk_x11_screen_get_height (screen) * GDK_X11_SCREEN(screen)->window_scale,
TRUE);
XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_x11_display_error_trap_pop_ignored (GDK_X11_SCREEN (screen)->display);
}
#endif
+6 -17
View File
@@ -240,24 +240,13 @@ gdk_x_io_error (Display *display)
/* This is basically modelled after the code in XLib. We need
* an explicit error handler here, so we can disable our atexit()
* which would otherwise cause a nice segfault.
* We fprintf(stderr, instead of g_warning() because g_warning()
* could possibly be redirected to a dialog
* We g_debug() instead of g_warning(), because g_warning()
* could possibly be redirected to the log
*/
if (errno == EPIPE)
{
g_message ("The application '%s' lost its connection to the display %s;\n"
"most likely the X server was shut down or you killed/destroyed\n"
"the application.\n",
g_get_prgname (),
display ? DisplayString (display) : gdk_get_display_arg_name ());
}
else
{
g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
g_get_prgname (),
errno, g_strerror (errno),
display ? DisplayString (display) : gdk_get_display_arg_name ());
}
g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
g_get_prgname (),
errno, g_strerror (errno),
display ? DisplayString (display) : gdk_get_display_arg_name ());
_exit (1);
}
+5
View File
@@ -230,6 +230,11 @@ guchar * _gdk_x11_device_xi2_translate_event_mask (GdkX11DeviceManagerXI2 *devic
guint _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
XIButtonState *buttons_state,
XIGroupState *group_state);
#ifdef XINPUT_2_4
guint _gdk_x11_device_xi2_gesture_type_to_phase (int evtype, int flags);
#endif
gint _gdk_x11_device_xi2_get_id (GdkX11DeviceXI2 *device);
void _gdk_device_xi2_unset_scroll_valuators (GdkX11DeviceXI2 *device);
+10 -1
View File
@@ -568,9 +568,18 @@ init_randr15 (GdkScreen *screen, gboolean *changed)
if (output_info->crtc)
{
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
XRRCrtcInfo *crtc;
int j;
gdk_x11_display_error_trap_push (display);
crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources,
output_info->crtc);
if (gdk_x11_display_error_trap_pop (display))
{
XRRFreeOutputInfo (output_info);
continue;
}
for (j = 0; j < resources->nmode; j++)
{
XRRModeInfo *xmode = &resources->modes[j];
+23 -3
View File
@@ -3025,12 +3025,29 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (pattern == parent_relative_pattern)
{
GdkWindow *parent;
Window xroot, xparent, *xchildren;
guint nxchildren, xparent_depth;
XWindowAttributes xattrs;
if (!XQueryTree (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
&xroot, &xparent, &xchildren, &nxchildren))
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
return;
}
if (xchildren)
XFree (xchildren);
if (xparent) {
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window), xparent, &xattrs);
xparent_depth = xattrs.depth;
}
/* X throws BadMatch if the parent has a different depth when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent != NULL && window->depth == parent->depth &&
if (xparent && window->depth == xparent_depth &&
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
@@ -5455,6 +5472,9 @@ gdk_x11_window_beep (GdkWindow *window)
display = GDK_WINDOW_DISPLAY (window);
if (!GDK_X11_DISPLAY (display)->trusted_client)
return FALSE;
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{

Some files were not shown because too many files have changed in this diff Show More