Commit Graph

8676 Commits

Author SHA1 Message Date
Matthias Clasen
71cc68b14b surface: fix up docs
The docs for gdk_surface_invalidate_region were
talking about a no-longer-existing argument.
2019-05-26 00:07:47 -04:00
Matthias Clasen
c50052e223 Revert "wayland: Keep some resources until destroy"
This reverts commit f2d598b9a1.
2019-05-25 18:08:43 +00:00
Matthias Clasen
beedec1904 broadway: add frame times to the profiler 2019-05-24 07:19:14 -04:00
Olivier Fourdan
713fceb1bd wayland: Use scale from core wl_output protocol
The “xdg-output” protocol provides clients with the outputs size and
position in compositor coordinates, and does not provide the output
scale which is already provided by the core “wl_output” protocol.

So when receiving the wl_output scale event, we should update the scale
regardless of “xdg-output” support, otherwise the scale will remain to
its default value of 1 and the surface will be scaled up by the
compositor to match the actual output scale, which causes blurry fonts
and widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1901
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2019-05-22 12:22:36 +02:00
Federico Mena Quintero
2a9b3c6a0c Use g_once for all the mkenums template files
Without this, initialization of enum/flags values from multithreaded
programs may not work correctly.

Fixes #1617.
2019-05-21 10:32:08 -05:00
Benjamin Otte
143bba075f win32: Remove outdated workaround
The function that was missing in 2016 does exist now.

Fixes gcc complaining about a wrong declaration.
2019-05-21 07:33:57 +02:00
Benjamin Otte
0877b29e8e win32: Actually pass y variable for y parameter 2019-05-21 07:23:30 +02:00
Benjamin Otte
1793546d7a win32: Remove unused variables 2019-05-21 07:23:30 +02:00
Benjamin Otte
678aa8088f rgba: Add GDK_RGBA() macro
So far it's private, but it's a pretty cute way to use hex colors, so we
might conside making it public.
2019-05-21 06:43:59 +02:00
Matthias Clasen
0a217cdd39 x11: Remove to unused settings
We no longer have settings for gtk-button-images
or gtk-menu-images.
2019-05-19 17:12:37 -04:00
Matthias Clasen
54530334f4 Revert "wayland: Make popups work more than once"
This reverts commit e74c655016.
2019-05-19 16:50:49 +00:00
Matthias Clasen
eed37cd59a Cosmetic changes
Use new-style padding for GdkContentProviderClass.
2019-05-19 16:20:15 +00:00
Matthias Clasen
d4f6bfbdad Merge branch 'frame-pixel-counter' into 'master'
profiling: Add a counter for pixels drawn per frame

See merge request GNOME/gtk!855
2019-05-19 15:20:52 +00:00
Matthias Clasen
e74c655016 wayland: Make popups work more than once
The change to keep some server resources around
until destroy was causing us to not recreate
the right things when a surface is hidden and
then shown again. Make sure to recreate everything.
2019-05-19 04:43:16 +00:00
Matthias Clasen
f2d598b9a1 wayland: Keep some resources until destroy
The Wayland backend was dropping _all_ serverside
resources on hide, which is too early e.g. for
GtkGLArea which wants to use egl resources to
unload textures on unrealize.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1485
2019-05-18 19:15:47 +00:00
Matthias Clasen
6c9d50a013 profiling: Add a counter for pixels drawn per frame
This number clearly shows the recently discovered
"full redraws" problem.
2019-05-18 18:04:35 +00:00
Benjamin Otte
6e2df85ec8 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #1900

See merge request GNOME/gtk!854
2019-05-18 15:19:29 +00:00
Benjamin Otte
b76eb96c58 glcontext: Store the updated area in the right place
We need to store the region *before* adding our own damage area, because
we want to only store the changes of this frame, not the whole history.

So do it in the same place Vulkan does it.

Fixes #1900
2019-05-18 17:06:08 +02:00
Matthias Clasen
7e59ec4afc Add clock freezes to the profile 2019-05-16 20:50:31 +00:00
Matthias Clasen
15fec034df always record a frame end time when profiling
We need to keep this time, or we may end up with
negative frame intervals.
2019-05-16 19:45:30 +00:00
Matthias Clasen
33ffd54d5f Redo frame profiling
We were adding incomplete frame timings to the
profile, which lead to occasional nonsense
numbers. Instead, only add timings to the profile
once we marked them as complete. This also
gives us an opportunity to add the presentation
time as a marker.
2019-05-16 19:08:34 +00:00
Matthias Clasen
45b552d146 profiler: Prefer CLOCK_MONOTONIC
This is what g_get_monotonic_time gives us,
after all, and we need to have the same clock
in all our profiler data.
2019-05-15 13:52:12 -04:00
Carlos Garnacho
58cfafdf04 gdk/x11: Remove XI1 remnant
This header is not referenced anywhere.
2019-05-15 01:10:08 +02:00
Carlos Garnacho
c2d92794e2 gdk/x11: Drop GdkDeviceManagerCore
Keep only the XInput2 device manager, which handles "modern" stuff
like scroll and touch.
2019-05-15 01:05:29 +02:00
Carlos Garnacho
33642e2255 gdk/x11: Make XInput2 a mandatory runtime dependency for x11
Besides requiring it at build time, require that the server the client
is running against exposes the XInput2 protocol. We no longer fallback
on a device manager for core events.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
c4446d36de gdk/x11: Drop GDK_CORE_DEVICE_EVENTS environment variable
Support for core events will be discontinued, so this doesn't make sense
anymore.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
c4cf72ecb8 gdk/x11: Remove gdk_disable_multidevice()
Core events will be discontinued, so this call is meaningless now.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
f3250172a4 gdk/x11: Make XInput2 a mandatory build time dependency for x11
XInput2 is more than a decade old already, and the input improvements
there (and in every other backend really) make it untenable to have
support for X11 core input events dragging things behind.
2019-05-15 01:05:20 +02:00
Matthias Clasen
ebc6bd834b profiling: Only use frame timings when we have them
Christian Hergert reported a crash here,
when testing the profiling code.
2019-05-14 12:06:55 +00:00
Matthias Clasen
b3ff4154ec Drop the public profiler api
I meant to do this before merging the profiler
support. Somehow the commit got lost.
2019-05-08 17:00:26 +00:00
Matthias Clasen
879a0c118d Profiler: drop the public api 2019-05-08 16:57:34 +00:00
Chun-wei Fan
705bf48eed gdk/gdkprofiler.c: Don't include unistd.h unconditionally
unistd.h is not universally available, so only include it when it can be
found during the configure stage.
2019-05-07 17:58:14 -07:00
Sebastian Dröge
2bd6661cd3 GdkSurface - Don't call unimplemented NULL set_startup_id() vfunc on Win32
GdkSurface::set_startup_id() is NULL on Win32 and would cause a segfault
if called.

