cursor-tracker: Make set_grab_cursor take a MetaCursorReference
This commit is contained in:
parent
0efb0b47eb
commit
fa60824096
@ -1839,6 +1839,7 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
|
|||||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||||
MetaCursor cursor = meta_cursor_for_grab_op (op);
|
MetaCursor cursor = meta_cursor_for_grab_op (op);
|
||||||
|
MetaCursorReference *cursor_ref;
|
||||||
|
|
||||||
XISetMask (mask.mask, XI_ButtonPress);
|
XISetMask (mask.mask, XI_ButtonPress);
|
||||||
XISetMask (mask.mask, XI_ButtonRelease);
|
XISetMask (mask.mask, XI_ButtonRelease);
|
||||||
@ -1872,7 +1873,9 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
|
|||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_error_trap_pop (display);
|
||||||
|
|
||||||
meta_cursor_tracker_set_grab_cursor (screen->cursor_tracker, cursor);
|
cursor_ref = meta_cursor_reference_from_theme (screen->cursor_tracker, cursor);
|
||||||
|
meta_cursor_tracker_set_grab_cursor (screen->cursor_tracker, cursor_ref);
|
||||||
|
meta_cursor_reference_unref (cursor_ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -2111,7 +2114,7 @@ meta_display_end_grab_op (MetaDisplay *display,
|
|||||||
meta_screen_ungrab_all_keys (display->screen, timestamp);
|
meta_screen_ungrab_all_keys (display->screen, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_cursor_tracker_set_grab_cursor (display->screen->cursor_tracker, META_CURSOR_DEFAULT);
|
meta_cursor_tracker_set_grab_cursor (display->screen->cursor_tracker, NULL);
|
||||||
|
|
||||||
display->grab_timestamp = 0;
|
display->grab_timestamp = 0;
|
||||||
display->grab_window = NULL;
|
display->grab_window = NULL;
|
||||||
|
@ -80,8 +80,8 @@ struct _MetaCursorTrackerClass {
|
|||||||
gboolean meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
gboolean meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||||
XEvent *xevent);
|
XEvent *xevent);
|
||||||
|
|
||||||
void meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
|
void meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
|
||||||
MetaCursor cursor);
|
MetaCursorReference *cursor);
|
||||||
void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
|
void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
|
||||||
struct wl_resource *buffer,
|
struct wl_resource *buffer,
|
||||||
int hot_x,
|
int hot_x,
|
||||||
|
@ -372,12 +372,13 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
|
meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
|
||||||
MetaCursor cursor)
|
MetaCursorReference *cursor)
|
||||||
{
|
{
|
||||||
g_clear_pointer (&tracker->grab_cursor, meta_cursor_reference_unref);
|
g_clear_pointer (&tracker->grab_cursor, meta_cursor_reference_unref);
|
||||||
if (cursor != META_CURSOR_DEFAULT)
|
if (cursor)
|
||||||
tracker->grab_cursor = meta_cursor_reference_from_theme (tracker, cursor);
|
tracker->grab_cursor = meta_cursor_reference_ref (cursor);
|
||||||
|
|
||||||
sync_cursor (tracker);
|
sync_cursor (tracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user