Commit Graph

21854 Commits

Author SHA1 Message Date
Chun-wei Fan
53d0759d3e Merge branch 'msvc.cleanup.224' into 'gtk-2-24'
Visual Studio projects: Clean up generating gtk.def

See merge request GNOME/gtk!2606
2020-09-21 04:59:03 +00:00
Chun-wei Fan
61f871404c Visual Studio projects: Clean up generating gtk.def
It turns out that we do not need to have separate command lines for
running the Visual Studio preprocessor for 32-bit builds and 64-bit
builds as `_WIN64` is automatically defined by the 64-bit compilers.

This means that we can clean up the project files a bit.
2020-09-21 12:02:24 +08:00
John Ralls
5f104c9883 Include gdkquartz.h in gtkclipboard-quartz.c
to declare gdk_quartz_pasteboard_type_to_atom_libgtk_only.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/3161
2020-09-14 13:19:09 -07:00
Matthias Clasen
2d88f6f501 Merge branch 'wip/lantw/build-Fix-out-of-source-make-dist' into 'gtk-2-24'
build: Fix out-of-source make dist

See merge request GNOME/gtk!2505
2020-08-31 16:44:06 +00:00
Ting-Wei Lan
56bdcfd7c6 build: Fix out-of-source make dist
These files are generated during the build.
2020-08-30 11:23:05 +08:00
Emmanuele Bassi
2b3d65895b Merge branch 'wip/lantw/build-Move-gtk.def-to-builddir' into 'gtk-2-24'
build: Move gtk.def to builddir

See merge request GNOME/gtk!2481
2020-08-26 15:14:45 +00:00
Ting-Wei Lan
f203b1a751 build: Move gtk.def to builddir
GTK2 uses different gtk.def files on 32-bit and 64-bit Windows. GTK2
source tarballs ship pre-generated gtk.def for 32-bit Windows. If the
user wants to build for 64-bit Windows, the pre-generated gtk.def must
be deleted before the build to force regeneration, or it will fail to
link with 'symbol not defined' errors because the 32-bit Windows build
includes more legacy functions than the 64-bit Windows build.

While users who want to build for 64-bit Windows can delete gtk.def in
the build script, which is currently what most build scripts do, doing
so breaks out-of-source build. On AUR, MinGW packages are usually built
and packaged in the following order:

1. Run 'configure' and 'make' to build for i686-w64-mingw32.
2. Run 'configure' and 'make' to build for x86_64-w64-mingw32.
3. Run 'make install' for i686-w64-mingw32.
4. Run 'make install' for x86_64-w64-mingw32.

It fails because step 3 sees gtk.def left by step 2, which is generated
for a different build. In step 3, make sees the gtk.def change and runs
libtool to relink libgtk-win32-2.0-0.dll. libtool fails to find a lot of
necessary libraries, decides that it is not possible to build a DLL with
-no-undefined, and produces only the static library. It then tries to
relink executables with the static library, and fails with undefined
reference to 'IID_IUnknown' because -Wl,--start-group isn't used and
the use of -Wl,-luuid prevents libtool from using the correct order.

To resolve the problem, move gtk.def to builddir so different builds can
have different gtk.def files while sharing the same source tree. This
also means that the source tarball will no longer include pre-generated
gtk.def file, which should be acceptable because it is already broken on
64-bit Windows.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3029
2020-08-26 23:02:51 +08:00
Matthias Clasen
b4c52486f5 Merge branch 'fix-gtk2-build-on-msys2' into 'gtk-2-24'
Fix GTK2 build on MSYS2

See merge request GNOME/gtk!2305
2020-07-29 12:12:16 +00:00
Philip Zander
aae860fe3e Change __declspec(dllexport) to extern __declspec(dllexport)
As of 28 July 2020, building on MSYS2 fails with "multiple definition"
errors unless exported variables are explicitly marked as "extern".

Closes #2958
2020-07-28 13:22:15 +02:00
Matthias Clasen
fc1bd0cf2c Merge branch 'fix-pixbuf-out-of-bounds' into 'gtk-2-24'
Resolve GIMP segfault from accessing memory past end of pixbuf

See merge request GNOME/gtk!1813
2020-05-01 22:20:10 +00:00
Nam Nguyen
d1b21ff159 Resolve GIMP segfault from accessing memory past end of pixbuf
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2684

