Commit Graph

345 Commits

Author SHA1 Message Date
Matthias Clasen
4aabc45685 Drop gdkintl.h
This header was merely including gi18n-lib.h.
Just do that directly.
2022-09-23 23:33:42 -04:00
Matthias Clasen
a8af7caae1 Rename gdk-private.h to gdkprivate.h
The extra - does not add any value.
2022-09-23 23:23:27 -04:00
Matthias Clasen
7d2c296357 Rename gdkconstructor.h to gdkconstructorprivate.h
This is the naming convention for private headers.
2022-09-23 23:14:08 -04:00
Matthias Clasen
c24a69549d Rename gdkdebug.h to gdkdebugprivate.h
This is the naming convention for private headers.
2022-09-23 23:12:01 -04:00
Matthias Clasen
10255eee72 Introduce new debug macros
Introduce GDK_DISPLAY_DEBUG() and GDK_DEBUG() and
the helper function gdk_debug_message(). This is
meant to clean up the mess of our current debug
statements which wildly mix g_message, g_print
and g_printerr.
2022-09-23 18:11:48 -04:00
Matthias Clasen
c7a7e550dc Only print supported debug flags
It is a bit disorienting to print a lot of unavailable
debug flags, with some working ones mixed in. Just show
the ones that work.
2022-09-21 21:51:58 -04:00
Matthias Clasen
55ab99cb98 Make GL flavor flags always available
No need to restrict this to debug builds.
2022-09-21 21:29:34 -04:00
Matthias Clasen
f50b0a0bcb Make the gl-debug debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:17:16 -04:00
Matthias Clasen
01054c9c79 Make the gl-gles debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:12:22 -04:00
Matthias Clasen
8bd3ec2ba1 Make the gl-legacy debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:09:08 -04:00
Matthias Clasen
e08a9ea9ad Drop the gl-texture-rect debug flag
This was not doing anything.
2022-09-21 21:05:25 -04:00
Matthias Clasen
1987398ec5 Drop the software-gl debug flag
This was not doing anything.
2022-09-21 21:03:40 -04:00
Matthias Clasen
fa0fc9acb8 Make the gl-disable flag always available
No need to restrict this to debug builds.
2022-09-21 20:57:22 -04:00
Matthias Clasen
fa1c461c13 Make the portals debug flag always available
No need to restrict this to debug builds.
2022-09-21 20:55:46 -04:00
Matthias Clasen
a99b05525d Make the nograbs flag always available
No need to restrict this to debug builds.
2022-09-21 20:53:46 -04:00
Matthias Clasen
a337b21a4f Make vulkan-disable always available
There is no need to restrict this to debug builds.
2022-09-21 20:51:35 -04:00
Matthias Clasen
1b96828667 Make vulkan-validate always available
There is no need to restrict this debug builds.
2022-09-21 20:49:53 -04:00
Benjamin Otte
813dd0a674 gdk: Replace GTK_USE_PORTAL env var with GDK_DEBUG flag
It's a debug flag, so make it clear that it is one.

Related: Clowns on the Arch wiki on
https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications#Consistent_file_dialog
2022-06-24 03:14:50 +02:00
Benjamin Otte
f584d4f500 gl: Check allowed APIs in realize()
Add gdk_gl_context_is_api_allowed() for backends and make them use it.

Finally, have them return the final API as the return value (or 0 on
error).

And then use that api instead of a use_es boolean flag.

Fixes #4221
2021-10-08 03:31:07 +02:00
Benjamin Otte
dc6e831524 gdk: hdr => high depth
The term "hdr" is so overloaded, we shouldn't use them anywhere, except
from maybe describing all of this work in blog posts and other marketing
materials.

So do renames:
* hdr => high_depth
* request_hdr => prefers_high_depth

This more accurately describes what is going on.
2021-10-06 22:50:07 +02:00
Benjamin Otte
5eb42dd9f3 gdk: Add GDK_DEBUG=hdr
Forces request_hdr = TRUE for all requests.

Backends should also use this when choosing whether to honor HDR
requests for low quality compositors - as long as the compositor
pretends to support HDR, shovel HDR at it.
2021-10-06 03:44:59 +02:00
Benjamin Otte
38461ee204 gdk: Make GDK_DEBUG GL backend selection global
We have a global GdkGLBackendType now, just set it.

This way, using the variable forces the backend type, and we don't need
special code handling the env vars in the backends.

It also means setting the env var will now "work" on GDK backends that
don't even support that GL backend and simualte another GDK backend
having registered that GL backend already. So you can run
  GDK_DEBUG=gl-wgl gtk4-demo
on test what Wayland will do when WGL is in use.
2021-10-05 04:48:15 +02:00
Benjamin Otte
a29474567a gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
Matthias Clasen
a4f067481c gdk: Make GDK_DEBUG=default-settings unconditional
Our tests use this settings, so we should respect it
in non-debug builds as well.
2021-08-30 11:01:55 -04:00
Matthias Clasen
19b534f7de Avoid copying static debug strings
The g_source_set_name calls were showing up as a
major source of strdups in our profiles. Avoid that
by using new GLib api when available.
2021-07-28 22:42:46 -04:00
Chun-wei Fan
969b3257a7 GDK: Add debug option for WGL usage
This way, one can force using WGL on Windows even if EGL support was
enabled.  Also update the help text for gl-egl as it will apply for
Windows, albeit a bit later.
2021-07-22 16:28:16 +02:00
Benjamin Otte
5a3b4de1b7 x11: Redo choice between EGL and GLX
We try EGL first, but are very picky about what we accept.
If that fails, we try to go with GLX instead.
And if that also fails, we try EGL again, but this time accept anything.

