gtk/gdk
Carlos Garnacho c24358cfbc gdk/x11: Clear all data in GdkSurfaceX11 finalization
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.
2022-12-07 13:16:36 +01:00
..
broadway Drop redundant glib version checks 2022-11-17 22:49:56 -05:00
loaders gdk: Fix possible memory errors 2022-11-18 00:04:23 -05:00
macos gdk: Rename GDK_SURFACE_TEMP 2022-11-17 22:49:56 -05:00
wayland gdk/wayland: Improve readability of wl_output binding code 2022-11-23 22:53:00 +02:00
win32 gdk: Rename GDK_SURFACE_TEMP 2022-11-17 22:49:56 -05:00
x11 gdk/x11: Clear all data in GdkSurfaceX11 finalization 2022-12-07 13:16:36 +01:00
COPYING
default_cursor.png gdk: Include a default cursor as resource 2020-04-26 14:41:52 -04:00
filetransferportal.c portal: Use the right mimetype for file transfers 2022-09-15 15:18:17 -04:00
filetransferportalprivate.h Tweak the file transfer portal _again_ 2020-01-17 23:46:37 -05:00
gdk.c gdk: Clean up gdkprivate.h 2022-11-17 22:49:56 -05:00
gdk.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkapplaunchcontext.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkapplaunchcontext.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkapplaunchcontextprivate.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkarrayimpl.c gdkarray: Add a "stolen" boolean to splice() 2020-12-24 06:38:45 +01:00
gdkcairo.c cairo: Use GdkTexture for converting from pixbuf 2021-10-06 22:50:07 +02:00
gdkcairo.h gdk: Deprecate gdk_cairo_draw_from_gl() 2021-09-12 05:54:37 +02:00
gdkcairocontext.c gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
gdkcairocontext.h Use a single compilation symbol 2019-11-27 13:33:43 +00:00
gdkcairocontextprivate.h
gdkcairoprivate.h gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
gdkclipboard.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkclipboard.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkclipboardprivate.h gdk: Change some async clipboard api 2019-04-02 15:10:53 +00:00
gdkconfig.h.meson gdk: Cosmetics 2022-10-05 23:01:28 -04:00
gdkconfig.h.win32 Use a single compilation symbol 2019-11-27 13:33:43 +00:00
gdkconfig.h.win32_vulkan Use a single compilation symbol 2019-11-27 13:33:43 +00:00
gdkconstructorprivate.h Rename gdkconstructor.h to gdkconstructorprivate.h 2022-09-23 23:14:08 -04:00
gdkcontentdeserializer.c Add more names to sources 2022-09-28 12:37:21 -04:00
gdkcontentdeserializer.h gdk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gdkcontentformats.c Add constructors for GdkFileList 2022-07-28 14:41:35 +01:00
gdkcontentformats.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkcontentformatsprivate.h
gdkcontentprovider.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkcontentprovider.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkcontentproviderimpl.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkcontentproviderimpl.h Remove gdk_content_provider_new_with_formats() 2020-02-18 02:40:00 +01:00
gdkcontentproviderprivate.h
gdkcontentserializer.c gdkcontentserializer: Use newlines for file separators 2022-10-10 13:27:07 -07:00
gdkcontentserializer.h gdk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gdkcursor.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkcursor.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkcursorprivate.h
gdkdebugprivate.h gdk: Clean up gdkprivate.h 2022-11-17 22:49:56 -05:00
gdkdevice.c Fix spelling errors 2022-11-17 22:49:45 -05:00
gdkdevice.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdevicepad.c gdk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gdkdevicepad.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkdevicepadprivate.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkdeviceprivate.h gdk: Clean up gdkprivate.h 2022-11-17 22:49:56 -05:00
gdkdevicetool.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdevicetool.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdkdevicetoolprivate.h
gdkdisplay.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdisplay.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdisplaymanager.c Fix spelling errors 2022-11-17 22:49:45 -05:00
gdkdisplaymanager.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdisplaymanagerprivate.h
gdkdisplayprivate.h gdk: Clean up gdkprivate.h 2022-11-17 22:49:56 -05:00
gdkdrag.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdrag.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdragprivate.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkdragsurface.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdragsurface.h Annotation fixes 2020-04-03 15:30:56 +01:00
gdkdragsurfaceprivate.h Add a GdkDragSurface interface 2020-03-12 14:56:21 -04:00
gdkdrawcontext.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdrawcontext.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdrawcontextprivate.h gdk: hdr => high depth 2021-10-06 22:50:07 +02:00
gdkdrop.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkdrop.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkdropprivate.h gdk: Make gdk_drop_status() take preferred action 2020-03-02 04:43:56 +01:00
gdkenums.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdkevents.c Fix spelling errors 2022-11-17 22:49:45 -05:00
gdkevents.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkeventsprivate.h Use native Windows API for converting keystrokes to characters 2022-10-17 19:36:48 +02:00
gdkframeclock.c gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
gdkframeclock.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkframeclockidle.c Add more names to sources 2022-09-28 12:37:21 -04:00
gdkframeclockidleprivate.h
gdkframeclockprivate.h gdk/frame-clock: Remove the newly added 'compute-size' phase 2020-12-07 09:46:39 +01:00
gdkframetimings.c docs: Rework the gdk docs 2021-03-11 16:37:31 +00:00
gdkframetimings.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkgl.c gdk: Remove unused gdk_gl_texture_quads() function 2021-10-06 03:44:36 +02:00
gdkglcontext.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkglcontext.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkglcontextprivate.h Merge branch 'gl-api-es-fix' into 'main' 2022-06-04 20:26:58 +00:00
gdkglobals.c gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
gdkgltexture.c gdk/gl: handle GL_RGBA/GL_UNSIGNED_NORMALIZED 2022-03-24 18:05:11 -07:00
gdkgltexture.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkgltextureprivate.h
gdkhsla.c gdk_rgba_parse: Support HSL colors 2021-09-10 16:56:42 -05:00
gdkhslaprivate.h gdk: Remove gdk.h include from header 2021-09-24 22:11:57 +02:00
gdkkeys.c gdk: Tweaks to keyname handling 2022-09-24 10:03:37 -04:00
gdkkeys.h Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
gdkkeysprivate.h gdk: Drop an unused function 2022-07-16 09:43:46 -04:00
gdkkeysyms-update.pl Update the link to the development branch 2022-01-13 14:42:34 +00:00
gdkkeysyms.h Update the link to the development branch 2022-01-13 14:42:34 +00:00
gdkkeyuni.c gdk: Update keyboard symbols from libxkbcommon 2022-01-29 14:31:09 +02:00
gdkmarshalers.list surface: add missing va_marshaller for layout signal 2021-12-07 22:21:19 -08:00
gdkmemoryformat.c gdk: Add a rgb8 → rgba8 conversion macro 2022-03-03 16:05:52 +01:00
gdkmemoryformatprivate.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdkmemorytexture.c Fixes for gdk_memory_texture_new_subtexture 2022-05-13 09:30:46 -04:00
gdkmemorytexture.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdkmemorytextureprivate.h gl: Refactor texture uploading 2021-10-13 14:33:44 +02:00
gdkmonitor.c Remove all nicks and blurbs from param specs 2022-05-11 18:16:29 +02:00
gdkmonitor.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkmonitorprivate.h gdk/monitor: Remove gdk_monitor_work_area and GdkMonitor::work-area 2020-07-29 17:57:30 +02:00
gdkpaintable.c Rename gdk-private.h to gdkprivate.h 2022-09-23 23:23:27 -04:00
gdkpaintable.h docs: Fix vfunc references 2021-08-29 04:29:02 +02:00
gdkpango.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkpango.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkpipeiostream.c gdk: Plug a memleak 2022-08-19 02:38:11 +02:00
gdkpipeiostreamprivate.h
gdkpixbuf.c gdk: Rename gdkpixbuf-drawable.c 2022-09-24 10:03:37 -04:00
gdkpixbuf.h Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
gdkpopup.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkpopup.h docs: Rework the gdk docs 2021-03-11 16:37:31 +00:00
gdkpopuplayout.c docs: More syntax fixes 2021-05-22 21:21:10 -04:00
gdkpopuplayout.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkpopupprivate.h Introduce GdkPopup 2020-03-11 19:35:55 -04:00
gdkprivate.h Drop redundant glib version checks 2022-11-17 22:49:56 -05:00
gdkprofiler.c Port tracing to the sysprof collector api 2020-08-21 10:55:01 -04:00
gdkprofilerprivate.h profiler: allow using gdk profiler functions without braces 2021-02-08 11:29:32 -08:00
gdkrectangle.c gdk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gdkrectangle.h Use a single compilation symbol 2019-11-27 13:33:43 +00:00
gdkrgba.c docs: standard names are CSS names, not X11 names 2021-10-27 22:12:58 +00:00
gdkrgba.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkrgbaprivate.h rgba: Fix GDK_RGBA() macro to work with alpha 2022-02-08 01:34:19 +01:00
gdkseat.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkseat.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkseatdefault.c gdk/x11: Implement XI2.4 touchpad gesture support 2021-09-27 23:19:33 +03:00
gdkseatdefaultprivate.h Rename master and slave device 2020-06-18 19:22:20 +01:00
gdkseatprivate.h seat: improve api to take into account the tool type 2021-01-07 12:50:48 +01:00
gdksnapshot.c docs: Rework the gdk docs 2021-03-11 16:37:31 +00:00
gdksnapshot.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdksnapshotprivate.h
gdksurface.c gdksurface: Do not consider GDK_TOUCH_END/CANCEL as popup-dismiss worthy 2022-11-18 17:56:14 +01:00
gdksurface.h gdk: Always get shadow width via GdkToplevelSize 2020-12-07 09:46:39 +01:00
gdksurfaceprivate.h gdk: Clean up gdkprivate.h 2022-11-17 22:49:56 -05:00
gdktexture.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdktexture.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdktextureprivate.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdktoplevel.c Add gdk_toplevel_export_handle 2022-11-09 16:28:29 +01:00
gdktoplevel.h g-i: add missing since annotations 2021-11-13 17:50:53 +01:00
gdktoplevellayout.c gdk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gdktoplevellayout.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdktoplevelprivate.h Add gdk_toplevel_export_handle 2022-11-09 16:28:29 +01:00
gdktoplevelsize.c toplevel-size: Report zero bounds as infinite 2022-09-30 09:31:40 +02:00
gdktoplevelsize.h docs: Remove duplicate documentation stanzas 2021-03-11 16:37:31 +00:00
gdktoplevelsizeprivate.h gdk/toplevelsize: Rename 'margin' to 'shadow' and 'shadow_width' 2020-12-07 20:37:29 +01:00
gdktypes.h gdk: Split enums from types 2021-10-26 20:59:37 +02:00
gdkversionmacros.h.in Add 4.10 version macros 2022-09-28 13:30:01 -04:00
gdkvulkancontext.c Drop gdkintl.h 2022-09-23 23:33:42 -04:00
gdkvulkancontext.h gdk: Dissolve gdk-autocleanup.h 2022-09-23 19:49:58 -04:00
gdkvulkancontextprivate.h Rename gdkdebug.h to gdkdebugprivate.h 2022-09-23 23:12:01 -04:00
gen-gdk-gresources-xml.py gdk: Remove unused gdk_gl_texture_quads() function 2021-10-06 03:44:36 +02:00
gen-keyname-table.pl gdk: Tweaks to keyname handling 2022-09-24 10:03:37 -04:00
keynames-translate.txt
keynames.txt
keynamesprivate.h gdk: Tweaks to keyname handling 2022-09-24 10:03:37 -04:00
meson.build gdk: Cosmetics 2022-10-05 23:01:28 -04:00