screen: Move XDefineCursor on the root window here
This is really an X11 front-end thing, so it doesn't belong in the cursor tracker, which is a back-end thing.
This commit is contained in:
parent
565883dadb
commit
fe42a4eb4e
@ -398,25 +398,12 @@ meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker)
|
|||||||
void
|
void
|
||||||
meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
|
meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
|
||||||
MetaCursor cursor)
|
MetaCursor cursor)
|
||||||
{
|
|
||||||
Cursor xcursor;
|
|
||||||
MetaDisplay *display = tracker->screen->display;
|
|
||||||
|
|
||||||
/* First create a cursor for X11 applications that don't specify their own */
|
|
||||||
xcursor = meta_display_create_x_cursor (display, cursor);
|
|
||||||
|
|
||||||
XDefineCursor (display->xdisplay, tracker->screen->xroot, xcursor);
|
|
||||||
XFlush (display->xdisplay);
|
|
||||||
XFreeCursor (display->xdisplay, xcursor);
|
|
||||||
|
|
||||||
/* Now update the real root cursor */
|
|
||||||
if (meta_is_wayland_compositor ())
|
|
||||||
{
|
{
|
||||||
g_clear_pointer (&tracker->root_cursor, meta_cursor_reference_unref);
|
g_clear_pointer (&tracker->root_cursor, meta_cursor_reference_unref);
|
||||||
tracker->root_cursor = meta_cursor_reference_from_theme (tracker, cursor);
|
tracker->root_cursor = meta_cursor_reference_from_theme (tracker, cursor);
|
||||||
|
|
||||||
sync_cursor (tracker);
|
sync_cursor (tracker);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
should_have_hw_cursor (MetaCursorTracker *tracker)
|
should_have_hw_cursor (MetaCursorTracker *tracker)
|
||||||
|
@ -1384,7 +1384,18 @@ update_focus_mode (MetaScreen *screen)
|
|||||||
void
|
void
|
||||||
meta_screen_update_cursor (MetaScreen *screen)
|
meta_screen_update_cursor (MetaScreen *screen)
|
||||||
{
|
{
|
||||||
meta_cursor_tracker_set_root_cursor (screen->cursor_tracker, screen->current_cursor);
|
MetaDisplay *display = screen->display;
|
||||||
|
MetaCursor cursor = screen->current_cursor;
|
||||||
|
Cursor xcursor;
|
||||||
|
|
||||||
|
meta_cursor_tracker_set_root_cursor (screen->cursor_tracker, cursor);
|
||||||
|
|
||||||
|
/* Set a cursor for X11 applications that don't specify their own */
|
||||||
|
xcursor = meta_display_create_x_cursor (display, cursor);
|
||||||
|
|
||||||
|
XDefineCursor (display->xdisplay, screen->xroot, xcursor);
|
||||||
|
XFlush (display->xdisplay);
|
||||||
|
XFreeCursor (display->xdisplay, xcursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user