GIMP segfaults while switching themes between dark and gray and inputting Ctrl-O
to open a file. This is because p advances past end of pixbuf in pixbuf-render.c
compute_hint() with num_channels = 3 (no alpha). This is resolved by fixing the
if statement to only check for alpha, thereby advancing p, if there is an alpha
channel.
2020-05-01 21:55:49 +00:00
Alex Samorukov
29103cdc3c Use bundle id instead of package name for the macOS preview as filename is now changed 2020-01-14 22:17:09 +00:00
Emmanuele Bassi
ad5d360654 Merge branch 'issue-183-backport' into 'gtk-2-24'
Do not use VIQR input method for vi locale by default

See merge request GNOME/gtk!1193
2019-11-16 20:28:39 +00:00
Ming Hua
88ac9188a3 Do not use VIQR input method for vi locale by default
In the Vietnamese Quoted-Readable input method, punctuation following a
base letter is converted into diacritical marks, for example a( → ă.
(See <https://en.wikipedia.org/wiki/Vietnamese_Quoted-Readable>.)
A 2008 bug report in Ubuntu argued that this is a problematic default,
particularly when typing passwords, where the effect of the punctuation
is non-obvious.

According to the bug reporter, VIQR is popular with Vietnamese users
living elsewhere in the world, where Vietnamese keyboards are unlikely
to be readily available, but is not a popular choice within Vietnam,
where the Telex or VNI input modes are preferred.

Closes: #183

Bug-Debian: https://bugs.debian.org/895043
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/191451

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2019-11-16 20:19:23 +00:00
Emmanuele Bassi
e3cc5ebdd2 Merge branch 'fix-win32-build' into 'gtk-2-24'
win32: Remove extraneous changes

See merge request GNOME/gtk!1119
2019-10-07 15:26:53 +00:00
Emmanuele Bassi
0d44567669 Add CI for gtk-2-24
A little bit late, but probably for the best.
2019-10-07 15:41:30 +01:00
Emmanuele Bassi
8467850709 win32: Remove extraneous changes
Commit 6ae3082603 included some changes from the gtk-3-24 branch that
do not make sense in the context of the commit, and break the build of
GTK 2 on Windows. The delta_x and delta_y fields do not exist in the
GdkEventScroll in the gtk-2-24 branch.
2019-10-07 15:36:51 +01:00
Emmanuele Bassi
56c6970b02 Merge branch 'gtk-2-24-py3' into 'gtk-2-24'
Make gtk-builder-convert compatible with Python 3

See merge request GNOME/gtk!1080
2019-09-03 13:15:57 +00:00
Petr Viktorin
b5ea5a0cf1 gtk-builder-convert: Update bug report URL
Also, use a newline instead of period at the end to make the
URL easy to copy
2019-09-03 14:57:40 +02:00
Petr Viktorin
4f8efe3ae0 gtk-builder-convert: Remove compat code for Python 2.3 and below 2019-09-03 14:57:36 +02:00
Petr Viktorin
3ff8f70b96 Make gtk-builder-convert compatible with Python 3
- Convert tabs to spaces
- Use print as a function, even on Python 2
- Output a binary file, or decode for stdout
2019-09-03 13:54:49 +02:00
Matthias Clasen
6672a23fb7 Merge branch 'gtk-2-24' into 'gtk-2-24'
Fix use-after-free due to unexpected unref of context->default_style.

See merge request GNOME/gtk!1045
2019-08-25 11:44:08 +00:00
John Lindgren
539a596e49 Fix use-after-free due to unexpected unref of context->default_style.
Segfault occurred when displaying two windows on different X11 displays.

valgrind said:

Invalid read of size 8
  at 0x4A20962: _gtk_style_init_for_settings (gtkstyle.c:398)
  by 0x49ED785: gtk_rc_get_style (gtkrc.c:2036)
  by 0x4AC39C2: gtk_widget_reset_rc_style (gtkwidget.c:6601)
Address 0x70b8e80 is 560 bytes inside a block of size 1,024 free'd
  at 0x48399AB: free (vg_replace_malloc.c:530)
  by 0x51180D6: g_type_free_instance (in /usr/lib/libgobject-2.0.so.0.6000.6)
  by 0x49E98CE: gtk_rc_reset_styles (gtkrc.c:1702)
  by 0x49E9A0C: _gtk_rc_context_get_default_font_name (gtkrc.c:1740)
  by 0x4A20961: _gtk_style_init_for_settings (gtkstyle.c:396)
  by 0x49ED785: gtk_rc_get_style (gtkrc.c:2036)
  by 0x4AC39C2: gtk_widget_reset_rc_style (gtkwidget.c:6601)
Block was alloc'd at
  at 0x483877F: malloc (vg_replace_malloc.c:299)
  by 0x51BD289: g_malloc (in /usr/lib/libglib-2.0.so.0.6000.6)
  by 0x519F673: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6000.6)
  by 0x51A62BA: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.6000.6)
  by 0x5119141: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.6000.6)
  by 0x513563D: ??? (in /usr/lib/libgobject-2.0.so.0.6000.6)
  by 0x5136A54: g_object_new_with_properties (in /usr/lib/libgobject-2.0.so.0.6000.6)
  by 0x5136B51: g_object_new (in /usr/lib/libgobject-2.0.so.0.6000.6)
  by 0x49ED774: gtk_rc_get_style (gtkrc.c:2035)
  by 0x4AC39C2: gtk_widget_reset_rc_style (gtkwidget.c:6601)
