summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-01-31 07:16:34 -0500
committerlukefromdc <[email protected]>2019-01-31 20:00:19 +0000
commitfad23c9979d3ba04f377eb0704b6d78b9ebf43c4 (patch)
treeab1099b7ca988bbc42906ea6ab0095574240ac93 /src/ui
parent8abba9a150e4004004609ff7a1c72a188f170d5f (diff)
downloadmarco-fad23c9979d3ba04f377eb0704b6d78b9ebf43c4.tar.bz2
marco-fad23c9979d3ba04f377eb0704b6d78b9ebf43c4.tar.xz
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.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tabpopup.c18
1 files changed, 4 insertions, 14 deletions
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);
}