mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
cursor-tracker: Have one global cursor tracker
Now that we have a global MetaScreen, we can simply have a global MetaCursorTracker as well. Keep the get_for_screen() API around for compatibility, though.
This commit is contained in:
parent
7c0d75e34f
commit
ef44cc5a53
@ -172,6 +172,8 @@ meta_cursor_tracker_new (MetaScreen *screen)
|
||||
return make_x11_cursor_tracker (screen);
|
||||
}
|
||||
|
||||
static MetaCursorTracker *_cursor_tracker;
|
||||
|
||||
/**
|
||||
* meta_cursor_tracker_get_for_screen:
|
||||
* @screen: the #MetaScreen
|
||||
@ -183,14 +185,10 @@ meta_cursor_tracker_new (MetaScreen *screen)
|
||||
MetaCursorTracker *
|
||||
meta_cursor_tracker_get_for_screen (MetaScreen *screen)
|
||||
{
|
||||
MetaCursorTracker *self;
|
||||
if (!_cursor_tracker)
|
||||
_cursor_tracker = meta_cursor_tracker_new (screen);
|
||||
|
||||
if (screen->cursor_tracker)
|
||||
return screen->cursor_tracker;
|
||||
|
||||
self = meta_cursor_tracker_new (screen);
|
||||
screen->cursor_tracker = self;
|
||||
return self;
|
||||
return _cursor_tracker;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -79,7 +79,6 @@ struct _MetaScreen
|
||||
MetaStack *stack;
|
||||
MetaStackTracker *stack_tracker;
|
||||
|
||||
MetaCursorTracker *cursor_tracker;
|
||||
MetaCursor current_cursor;
|
||||
|
||||
Window wm_sn_selection_window;
|
||||
|
Loading…
Reference in New Issue
Block a user