2019-08-06 02:12:43 -04:00
Chun-wei Fan
cd196c4f1d Visual Studio builds: Fix previous commit
I forgot to include configure.ac in the commit, which is needed.
2019-06-18 16:28:10 +08:00
Chun-wei Fan
a63b70f1dc Visual Studio builds: "Add" Visual Studio 2019 projects
Copy and update the relevant fields from the Visual Studio 2010 projects
so that we can have project files that work out-of-the-box for Visual
Studio 2019, as we did for Visual Studio 2012 through 2017.

Also update the NMake Makefiles for building the introspection files
so that we properly detect that we are building with Visual Studio 2019.
2019-06-18 16:24:54 +08:00
John Ralls
c505d3fcf8 Force redraw on Mojave and later when processing updates.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1479
2019-03-14 21:47:37 -07:00
Руслан Ижбулатов
6ae3082603 Fix UAC manifest RC file
CREATEPROCESS_MANIFEST_RESOURCE_ID is a macro defined in winbase.h,
so we need an include to resolve that macro to its value, 1.

Without that it stays as a literal CREATEPROCESS_MANIFEST_RESOURCE_ID,
and ends up in the .exe file as-is, and Windows can't find it by that name,
resulting in UAC manifest not working and gtk-update-icon-cache bringing
up UAC prompt.
2019-03-14 09:18:09 +00:00
Matthias Clasen
b9a39bf986 Merge branch 'control-enter-2' into 'gtk-2-24'
atk key: Always convert control character events into key names

See merge request GNOME/gtk!631
2019-03-12 18:12:14 +00:00
Samuel Thibault
cf15c11429 atk key: Always convert control character events into key names
including when the control modifier is present, i.e. when one is typing
control-I for instance.

Orca would convert them back to the corresponding ASCII letter anyway, and
when pressing control-tab, we do want to pass "tab", not pass "\t" that Orca
would erroneously convert to "control-I".

Fixes #1743

(cherry picked from commit 728f6869cb)
2019-03-12 18:27:46 +01:00
Matthias Clasen
32c51eabc1 Merge branch 'gtk-2-24' into 'gtk-2-24'
icontheme: Fix annotations on array arguments

See merge request GNOME/gtk!620
2019-03-06 19:30:52 +00:00
Marco Trevisan (Treviño)
072d8546b0 icontheme: Fix annotations on array arguments
The extra ':' makes gir not to handle properly all the rest.
2019-03-06 19:54:49 +01:00
Chun-wei Fan
6b55898162 MSVC introspection: Make more robust and avoid confusion
This updates the introspection build process that we also check on
changes in the Makefiles when we generate the NMake Makefile snippets
and file lists, so that any changes to the source file list can be
reflected.  Also ensure that we build against the freshly-built
libraries.

Make the NMake Makefiles also output the built introspection items to
the output directories of the various Visual Studio versions, according
to the build configuration and architecture, so that we avoid confusion
for different Visual Studio build configs.
2019-01-21 12:53:37 +08:00
Emmanuele Bassi
d681b538e3 Merge branch 'gtk-2-24' into 'gtk-2-24'
Revert "gdk: deactivation/activate window on keyboard grabs"

See merge request GNOME/gtk!483
2019-01-09 16:30:28 +00:00
Samuel Thibault
75a4eeb2f8 Revert "gdk: deactivation/activate window on keyboard grabs"
This reverts commits 853f786727 and
00b17063ac.

This reintroduces #85, but see discussion in
https://gitlab.gnome.org/GNOME/gtk/merge_requests/433 for the unforeseen
invasive consequences of these commits.
2019-01-04 17:06:17 +01:00
Chun-wei Fan
8042e07879 Merge branch 'gtk-2-24.win.fixes' into 'gtk-2-24'
gtk/gtkiconcache.c: Fix running on GLib-2.57.3 or later on Windows

