[gnome-builder/wip/gtk4-port: 1090/1774] plugins/buildui: focus page when hiding popover
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 1090/1774] plugins/buildui: focus page when hiding popover
- Date: Mon, 11 Jul 2022 22:31:34 +0000 (UTC)
commit 513e58697821541c54dfb1612c001d79118181f6
Author: Christian Hergert <chergert redhat com>
Date: Fri May 20 15:38:43 2022 -0700
plugins/buildui: focus page when hiding popover
src/plugins/buildui/gbp-buildui-status-popover.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/src/plugins/buildui/gbp-buildui-status-popover.c
b/src/plugins/buildui/gbp-buildui-status-popover.c
index 2f50d452e..96f60f672 100644
--- a/src/plugins/buildui/gbp-buildui-status-popover.c
+++ b/src/plugins/buildui/gbp-buildui-status-popover.c
@@ -149,12 +149,30 @@ is_error (gpointer data,
return ide_diagnostic_get_severity (data) == IDE_DIAGNOSTIC_ERROR;
}
+static void
+gbp_buildui_status_popover_closed (GtkPopover *popover)
+{
+ GbpBuilduiStatusPopover *self = (GbpBuilduiStatusPopover *)popover;
+ IdeWorkspace *workspace;
+ IdePage *page;
+
+ g_assert (GBP_IS_BUILDUI_STATUS_POPOVER (self));
+
+ if ((workspace = ide_widget_get_workspace (GTK_WIDGET (self))) &&
+ (page = ide_workspace_get_most_recent_page (workspace)))
+ {
+ panel_widget_raise (PANEL_WIDGET (page));
+ gtk_widget_grab_focus (GTK_WIDGET (page));
+ }
+}
+
static void
gbp_buildui_status_popover_dispose (GObject *object)
{
GbpBuilduiStatusPopover *self = (GbpBuilduiStatusPopover *)object;
g_clear_object (&self->pipeline_signals);
+ g_clear_pointer (&self->deduplicator, g_hash_table_unref);
G_OBJECT_CLASS (gbp_buildui_status_popover_parent_class)->dispose (object);
}
@@ -164,9 +182,12 @@ gbp_buildui_status_popover_class_init (GbpBuilduiStatusPopoverClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkPopoverClass *popover_class = GTK_POPOVER_CLASS (klass);
object_class->dispose = gbp_buildui_status_popover_dispose;
+ popover_class->closed = gbp_buildui_status_popover_closed;
+
gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/buildui/gbp-buildui-status-popover.ui");
gtk_widget_class_bind_template_child (widget_class, GbpBuilduiStatusPopover, diagnostics);
gtk_widget_class_bind_template_child (widget_class, GbpBuilduiStatusPopover, error_filter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]