Commit f417daff authored by Marco Trevisan's avatar Marco Trevisan 🎺

window: Add monitor-changed signal

When a window logical monitor has changed, we should notify this not only
at display level but also at window level, so that we can monitor this change
for a single window only.
parent 7cb5f217
......@@ -226,6 +226,7 @@ enum
UNMANAGED,
SIZE_CHANGED,
POSITION_CHANGED,
MONITOR_CHANGED,
SHOWN,
LAST_SIGNAL
......@@ -674,6 +675,21 @@ meta_window_class_init (MetaWindowClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* MetaWindow::monitor-changed:
* @window: a #MetaWindow
* @old_monitor: the old monitor index or -1 if not known
*
* This is emitted when the window has changed monitor
*/
window_signals[MONITOR_CHANGED] =
g_signal_new ("monitor-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_INT);
/**
* MetaWindow::shown:
* @window: a #MetaWindow
......@@ -933,6 +949,9 @@ meta_window_main_monitor_changed (MetaWindow *window,
{
META_WINDOW_GET_CLASS (window)->main_monitor_changed (window, old);
g_signal_emit (window, window_signals[MONITOR_CHANGED], 0,
old ? old->number : -1);
if (old)
g_signal_emit_by_name (window->display, "window-left-monitor",
old->number, window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment