diff --git a/src/core/screen.c b/src/core/screen.c index 503c20195..98c5538e3 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1515,6 +1515,9 @@ meta_screen_get_monitor_index_for_rect (MetaScreen *screen, logical_monitor = meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager, rect); + if (!logical_monitor) + return -1; + return logical_monitor->number; } @@ -1604,7 +1607,7 @@ meta_screen_get_primary_monitor (MetaScreen *screen) if (logical_monitor) return logical_monitor->number; else - return 0; + return -1; } /**