[gnome-control-center/wip/muktupavels/issue-1697] display: fix monitor labels
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/muktupavels/issue-1697] display: fix monitor labels
- Date: Mon, 7 Mar 2022 15:43:34 +0000 (UTC)
commit ea493c98eccb86dcd211871d1e4bd94e43804293
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 7 17:40:33 2022 +0200
display: fix monitor labels
has-toplevel-focus property has been removed from GTK 4:
https://gitlab.gnome.org/GNOME/gtk/-/commit/0ce9f26dc543655761166686275b3da3b2f44174
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1697
panels/display/cc-display-panel.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 622603c54..3eb3d63e4 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -375,7 +375,7 @@ ensure_monitor_labels (CcDisplayPanel *self)
for (w = windows; w; w = w->next)
{
- if (gtk_widget_has_focus (GTK_WIDGET (w->data)))
+ if (gtk_window_is_active (GTK_WINDOW (w->data)))
{
monitor_labeler_show (self);
break;
@@ -387,7 +387,7 @@ ensure_monitor_labels (CcDisplayPanel *self)
}
static void
-dialog_toplevel_focus_changed (CcDisplayPanel *self)
+dialog_toplevel_is_active_changed (CcDisplayPanel *self)
{
ensure_monitor_labels (self);
}
@@ -1002,8 +1002,8 @@ mapped_cb (CcDisplayPanel *panel)
shell = cc_panel_get_shell (CC_PANEL (panel));
toplevel = cc_shell_get_toplevel (shell);
if (toplevel && !panel->focus_id)
- panel->focus_id = g_signal_connect_object (toplevel, "notify::has-toplevel-focus",
- G_CALLBACK (dialog_toplevel_focus_changed), panel,
G_CONNECT_SWAPPED);
+ panel->focus_id = g_signal_connect_object (toplevel, "notify::is-active",
+ G_CALLBACK (dialog_toplevel_is_active_changed), panel,
G_CONNECT_SWAPPED);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]