See merge request GNOME/gtk!469
2018-12-21 09:56:25 +00:00
Chun-wei Fan
4612f0b3fe gtk/gtkiconcache.c: Fix running on GLib-2.57.3 or later on Windows
In GLib-2.57.3 and later, GStatBuf may not be a struct stat on Windows,
depending on the architecture and the compiler used, so we can't just
call fstat() on the GStatBuf.

Instead, we need to use the correct CRT function to call on the
GStatBuf, which is as follows:

-_fstat32() for Windows 32-bit builds on mingw-w64 and MSVC
-_fstat64() for Windows 64-bit builds on mingw-w64
-stat() for Windows 64-bit builds on MSVC, and on all other platforms.
2018-12-21 13:40:05 +08:00
Chun-wei Fan
16682dd237 MSVC builds: Fix pkg-config file generation
We are not passing in the correct architecture to the script that we use
to generate the pkg-config files for Release/x86 builds and Debug/x64
builds.  Fix this.
2018-12-21 13:25:14 +08:00
Chun-wei Fan
0b7ee9880a MSVC builds: Improve pkg-config files generation
Just link to Cairo instead of looking for the Cairo .pc file as the
Cairo build system for Visual Studio currently does not generate a
pkg-config file for us.  This will eliminate the need to hand-craft a
pkg-config file for Cairo to be able to use the pkg-config files that we
generate here.
2018-12-21 13:22:19 +08:00
Chun-wei Fan
639688d37e [gdk|gtk]/Makefile.am: Fix CFlags passed to introspecion on MSVC
Don't pass in G_LOG_DOMAIN=\"...\" to the CFlags that is passed into the
generation the NMake Makefiles.  This will avoid the introspection scanner
from choking because the resulting NMake Makefiles may not have that
CFlag escaped properly, and it is not really needed for building the
introspection binary.
2018-12-21 13:02:05 +08:00
Chun-wei Fan
417c4f9a5f MSVC projects: "Install" libwimp.pdb
Also "install" the libwimp's (Win32 theme engine) PDB file, for
completeness' sake, and to aid in debugging the item, if necessary.
2018-12-21 12:21:42 +08:00
John Ralls
aca9558c6d Fix two mistakes in previous commit.
Failed to re-commit before pushing.
2018-11-01 15:36:19 -07:00
John Ralls
0388a321b4 Protect CGContext calls from null CGContextRefs.
To prevent invalid CGContext warnings.
2018-11-01 13:17:27 -07:00
John Ralls
e6cfbb24b8 Return a default surface if the view has no currentContext.
Note that the resultind surface will not display on the screen.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1411 for Gtk2.
2018-11-01 12:56:20 -07:00
John Ralls
ac3ec98029 Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite. 2018-10-29 15:42:22 -07:00
John Ralls
74d7148089 Update GDK_OSX versions to current MacOS release. 2018-10-29 15:41:27 -07:00
Matthias Clasen
664537d618 Merge branch 'lrn/gtk224-w32-monitor-enum' into 'gtk-2-24'
GDK W32: ensure that monitor enumeration matches up

See merge request GNOME/gtk!182
2018-08-30 17:20:06 +00:00
Christoph Reiter
eec3ce0b4e Merge branch 'g_stat-and-GStatBuf' into 'gtk-2-24'
Consistently use g_stat and GStatBuf

See merge request GNOME/gtk!300
2018-08-19 14:30:26 +00:00
Eduard Braun
303858fa76 Consistently use g_stat and GStatBuf
Replace "stat struct" with "GStatBuf" and "stat" with "g_stat" where
appropriate to fix cross-platform issues, specifically on Windows.

Code should be identical on *nix but fixes some serious issues
on Windows:
- Field widths of "struct stat" are not constant on Windows.
  If the stat function does not match the stat struct used
  it will cause overwrites and undefined behavior
- The Windows stat function needs a properly encoded filename.
  In many places we pass an UTF-8 encoded value which breaks as soon
  as non-ASCII characters are involved.

https://bugzilla.gnome.org/show_bug.cgi?id=787772
2018-08-19 14:53:15 +02:00
Matthias Clasen
184b2cce72 Merge branch 'gtk-2-24' into 'gtk-2-24'
Fix some compiler warnings in modules/other/gail/gailtreeview.c

See merge request GNOME/gtk!239
2018-07-20 14:23:29 +00:00
Brady Minardi
8f8336cd94 modules/other/gail/gailtreeview.c: Incorporate review suggestions
Incorporate review suggestions by Emmanuele Bassi.
2018-07-14 14:45:28 +00:00