display: Only manage the default X screen

https://bugzilla.gnome.org/show_bug.cgi?id=648156
This commit is contained in:
Jürg Billeter 2012-09-10 20:19:21 +02:00
parent e22d941f06
commit 1a521e10c3
3 changed files with 18 additions and 10 deletions

View File

@ -470,6 +470,7 @@ meta_display_open (void)
{
Display *xdisplay;
GSList *screens;
MetaScreen *screen;
GSList *tmp;
int i;
guint32 timestamp;
@ -854,19 +855,18 @@ meta_display_open (void)
the_display->last_user_time = timestamp;
the_display->compositor = NULL;
/* Mutter used to manage all X screens of the display in a single process, but
* now it always manages exactly one screen as specified by the DISPLAY
* environment variable. The screens GSList is left for simplicity.
*/
screens = NULL;
i = 0;
while (i < ScreenCount (xdisplay))
{
MetaScreen *screen;
i = meta_ui_get_screen_number ();
screen = meta_screen_new (the_display, i, timestamp);
if (screen)
screens = g_slist_prepend (screens, screen);
++i;
}
the_display->screens = screens;

View File

@ -82,6 +82,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

View File

@ -46,6 +46,8 @@ void meta_ui_init (void);
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);