window: Remove public meta_window_get_all_monitors API

It's not used anywhere and used monitor indices which is unoptimal.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2016-12-02 15:41:08 +08:00
parent 410bad88a8
commit 016359ede2
2 changed files with 0 additions and 45 deletions

View File

@ -2798,50 +2798,6 @@ meta_window_is_fullscreen (MetaWindow *window)
return window->fullscreen; return window->fullscreen;
} }
/**
* meta_window_get_all_monitors:
* @window: The #MetaWindow
* @length: (out): gint holding the length, may be %NULL to ignore
*
* Returns: (array length=length) (element-type gint) (transfer container):
* List of the monitor indices the window is on.
*/
gint *
meta_window_get_all_monitors (MetaWindow *window, gsize *length)
{
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaLogicalMonitor *logical_monitors;
unsigned int n_logical_monitors;
unsigned int i;
GArray *monitors;
MetaRectangle window_rect;
logical_monitors =
meta_monitor_manager_get_logical_monitors (monitor_manager,
&n_logical_monitors);
monitors = g_array_new (FALSE, FALSE, sizeof (int));
meta_window_get_frame_rect (window, &window_rect);
for (i = 0; i < n_logical_monitors; i++)
{
MetaRectangle *monitor_rect = &logical_monitors[i].rect;
if (meta_rectangle_overlap (&window_rect, monitor_rect))
g_array_append_val (monitors, i);
}
if (length)
*length = monitors->len;
i = -1;
g_array_append_val (monitors, i);
return (gint*) g_array_free (monitors, FALSE);
}
/** /**
* meta_window_is_screen_sized: * meta_window_is_screen_sized:
* @window: A #MetaWindow * @window: A #MetaWindow

View File

@ -185,7 +185,6 @@ gboolean meta_window_is_monitor_sized (MetaWindow *window);
gboolean meta_window_is_on_primary_monitor (MetaWindow *window); gboolean meta_window_is_on_primary_monitor (MetaWindow *window);
gboolean meta_window_requested_bypass_compositor (MetaWindow *window); gboolean meta_window_requested_bypass_compositor (MetaWindow *window);
gboolean meta_window_requested_dont_bypass_compositor (MetaWindow *window); gboolean meta_window_requested_dont_bypass_compositor (MetaWindow *window);
gint *meta_window_get_all_monitors (MetaWindow *window, gsize *length);
gboolean meta_window_get_icon_geometry (MetaWindow *window, gboolean meta_window_get_icon_geometry (MetaWindow *window,
MetaRectangle *rect); MetaRectangle *rect);