summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/display.c17
-rw-r--r--src/include/ui.h2
-rw-r--r--src/ui/ui.c6
3 files changed, 14 insertions, 11 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 8d02d41f..8612d3ab 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -304,6 +304,7 @@ meta_display_open (void)
GSList *tmp;
int i;
guint32 timestamp;
+ MetaScreen *screen;
/* A list of all atom names, so that we can intern them in one go. */
const gchar *atom_names[] = {
@@ -665,17 +666,11 @@ meta_display_open (void)
screens = NULL;
- i = 0;
- while (i < ScreenCount (xdisplay))
- {
- MetaScreen *screen;
-
- screen = meta_screen_new (the_display, i, timestamp);
+ i = meta_ui_get_screen_number ();
+ screen = meta_screen_new (the_display, i, timestamp);
- if (screen)
- screens = g_slist_prepend (screens, screen);
- ++i;
- }
+ if (screen)
+ screens = g_slist_prepend (screens, screen);
the_display->screens = screens;
@@ -700,7 +695,7 @@ meta_display_open (void)
tmp = the_display->screens;
while (tmp != NULL)
{
- MetaScreen *screen = tmp->data;
+ screen = tmp->data;
meta_screen_manage_all_windows (screen);
diff --git a/src/include/ui.h b/src/include/ui.h
index 353d1a02..7be0c9fc 100644
--- a/src/include/ui.h
+++ b/src/include/ui.h
@@ -49,6 +49,8 @@ void meta_ui_init (int *argc, char ***argv);
Display* meta_ui_get_display (void);
+gint meta_ui_get_screen_number (void);
+
void meta_ui_add_event_func (Display *xdisplay,
MetaEventFunc func,
gpointer data);
diff --git a/src/ui/ui.c b/src/ui/ui.c
index a9676c72..1834a1f5 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -88,6 +88,12 @@ meta_ui_get_display (void)
return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
}
+gint
+meta_ui_get_screen_number (void)
+{
+ return gdk_screen_get_number (gdk_screen_get_default ());
+}
+
/* We do some of our event handling in frames.c, which expects
* GDK events delivered by GTK+. However, since the transition to
* client side windows, we can't let GDK see button events, since the