0dbf91123d
Currently, the GdkSurfaceX11 implementation relies that the upper layers hid the surface before destruction, and that no GdkSurfaceClass.compute_resize happened between them. If these circumstances happened, there would be a compute_size timeout left dangling after the surface got destroyed, poking at incorrect data later on. Something that looks like this was reported in the recent mutter-x11-frames "SSD frames server": mutter-x11-frames:423016): GLib-GObject-WARNING **: 19:41:16.869: invalid unclassed pointer in cast to 'GtkWindow' Thread 1 "mutter-x11-fram" received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=0x7ffff7f7c4f8 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1433 1433 ../../../glib/gmessages.c: No such file or directory. (gdb) bt #0 g_logv (log_domain=0x7ffff7f7c4f8 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1433 #1 0x00007ffff73470ff in g_log (log_domain=log_domain@entry=0x7ffff7f7c4f8 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x7ffff7f84da8 "invalid unclassed pointer in cast to '%s'") at ../../../glib/gmessages.c:1471 #2 0x00007ffff7f72892 in g_type_check_instance_cast (type_instance=type_instance@entry=0x5555558e04b0, iface_type=<optimized out>) at ../../../gobject/gtype.c:4144 #3 0x00007ffff791e77d in toplevel_compute_size (toplevel=<optimized out>, size=0x7fffffffe170, widget=0x5555558e04b0) at ../../../gtk/gtkwindow.c:4227 #4 0x00007ffff7f4f3b0 in g_closure_invoke (closure=0x555555898cc0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffdeb0, invocation_hint=invocation_hint@entry=0x7fffffffde30) at ../../../gobject/gclosure.c:832 #5 0x00007ffff7f62076 in signal_emit_unlocked_R (node=node@entry=0x55555588feb0, detail=detail@entry=0, instance=instance@entry=0x55555560e990, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffdeb0) at ../../../gobject/gsignal.c:3796 #6 0x00007ffff7f68bf5 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffe050) at ../../../gobject/gsignal.c:3549 #7 0x00007ffff7f68dbf in <emit signal ??? on instance 0x55555560e990 [GdkX11Toplevel]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606 #8 0x00007ffff7a8de96 in gdk_toplevel_notify_compute_size (toplevel=<optimized out>, size=size@entry=0x7fffffffe170) at ../../../gdk/gdktoplevel.c:112 #9 0x00007ffff7a4b15a in compute_toplevel_size (surface=surface@entry=0x55555560e990 [GdkX11Toplevel], update_geometry=update_geometry@entry=1, width=width@entry=0x7fffffffe220, height=height@entry=0x7fffffffe224) at ../../../gdk/x11/gdksurface-x11.c:281 #10 0x00007ffff7a4c3b2 in compute_size_idle (user_data=0x55555560e990) at ../../../gdk/x11/gdksurface-x11.c:356 #11 0x00007ffff733f67f in g_main_dispatch (context=0x55555563f6e0) at ../../../glib/gmain.c:3444 #12 g_main_context_dispatch (context=context@entry=0x55555563f6e0) at ../../../glib/gmain.c:4162 #13 0x00007ffff733fa38 in g_main_context_iterate (context=0x55555563f6e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4238 #14 0x00007ffff733fcef in g_main_loop_run (loop=loop@entry=0x5555560874a0) at ../../../glib/gmain.c:4438 #15 0x0000555555557de0 in main (argc=<optimized out>, argv=<optimized out>) at ../src/frames/main.c:68 It perhaps makes sense to warn in these situations, but either way it sounds like gdk_surface_x11_finalize() could enforce the correct behavior by ensuring there is no dangling timeouts/data. This commit does that. |
||
---|---|---|
.gitlab/issue_templates | ||
.gitlab-ci | ||
build-aux | ||
demos | ||
docs | ||
examples | ||
gdk | ||
gsk | ||
gtk | ||
modules | ||
po | ||
subprojects | ||
tests | ||
testsuite | ||
tools | ||
.clang-format | ||
.editorconfig | ||
.gitignore | ||
.gitlab-ci.yml | ||
AUTHORS | ||
CONTRIBUTING.md | ||
COPYING | ||
gtk.doap | ||
gtk.supp | ||
lsan.supp | ||
make-pot | ||
make-release.sh | ||
meson_options.txt | ||
meson.build | ||
NEWS | ||
NEWS.pre-1.0 | ||
NEWS.pre-2.0 | ||
NEWS.pre-3.0 | ||
NEWS.pre-4.0 | ||
README.md |
GTK — The GTK toolkit
General information
GTK is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK is suitable for projects ranging from small one-off projects to complete application suites.
GTK is a free and open-source software project. The licensing terms for GTK, the GNU LGPL, allow it to be used by all developers, including those developing proprietary software, without any license fees or royalties.
GTK is hosted by the GNOME project (thanks!) and used by a wide variety of applications and projects.
The official download location
The official web site
The official developers blog
Discussion forum
Nightly documentation can be found at
- Gtk: https://gnome.pages.gitlab.gnome.org/gtk/gtk4/
- Gdk: https://gnome.pages.gitlab.gnome.org/gtk/gdk4/
- Gsk: https://gnome.pages.gitlab.gnome.org/gtk/gsk4/
Nightly flatpaks of our demos can be installed from the GNOME Nightly repository:
flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo
flatpak install gnome-nightly org.gtk.Demo4
flatpak install gnome-nightly org.gtk.WidgetFactory4
flatpak install gnome-nightly org.gtk.IconBrowser4
Building and installing
In order to build GTK you will need:
You will also need various dependencies, based on the platform you are building for:
If you are building the X11 backend, you will also need:
- Xlib, and the following X extensions:
- xrandr
- xrender
- xi
- xext
- xfixes
- xcursor
- xdamage
- xcomposite
If you are building the Wayland backend, you will also need:
- Wayland-client
- Wayland-protocols
- Wayland-cursor
- Wayland-EGL
Once you have all the necessary dependencies, you can build GTK by using Meson:
$ meson _build .
$ cd _build
$ ninja
You can run the test suite using:
$ meson test
And, finally, you can install GTK using:
$ sudo ninja install
Complete information about installing GTK and related libraries can be found in the file:
docs/reference/gtk/html/gtk-building.html
Or online
Default branch renamed to main
The default development branch of GTK has been renamed to main
.
To update your local checkout, use:
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
How to report bugs
Bugs should be reported on the issues page.
In the bug report please include:
-
Information about your system. For instance:
- which version of GTK you are using
- what operating system and version
- for Linux, which distribution
- if you built GTK, the list of options used to configure the build
And anything else you think is relevant.
-
How to reproduce the bug.
If you can reproduce it with one of the demo applications that are built in the demos/ subdirectory, on one of the test programs that are built in the tests/ subdirectory, that will be most convenient. Otherwise, please include a short test program that exhibits the behavior. As a last resort, you can also provide a pointer to a larger piece of software that can be downloaded.
-
If the bug was a crash, the exact text that was printed out when the crash occurred.
-
Further information such as stack traces may be useful, but is not necessary.
Contributing to GTK
Please, follow the contribution guide to know how to start contributing to GTK.
If you want to support GTK financially, please consider donating to the GNOME project, which runs the infrastructure hosting GTK.
Release notes
The release notes for GTK are part of the migration guide in the API reference. See:
Licensing terms
GTK is released under the terms of the GNU Lesser General Public License, version 2.1 or, at your option, any later version, as published by the Free Software Foundation.
Please, see the COPYING
file for further information.
GTK includes a small number of source files under the Apache license:
- A fork of the roaring bitmaps implementation in gtk/roaring
- An adaptation of timsort from python in gtk/timsort