From fad23c9979d3ba04f377eb0704b6d78b9ebf43c4 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 31 Jan 2019 07:16:34 -0500 Subject: screen: Remove get_current_monitor in favor of get_current_xinerama Since xinerama already contains information on the monitor and its rectangle, there is no need to go through Gdk to get this information again. --- src/ui/tabpopup.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c index 49524d80..37231a5b 100644 --- a/src/ui/tabpopup.c +++ b/src/ui/tabpopup.c @@ -760,34 +760,24 @@ static GtkWidget* selectable_workspace_new (MetaWorkspace *workspace, int entry_count) { GtkWidget *widget; - GdkMonitor *monitor; - GdkRectangle rect; + const MetaXineramaScreenInfo *current; int mini_workspace_width, mini_workspace_height; double mini_workspace_ratio; widget = g_object_new (meta_select_workspace_get_type (), NULL); - monitor = meta_screen_get_current_monitor (); - if (monitor != NULL) - { - gdk_monitor_get_geometry (monitor, &rect); - } - else - { - rect.width = workspace->screen->rect.width; - rect.height = workspace->screen->rect.height; - } + current = meta_screen_get_current_xinerama (workspace->screen); if (workspace->screen->rect.width < workspace->screen->rect.height) { mini_workspace_ratio = (double) workspace->screen->rect.width / (double) workspace->screen->rect.height; - mini_workspace_height = (int) ((double) rect.height / entry_count - SELECT_OUTLINE_WIDTH * 2); + mini_workspace_height = (int) ((double) current->rect.height / entry_count - SELECT_OUTLINE_WIDTH * 2); mini_workspace_width = (int) ((double) mini_workspace_height * mini_workspace_ratio); } else { mini_workspace_ratio = (double) workspace->screen->rect.height / (double) workspace->screen->rect.width; - mini_workspace_width = (int) ((double) rect.width / entry_count - SELECT_OUTLINE_WIDTH * 2); + mini_workspace_width = (int) ((double) current->rect.width / entry_count - SELECT_OUTLINE_WIDTH * 2); mini_workspace_height = (int) ((double) mini_workspace_width * mini_workspace_ratio); } -- cgit v1.2.1