While the documentation of the main caller of set_startup_id(),
gtk_window_set_startup_id(), mentions that it's not implemented on
Windows it can still be automatically called via Glade and simply doing
nothing on Win32 is going to be less disruptive than a segfault.
2019-05-07 21:38:46 +03:00
Matthias Clasen
1660bac6bd frame clock: Add tracing
Emit tracing data for frames. For now, we emit the
entire frame, and the layout and paint phases. Also
emit frames-per-second.
2019-05-07 09:37:59 -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
Matthias Clasen
032bb45ce3 gdk: Add a profiler
This is writing data in the capture format of sysprof,
using the SpCaptureWriter. For now, this is using a
vendored copy of libsysprof. Eventually, we want to
use the static library that sysprof provides.
2019-05-07 09:37:59 -07:00
Benjamin Otte
e29cf84ac4 broadway: Install headers
How are we going to check a display for its broadway-ness otherwise?
2019-05-06 20:15:49 +02:00
Benjamin Otte
7ae675b469 build: Install the backend headers in the backend directories
That's where they are in the sources and we include them from other
headers. So make sure the directories match.
2019-05-06 20:14:53 +02:00
Matthias Clasen
f6225901e8 gdk: Documentation improvements
Document some new x11 symbols.
2019-05-02 02:39:36 +00:00
Matthias Clasen
737400ddbc wayland: sanity check events at the source
Sanity check events before we throw them into
the event queue, as this makes it much easier
to track down the culprit.
2019-05-01 20:51:43 +00:00
Matthias Clasen
134e159bc9 gdk: add a sanity check for events
Before delivering events to GTK, make sure
they're sane. For now, this means making sure
the surface and device are from the same
display.
2019-05-01 20:50:24 +00:00
Matthias Clasen
6f0b47681b seat: Add a sanity check
apis that takes multiple display-relative objects
should make sure that they are all from the same
display, or hard-to-track-down badness will happen
later on.

Add such a check for the surface and device arguments
of gdk_seat_grab. This helped in tracking down
critical warnings from combo boxes in the inspector.
2019-05-01 20:46:02 +00:00
Rico Tzschichholz
724ec3ca92 Add a few placeholder documentation block to have g-i annotations 2019-05-01 15:03:16 +02:00
Matthias Clasen
5b8f1aa2ee Merge branch 'xdg-output' into 'master'
[gtk4] wayland: Add support for xdg-output

Closes #1828

See merge request GNOME/gtk!751
2019-05-01 03:34:56 +00:00
Samuel Thibault
99eee5cea9 Revert "gdk: deactivate/activate surface on keyboard grabs"
This reverts commits 35417a5a74 and
01455399e8.

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-04-30 16:48:16 +02:00
Chun-wei Fan
efed2641f4 Merge branch 'fix-win32-gl-resize' into 'master'
Fix win32 gl resize

See merge request GNOME/gtk!694
2019-04-30 03:35:16 +00:00
Matthias Clasen
24fa104b61 surface: Add a frame-clock property
Now that GdkSurface has properties, it makes
sense to turn the frame clock into one too.

This will make it easier to reshuffle some
of the surface constructors later.
2019-04-29 15:11:58 -04:00
Jonas Ådahl
5f8543fe81 wayland: Only check top-most for grabbing popups
Non-grabbing popups are not limited to a single
nesting stack, as per the spec, so we should not
prevent that on the client-side.
2019-04-29 16:00:53 +00:00
Matthias Clasen
aae7816557 wayland: Reshuffle some internals
Make find_grab_input_seat return a GdkWaylandSeat
instead of a struct wl_seat, so we can use it and
avoid calling gdk_display_get_default_seat when
we need to get a serial later.
2019-04-29 16:00:09 +00:00
Timm Bäder
6f3e608331 gdkglcontext: Limit gl debug label length
There's a maximum length we have to adhere to, otherwise GL throws a
GL_INVALID_VALUE error.
2019-04-27 10:44:23 +02:00