The idea here is that EGL is the preferred method going forward, but GLX is
the tried and tested method that we know works. So if we detect issues with
EGL, we want to avoid using it in favor of GLX.

Also add a GDK_DEBUG=gl-egl option to force EGL at all costs and not try
GLX.
2021-07-22 16:23:56 +02:00
Matthias Clasen
effc7a619d Docs: Tweaks
Remove some more redundant "or NULL" blurbs.
2021-06-05 17:38:23 -04:00
Matthias Clasen
6cb4dda5d6 gdk: Cosmetic docs changes 2021-05-22 17:25:26 -04:00
Matthias Clasen
fff2b3c710 gdk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Emmanuele Bassi
6600b0b507 x11: Add debug toggle for preferring GLX
Mostly as a way to compare the EGL and GLX implementations.
2021-05-10 20:44:35 +01:00
Emmanuele Bassi
6f93e63d21 docs: Move detached sections into their own content file 2021-03-11 16:37:30 +00:00
Matthias Clasen
0eba833595 gdk: Remove a redundant check
We already know desktop_notification_id is not NULL.

Pointed out in https://www.viva64.com/en/b/0793/
2021-02-04 00:29:51 -05:00
Christoph Reiter
afc73c38ce Always parse GTK/GDK/GSK_DEBUG env vars and make some entries available in non-debug mode
Currently GTK can be built with G_ENABLE_DEBUG which enables various debug code and parsing
of those env vars, or without, which instead of parsing them prints a warning if they are set.
While building with G_ENABLE_DEBUG isn't strictly needed it's the only way to make GTK_DEBUG=interactive work,
which is a nice thing to have always.

This enables parsing of those env vars in any case and allows specific values being marked as also
available when not built with G_ENABLE_DEBUG (interactive for example). If not built with G_ENABLE_DEBUG
then all unavailable values will be marked as such in the help output and a note is added that
GTK needs to be built with G_ENABLE_DEBUG to use them, which should help discoverability.
2020-11-15 11:34:54 +01:00
Matthias Clasen
3617fbab42 docs: Include GDK_WINDOWING_MACOS
We no longer have a Quartz backend, it is called
MacOS now.
2020-10-29 14:23:46 -04:00
Matthias Clasen
214c35ffc7 gdk: Docs tweaks
We don't have library initialization api anymore,
update the section title to reflect that.
2020-10-06 07:58:01 -04:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Matthias Clasen
1d7b273669 docs: Clean up dangling links in gdk docs
Clean up references to no-longer-existing APIs.
2020-08-05 15:45:43 -04:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Matthias Clasen
9f2926dde3 gdk: Better help for GDK_DEBUG
Include docstrings and format the list of supported
values better.

Also, add the same warning we have for GTK_DEBUG when
the environment variable is ignored.
2020-06-28 13:42:02 -04:00
Matthias Clasen
c47553e319 gdk: Drop no-longer-used documentation
Thread support is gone, and we don't have that
section in the docs anymore.
2020-05-26 20:52:41 -04:00
Alexander Larsson
a3be0ec5f0 Don't use xsettings or xft defaults in testsuite
This adds a GDK_DEBUG=default-settings flag which disables reads
from xsettings and Xft resources, and enables this for the testsuite.

This is one less way to get different testresults depending on the
environment. In particular, it was failing the css tests for me
due to getting the wrong font size because i have a different dpi.
2020-02-03 15:11:35 +01:00
Matthias Clasen
05b98c3834 gdk: Make profiler support unconditional
We are still not providing samples unless debugging is enabled.
That needs a bit more work.
2020-01-21 11:50:12 -05:00
Christian Hergert
3a0beeadc5 profiler: port GdkProfiler to sysprof-3
This uses the new sysprof-3 ABI to implement the capture writer. It also
uses the statically linked libsysprof-capture-3.a that is provided with
Sysprof for the capture writing to ensure that we do not leak any symbols
nor depend on any additional libraries.

The GTK_TRACE_FD can be used to pass a FD for tracing into Gtk. Sysprof
uses this when the Gtk instrument is selected for recording.
2019-05-29 19:02:30 -07:00
Matthias Clasen
9e40642335 Add a way to start the profiler
If SYSPROF_TRACE_FD is set in the environment,
interpret it as an fd to write profiling data
to.

If GTK_TRACE is set, write profiling data
to a file with name gtk.$PID.syscap.
2019-05-07 09:37:59 -07:00
Alexander Larsson
249f6a85b3 gdkglcontext: Only emit opengl debug calls if GDK_DEBUG=gl-debug
This avoids a potential performance cost in the non-debug case.
2019-04-25 11:36:23 +02:00
Carlos Garnacho
65d9b7ee86 gdk: Include copy of glib/gconstructor.h
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
2019-03-17 21:29:59 +01:00
Matthias Clasen
d773bc0689 docs: Its just GTK now
Remove the + from GTK+ in the GDK docs.
2019-02-24 10:49:01 -05:00
Matthias Clasen
08badd23cd Drop some dead code
There were some internal uses of GdkEventFunc. Thankfully,
they were unused, so lets just drop them.
2019-02-23 14:13:57 -05:00