2021-02-10 14:03:56 +00:00
|
|
|
Title: Running and debugging GTK Applications
|
|
|
|
Slug: gtk-running
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
## Environment variables
|
|
|
|
|
|
|
|
GTK inspects a number of environment variables in addition to
|
|
|
|
standard variables like `LANG`, `PATH`, `HOME` or `DISPLAY`; mostly
|
2020-06-28 17:41:15 +00:00
|
|
|
to determine paths to look for certain files. The [X11](#x11-envar),
|
|
|
|
[Wayland](#wayland-envar), [Windows](#win32-envar) and
|
|
|
|
[Broadway](#broadway-envar) GDK backends use some additional
|
|
|
|
environment variables.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_DEBUG`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2020-11-14 07:49:17 +00:00
|
|
|
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 `-Ddebug=true`.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`actions`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Actions and menu models
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`builder`
|
2021-02-20 05:19:51 +00:00
|
|
|
: GtkBuilder support
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`geometry`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Size allocation
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`icontheme`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Icon themes
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`keybindings`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Keybindings
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`modules`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Loading of modules
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`printing`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Printing support
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`size-request`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Size requests
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`text`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Text widget internals
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`tree`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Tree widget internals
|
|
|
|
|
|
|
|
A number of keys are influencing behavior instead of just logging:
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`interactive`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Open the [interactive debugger](#interactive-debugging)
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`no-css-cache`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Bypass caching for CSS style properties
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`touchscreen`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Pretend the pointer is a touchscreen device
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`updates`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Visual feedback about window updates
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`resize`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Highlight resizing widgets
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`layout`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Show layout borders
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`snapshot`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Include debug render nodes in the generated snapshots
|
|
|
|
|
2020-05-24 04:04:36 +00:00
|
|
|
The special value `all` can be used to turn on all debug options.
|
|
|
|
The special value `help` can be used to obtain a list of all
|
|
|
|
supported debug options.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_PATH`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
Specifies a list of directories to search when GTK is looking for
|
|
|
|
dynamically loaded objects such as input method modules and print
|
|
|
|
backends. If the path to the dynamically loaded object is given as
|
|
|
|
an absolute path name, then GTK loads it directly. Otherwise, GTK
|
|
|
|
goes in turn through the directories in `GTK_PATH`, followed by
|
|
|
|
the directory `.gtk-4.0` in the user's home directory, followed
|
|
|
|
by the system default directory, which is `libdir/gtk-4.0/modules`.
|
|
|
|
(If `GTK_EXE_PREFIX` is defined, `libdir` is `$GTK_EXE_PREFIX/lib`.
|
|
|
|
Otherwise it is the libdir specified when GTK was configured, usually
|
|
|
|
`/usr/lib`, or `/usr/local/lib`.)
|
|
|
|
|
|
|
|
For each directory in this list, GTK actually looks in a subdirectory
|
|
|
|
`directory/version/host/type`. Where `version` is derived from the
|
|
|
|
version of GTK (use `pkg-config --variable=gtk_binary_version gtk4`
|
|
|
|
to determine this from a script), `host` is the architecture on
|
|
|
|
which GTK was built. (use `pkg-config --variable=gtk_host gtk4` to
|
|
|
|
determine this from a script), and `type` is a directory specific to
|
|
|
|
the type of modules; currently it can be `modules`, `immodules` or
|
|
|
|
`printbackends`, corresponding to the types of modules mentioned
|
|
|
|
above. Either `version`, `host`, or both may be omitted. GTK looks
|
|
|
|
first in the most specific directory, then in directories with
|
|
|
|
fewer components.
|
|
|
|
The components of `GTK_PATH` are separated by the ':' character on
|
|
|
|
Linux and Unix, and the ';' character on Windows.
|
|
|
|
|
|
|
|
Note that this environment variable is read by GTK 2.x and GTK 3.x
|
|
|
|
too, which makes it unsuitable for setting it system-wide (or
|
|
|
|
session-wide), since doing so will cause applications using
|
|
|
|
different GTK versions to see incompatible modules.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_IM_MODULE`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
Specifies an IM module to use in preference to the one determined
|
|
|
|
from the locale. If this isn't set and you are running on the system
|
|
|
|
that enables `XSETTINGS` and has a value in `Gtk/IMModule`, that will
|
|
|
|
be used for the default IM module. This also can be a colon-separated
|
|
|
|
list of input-methods, which GTK will try in turn until it finds one
|
|
|
|
available on the system.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_MEDIA`
|
2020-11-08 14:58:26 +00:00
|
|
|
|
2021-02-20 05:19:51 +00:00
|
|
|
Specifies what backend to load for [class@Gtk.MediaFile]. The possible values
|
2020-11-08 14:58:26 +00:00
|
|
|
depend on what options GTK was built with, and can include 'gstreamer',
|
|
|
|
'ffmpeg' and 'none'. If set to 'none', media playback will be unavailable.
|
|
|
|
The special value 'help' can be used to obtain a list of all supported
|
|
|
|
media backends.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_EXE_PREFIX`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
If set, GTK uses `$GTK_EXE_PREFIX/lib` instead of the libdir
|
|
|
|
configured when GTK was compiled.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_DATA_PREFIX`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
If set, GTK uses `$GTK_DATA_PREFIX` instead of the prefix
|
|
|
|
configured when GTK was compiled.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_THEME`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
If set, makes GTK use the named theme instead of the theme
|
|
|
|
that is specified by the gtk-theme-name setting. This is intended
|
|
|
|
mainly for easy debugging of theme issues.
|
|
|
|
|
|
|
|
It is also possible to specify a theme variant to load, by appending
|
|
|
|
the variant name with a colon, like this: `GTK_THEME=Adwaita:dark`.
|
|
|
|
|
|
|
|
The following environment variables are used by GdkPixbuf, GDK or
|
|
|
|
Pango, not by GTK itself, but we list them here for completeness
|
|
|
|
nevertheless.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GDK_PIXBUF_MODULE_FILE`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
Specifies the file listing the GdkPixbuf loader modules to load.
|
|
|
|
This environment variable overrides the default value
|
|
|
|
`libdir/gtk-4.0/4.0.0/loaders.cache` (`libdir` is the sysconfdir
|
|
|
|
specified when GTK was configured, usually `/usr/lib`.)
|
|
|
|
|
|
|
|
The `loaders.cache` file is generated by the
|
|
|
|
`gdk-pixbuf-query-loaders` utility.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GDK_DEBUG`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2020-11-14 07:49:17 +00:00
|
|
|
This variable can be set to a list of debug options, which cause GDK to
|
|
|
|
print out different types of debugging information. Some of these options
|
|
|
|
are only available when GTK has been configured with `-Ddebug=true`.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`cursor`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about cursor objects (only win32)
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`eventloop`
|
|
|
|
: Information about event loop operation (mostly macOS)
|
2021-02-20 05:19:51 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`misc`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Miscellaneous information
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`frames`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about the frame clock
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`settings`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about xsettings
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`selection`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about selections
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`clipboard`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about clipboards
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`dnd`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about drag-and-drop
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`opengl`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about OpenGL
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about Vulkan
|
|
|
|
|
2020-05-24 04:04:36 +00:00
|
|
|
A number of options affect behavior instead of logging:
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`nograbs`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Turn off all pointer and keyboard grabs
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl-disable`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Disable OpenGL support
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl-software`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Force OpenGL software rendering
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl-texture-rect`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Use the OpenGL texture rectangle extension, if available
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl-legacy`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Use a legacy OpenGL context
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl-gles`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Use a GLES OpenGL context
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan-disable`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Disable Vulkan support
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan-validate`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Load the Vulkan validation layer, if available
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
The special value `all` can be used to turn on all debug options. The special
|
|
|
|
value `help` can be used to obtain a list of all supported debug options.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GSK_DEBUG`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2020-11-14 07:49:17 +00:00
|
|
|
This variable can be set to a list of debug options, which cause GSK to
|
|
|
|
print out different types of debugging information. Some of these options
|
|
|
|
are only available when GTK has been configured with `-Ddebug=true`.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`renderer`
|
2021-02-20 05:19:51 +00:00
|
|
|
: General renderer information
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`cairo`
|
2021-02-20 05:19:51 +00:00
|
|
|
: cairo renderer information
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`opengl`
|
2021-02-20 05:19:51 +00:00
|
|
|
: OpenGL renderer information
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`shaders`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Shaders
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`surface`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Surfaces
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Vulkan renderer information
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`fallback`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about fallbacks
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`glyphcache`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Information about glyph caching
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-02-20 05:19:51 +00:00
|
|
|
A number of options affect behavior instead of logging:
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`diff`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Show differences
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`geometry`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Show borders
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`full-redraw`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Force full redraws for every frame
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`sync`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Sync after each frame
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan-staging-image`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Use a staging image for Vulkan texture upload
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan-staging-buffer`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Use a staging buffer for Vulkan texture upload
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
The special value `all` can be used to turn on all debug options. The special
|
|
|
|
value `help` can be used to obtain a list of all supported debug options.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GDK_BACKEND`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
If set, selects the GDK backend to use. Selecting a backend
|
|
|
|
requires that GTK is compiled with support for that backend.
|
|
|
|
The following backends can be selected, provided they are
|
|
|
|
included in the GDK libraries you are using:
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`quartz`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the native Quartz backend
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`win32`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the native backend for Microsoft Windows
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`x11`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the native backend for connecting to X11 servers
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`broadway`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the Broadway backend for display in web browsers
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`wayland`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the Wayland backend for connecting to Wayland compositors
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
This environment variable can contain a comma-separated list of
|
|
|
|
backend names, which are tried in order. The list may also contain
|
2021-03-08 17:58:14 +00:00
|
|
|
a `*`, which means: try all remaining backends. The special value
|
2020-05-24 04:04:36 +00:00
|
|
|
`help` can be used to make GDK print out a list of all available
|
|
|
|
backends. For more information about selecting backends,
|
2021-03-08 17:58:14 +00:00
|
|
|
see the [func@Gdk.DisplayManager.get] function.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GDK_VULKAN_DEVICE`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
This variable can be set to the index of a Vulkan device to override
|
|
|
|
the default selection of the device that is used for Vulkan rendering.
|
|
|
|
The special value `list` can be used to obtain a list of all Vulkan
|
|
|
|
devices.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GSK_RENDERER`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
If set, selects the GSK renderer to use. The following renderers can
|
|
|
|
be selected, provided they are included in the GTK library you are
|
|
|
|
using and the GDK backend supports them:
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`help`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Prints information about available options
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`broadway`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the Broadway-backend specific renderer
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`cairo`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the fallback Cairo renderer
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`gl`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the default OpenGL renderer
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`vulkan`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the Vulkan renderer
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_CSD`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
The default value of this environment variable is `1`. If changed
|
|
|
|
to `0`, this disables the default use of client-side decorations
|
2020-05-24 04:04:36 +00:00
|
|
|
on GTK windows, thus making the window manager responsible for
|
|
|
|
drawing the decorations of windows that do not have a custom
|
|
|
|
titlebar widget.
|
|
|
|
|
|
|
|
CSD is always used for windows with a custom titlebar widget set,
|
|
|
|
as the WM should not draw another titlebar or other decorations
|
|
|
|
around the custom one.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `GTK_A11Y`
|
2020-11-07 12:50:11 +00:00
|
|
|
|
|
|
|
If set, selects the accessibility backend to use. The following
|
|
|
|
backends can be selected, provided they are included in the GTK
|
|
|
|
library you are using:
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`help`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Prints information about available options
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`atspi`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the AT-SPI accessibility backend
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`test`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Selects the test backend
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
`none`
|
2021-02-20 05:19:51 +00:00
|
|
|
: Disables the accessibility backend
|
2020-11-07 12:50:11 +00:00
|
|
|
|
|
|
|
The `test` accessibility backend is recommended for test suites and remote
|
|
|
|
continuous integration pipelines.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `XDG_DTA_HOME`, `XDG_DATA_DIRS`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
GTK uses these environment variables to locate icon themes
|
|
|
|
and MIME information. For more information, see the
|
|
|
|
[Icon Theme Specification](https://freedesktop.org/Standards/icon-theme-spec)
|
|
|
|
the [Shared MIME-Info Database](https://freedesktop.org/Standards/shared-mime-info-spec)
|
|
|
|
and the [Base Directory Specification](https://freedesktop.org/Standards/basedir-spec).
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
### `DESKTOP_STARTUP_ID`
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
GTK uses this environment variable to provide startup notification
|
|
|
|
according to the [Startup Notification Spec](https://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt).
|
|
|
|
Following the specification, GTK unsets this variable after reading
|
|
|
|
it (to keep it from leaking to child processes). So, if you need its
|
|
|
|
value for your own purposes, you have to read it before calling
|
2021-03-08 17:58:14 +00:00
|
|
|
[func@Gtk.init].
|
2020-05-24 04:04:36 +00:00
|
|
|
|
2021-02-20 05:19:51 +00:00
|
|
|
## Interactive debugging
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
![The inspector](inspector.png)
|
|
|
|
|
|
|
|
GTK includes an interactive debugger, called the GTK Inspector, which
|
|
|
|
lets you explore the widget tree of any GTK application at runtime,
|
|
|
|
as well as tweak the theme and trigger visual debugging aids. You can
|
|
|
|
easily try out changes at runtime before putting them into the code.
|
|
|
|
|
|
|
|
Note that the GTK inspector can only show GTK internals. It can not
|
|
|
|
understand the application-specific logic of a GTK application. Also,
|
|
|
|
the fact that the GTK inspector is running in the application process
|
|
|
|
limits what it can do. It is meant as a complement to full-blown
|
|
|
|
debuggers and system tracing facilities such as DTrace, not as a
|
|
|
|
replacement.
|
|
|
|
|
2021-03-08 17:58:14 +00:00
|
|
|
To enable the GTK inspector, you can use the <kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> or
|
|
|
|
<kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> keyboard shortcuts, or
|
|
|
|
set the `GTK_DEBUG=interactive` environment variable.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
There are a few more environment variables that can be set to influence
|
|
|
|
how the inspector renders its UI. `GTK_INSPECTOR_DISPLAY` and
|
|
|
|
`GTK_INSPECTOR_RENDERER` determine the GDK display and the GSK
|
|
|
|
renderer that the inspector is using.
|
|
|
|
|
|
|
|
In some situations, it may be inappropriate to give users access to
|
|
|
|
the GTK inspector. The keyboard shortcuts can be disabled with the
|
|
|
|
`enable-inspector-keybinding` key in the `org.gtk.Settings.Debug`
|
|
|
|
GSettings schema.
|
|
|
|
|
2021-02-20 05:19:51 +00:00
|
|
|
## Profiling
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
GTK supports profiling with sysprof. It exports timing information
|
2020-08-20 21:46:53 +00:00
|
|
|
about frameclock phases and various characteristics of GskRenderers
|
2020-05-24 04:04:36 +00:00
|
|
|
in a format that can be displayed by sysprof or GNOME Builder.
|
|
|
|
|
2020-08-20 21:46:53 +00:00
|
|
|
A simple way to capture data is to run your application under the
|
|
|
|
`sysprof-cli` wrapper, which will write profiling data to a file
|
|
|
|
called `capture.syscap`.
|
2020-05-24 04:04:36 +00:00
|
|
|
|
|
|
|
When launching the application from sysprof, it will set the
|
|
|
|
`SYSPROF_TRACE_FD` environment variable to point GTK at a file
|
|
|
|
descriptor to write profiling data to.
|