display: Add signal to monitor notifying about position changes

This is in preparation to a new arrangement widget.

https://bugzilla.gnome.org/show_bug.cgi?id=786971
This commit is contained in:
Benjamin Berg 2017-11-24 12:49:56 +01:00 committed by Georges Basile Stavracas Neto
parent faaf402c82
commit 32be5bd1d9
2 changed files with 14 additions and 0 deletions

View file

@ -659,9 +659,18 @@ cc_display_monitor_dbus_set_position (CcDisplayMonitor *pself,
if (self->logical_monitor)
{
gboolean notify = FALSE;
if (self->logical_monitor->x != x || self->logical_monitor->y != y)
notify = TRUE;
self->logical_monitor->x = x;
self->logical_monitor->y = y;
if (notify)
g_signal_emit_by_name (self, "position-changed");
}
}
static double

View file

@ -107,6 +107,11 @@ cc_display_monitor_class_init (CcDisplayMonitorClass *klass)
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_signal_new ("position-changed",
CC_TYPE_DISPLAY_MONITOR,
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
const char *