From 854910cc1797d630e5a53cacd4d120405e1876c9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2024 08:59:36 -0500 Subject: [PATCH 1/5] gdk: Make a warning more useful We can just print out what is missing where, instead of a riddle. --- gdk/gdkdrawcontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 73a546f03c..75f143706a 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -71,7 +71,7 @@ gdk_draw_context_default_surface_resized (GdkDrawContext *context) static void gdk_draw_context_default_empty_frame (GdkDrawContext *context) { - g_warning ("FIXME: Implement"); + g_warning ("FIXME: Implement GdkDrawContext.empty_frame in %s", G_OBJECT_TYPE_NAME (context)); } static void From 3f513f3cc7a5648400f444fb3a03d825cea4dc18 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2024 08:59:04 -0500 Subject: [PATCH 2/5] x11: Add a forgotten empty_frame implementation This was causing warnings when using GLX. --- gdk/x11/gdkglcontext-x11.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index d225b79b7c..e6120e9c7b 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -39,9 +39,17 @@ G_DEFINE_ABSTRACT_TYPE (GdkX11GLContext, gdk_x11_gl_context, GDK_TYPE_GL_CONTEXT) +static void +gdk_x11_gl_context_empty_frame (GdkDrawContext *draw_context) +{ +} + static void gdk_x11_gl_context_class_init (GdkX11GLContextClass *klass) { + GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass); + + draw_context_class->empty_frame = gdk_x11_gl_context_empty_frame; } static void From 282d66a604238b945243de53b53181aae5dae8f8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2024 09:01:01 -0500 Subject: [PATCH 3/5] inspector: Clean up the general tab Put the Wayland protocols, GL and Vulkan extensions behind expanders, so we have less scrolling surface by default. --- gtk/inspector/general.c | 42 ++++++++++++++++------ gtk/inspector/general.ui | 75 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 11 deletions(-) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 7f82d43d8e..861568cc0e 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -83,9 +83,15 @@ struct _GtkInspectorGeneral GtkWidget *version_box; GtkWidget *env_box; GtkWidget *display_box; + GtkWidget *display_extensions_row; + GtkWidget *display_extensions_box; GtkWidget *monitor_box; GtkWidget *gl_box; + GtkWidget *gl_extensions_row; + GtkWidget *gl_extensions_box; GtkWidget *vulkan_box; + GtkWidget *vulkan_extensions_row; + GtkWidget *vulkan_extensions_box; GtkWidget *device_box; GtkWidget *gtk_version; GtkWidget *gdk_backend; @@ -290,7 +296,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen, Display *dpy, const char *ext) { - add_check_row (gen, GTK_LIST_BOX (gen->gl_box), ext, epoxy_has_glx_extension (dpy, 0, ext), 0); + add_check_row (gen, GTK_LIST_BOX (gen->gl_extensions_box), ext, epoxy_has_glx_extension (dpy, 0, ext), 0); } #endif @@ -301,7 +307,7 @@ append_wgl_extension_row (GtkInspectorGeneral *gen, { HDC hdc = 0; - add_check_row (gen, GTK_LIST_BOX (gen->gl_box), ext, epoxy_has_wgl_extension (hdc, ext), 0); + add_check_row (gen, GTK_LIST_BOX (gen->gl_extensions_box), ext, epoxy_has_wgl_extension (hdc, ext), 0); } #endif @@ -311,7 +317,7 @@ append_egl_extension_row (GtkInspectorGeneral *gen, EGLDisplay dpy, const char *ext) { - add_check_row (gen, GTK_LIST_BOX (gen->gl_box), ext, epoxy_has_egl_extension (dpy, ext), 0); + add_check_row (gen, GTK_LIST_BOX (gen->gl_extensions_box), ext, epoxy_has_egl_extension (dpy, ext), 0); } static EGLDisplay @@ -354,6 +360,7 @@ init_gl (GtkInspectorGeneral *gen) gtk_widget_set_visible (gen->gl_vendor_row, FALSE); gtk_widget_set_visible (gen->gl_full_version_row, FALSE); gtk_widget_set_visible (gen->glsl_version_row, FALSE); + gtk_widget_set_visible (gen->gl_extensions_row, FALSE); gtk_label_set_text (GTK_LABEL (gen->gl_error), error->message); g_error_free (error); return; @@ -527,18 +534,18 @@ init_vulkan (GtkInspectorGeneral *gen) g_free (api_version); g_free (driver_version); - add_check_row (gen, GTK_LIST_BOX (gen->vulkan_box), VK_KHR_SURFACE_EXTENSION_NAME, TRUE, 0); + add_check_row (gen, GTK_LIST_BOX (gen->vulkan_extensions_box), VK_KHR_SURFACE_EXTENSION_NAME, TRUE, 0); #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (gen->display)) - add_check_row (gen, GTK_LIST_BOX (gen->vulkan_box), "VK_KHR_xlib_surface", TRUE, 0); + add_check_row (gen, GTK_LIST_BOX (gen->vulkan_extensions_box), "VK_KHR_xlib_surface", TRUE, 0); #endif #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gen->display)) - add_check_row (gen, GTK_LIST_BOX (gen->vulkan_box), "VK_KHR_wayland_surface", TRUE, 0); + add_check_row (gen, GTK_LIST_BOX (gen->vulkan_extensions_box), "VK_KHR_wayland_surface", TRUE, 0); #endif - add_check_row (gen, GTK_LIST_BOX (gen->vulkan_box), VK_EXT_DEBUG_REPORT_EXTENSION_NAME, + add_check_row (gen, GTK_LIST_BOX (gen->vulkan_extensions_box), VK_EXT_DEBUG_REPORT_EXTENSION_NAME, has_debug_extension (context), 0); - add_check_row (gen, GTK_LIST_BOX (gen->vulkan_box), "VK_LAYER_KHRONOS_validation", + add_check_row (gen, GTK_LIST_BOX (gen->vulkan_extensions_box), "VK_LAYER_KHRONOS_validation", has_validation_layer (context), 0); g_object_unref (context); @@ -625,7 +632,7 @@ append_wayland_protocol_row (GtkInspectorGeneral *gen, if (proxy == NULL) return; - list = GTK_LIST_BOX (gen->display_box); + list = GTK_LIST_BOX (gen->display_extensions_box); id = wl_proxy_get_class (proxy); version = wl_proxy_get_version (proxy); @@ -675,7 +682,6 @@ populate_display (GdkDisplay *display, GtkInspectorGeneral *gen) GtkWidget *child; GtkListBox *list; - gtk_widget_set_visible (gen->display_composited, TRUE); list = GTK_LIST_BOX (gen->display_box); children = NULL; for (child = gtk_widget_get_first_child (GTK_WIDGET (list)); @@ -690,7 +696,8 @@ populate_display (GdkDisplay *display, GtkInspectorGeneral *gen) child = l->data; if (gtk_widget_is_ancestor (gen->display_name, child) || gtk_widget_is_ancestor (gen->display_rgba, child) || - gtk_widget_is_ancestor (gen->display_composited, child)) + gtk_widget_is_ancestor (gen->display_composited, child) || + child == gen->display_extensions_row) continue; gtk_list_box_remove (list, child); @@ -704,9 +711,16 @@ populate_display (GdkDisplay *display, GtkInspectorGeneral *gen) gtk_widget_set_visible (gen->display_composited, gdk_display_is_composited (display)); + list = GTK_LIST_BOX (gen->display_extensions_box); + while ((child = gtk_widget_get_first_child (GTK_WIDGET (list))) != NULL) + gtk_list_box_remove (list, child); + #ifdef GDK_WINDOWING_WAYLAND add_wayland_protocols (display, gen); #endif + + gtk_widget_set_visible (gen->display_extensions_row, + gtk_widget_get_first_child (gen->display_extensions_box) != NULL); } static void @@ -1206,9 +1220,15 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, version_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, env_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_box); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_extensions_row); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_extensions_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, monitor_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gl_box); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gl_extensions_row); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gl_extensions_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vulkan_box); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vulkan_extensions_row); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, vulkan_extensions_box); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gtk_version); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gdk_backend); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gsk_renderer); diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index 18c6509fbb..807d176098 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -528,6 +528,31 @@ + + + 0 + + + + + Protocols + 10 + + + + + 20 + none + center + + + + + + + @@ -768,6 +793,31 @@ + + + 0 + + + + + Extensions + 10 + + + + + 20 + none + center + + + + + + + @@ -859,6 +909,31 @@ + + + 0 + + + + + Extensions + 10 + + + + + 20 + none + center + + + + + + + From e56f9dbeb85d98ef4665d19c6e7028ccd540f8f0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2024 09:25:17 -0500 Subject: [PATCH 4/5] inspector: Drop a size group All this size group did was causing values to be needlessly ellipsized. Drop it. --- gtk/inspector/general.c | 6 ------ gtk/inspector/general.ui | 24 ------------------------ 2 files changed, 30 deletions(-) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 861568cc0e..1f5357a0cc 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -130,7 +130,6 @@ struct _GtkInspectorGeneral GtkWidget *display_name; GtkWidget *display_rgba; GtkWidget *display_composited; - GtkSizeGroup *labels; GdkDisplay *display; }; @@ -246,8 +245,6 @@ add_check_row (GtkInspectorGeneral *gen, gtk_widget_set_hexpand (box, FALSE); gtk_list_box_insert (list, row, -1); - - gtk_size_group_add_widget (gen->labels, label); } static void @@ -286,8 +283,6 @@ add_label_row (GtkInspectorGeneral *gen, gtk_widget_set_hexpand (box, FALSE); gtk_list_box_insert (GTK_LIST_BOX (list), row, -1); - - gtk_size_group_add_widget (gen->labels, label); } #ifdef GDK_WINDOWING_X11 @@ -1263,7 +1258,6 @@ gtk_inspector_general_class_init (GtkInspectorGeneralClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gtk_exe_prefix); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gtk_data_prefix); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, gsettings_schema_dir); - gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, labels); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_name); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_composited); gtk_widget_class_bind_template_child (widget_class, GtkInspectorGeneral, display_rgba); diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index 807d176098..ee8d85ba68 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -951,30 +951,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - From 7693e7133dad143ab200a153a1509035683d4022 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Jan 2024 09:35:43 -0500 Subject: [PATCH 5/5] inspector: Reorder the general tab Put the devices below the monitors, for a more logical arrangement. --- gtk/inspector/general.c | 8 ++++---- gtk/inspector/general.ui | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 1f5357a0cc..8514b6261a 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -1134,16 +1134,16 @@ keynav_failed (GtkWidget *widget, GtkDirectionType direction, GtkInspectorGenera else if (direction == GTK_DIR_DOWN && widget == gen->display_box) next = gen->monitor_box; else if (direction == GTK_DIR_DOWN && widget == gen->monitor_box) + next = gen->device_box; + else if (direction == GTK_DIR_DOWN && widget == gen->device_box) next = gen->gl_box; else if (direction == GTK_DIR_DOWN && widget == gen->gl_box) next = gen->vulkan_box; - else if (direction == GTK_DIR_DOWN && widget == gen->vulkan_box) - next = gen->device_box; - else if (direction == GTK_DIR_UP && widget == gen->device_box) - next = gen->vulkan_box; else if (direction == GTK_DIR_UP && widget == gen->vulkan_box) next = gen->gl_box; else if (direction == GTK_DIR_UP && widget == gen->gl_box) + next = gen->device_box; + else if (direction == GTK_DIR_UP && widget == gen->device_box) next = gen->monitor_box; else if (direction == GTK_DIR_UP && widget == gen->monitor_box) next = gen->display_box; diff --git a/gtk/inspector/general.ui b/gtk/inspector/general.ui index ee8d85ba68..085122e2c4 100644 --- a/gtk/inspector/general.ui +++ b/gtk/inspector/general.ui @@ -565,6 +565,16 @@ + + + none + center + + + none @@ -936,16 +946,6 @@ - - - none - center - - -