cursor-tracker: Split a simple method out

This commit is contained in:
Jasper St. Pierre 2014-04-22 11:08:32 -04:00
parent 52cf9104d9
commit ee812e3fe0

View File

@ -163,6 +163,15 @@ make_x11_cursor_tracker (MetaScreen *screen)
return self; return self;
} }
static MetaCursorTracker *
meta_cursor_tracker_new (MetaScreen *screen)
{
if (meta_is_wayland_compositor ())
return make_wayland_cursor_tracker (screen);
else
return make_x11_cursor_tracker (screen);
}
/** /**
* meta_cursor_tracker_get_for_screen: * meta_cursor_tracker_get_for_screen:
* @screen: the #MetaScreen * @screen: the #MetaScreen
@ -179,11 +188,7 @@ meta_cursor_tracker_get_for_screen (MetaScreen *screen)
if (screen->cursor_tracker) if (screen->cursor_tracker)
return screen->cursor_tracker; return screen->cursor_tracker;
if (meta_is_wayland_compositor ()) self = meta_cursor_tracker_new (screen);
self = make_wayland_cursor_tracker (screen);
else
self = make_x11_cursor_tracker (screen);
screen->cursor_tracker = self; screen->cursor_tracker = self;
return self; return self;
} }