Place cursors on frames, not root
This commit is contained in:
parent
29d17da1ba
commit
0f9bdb18f5
@ -632,7 +632,7 @@ meta_core_set_screen_cursor (Display *xdisplay,
|
|||||||
if (window == NULL || window->frame == NULL)
|
if (window == NULL || window->frame == NULL)
|
||||||
meta_bug ("No such frame window 0x%lx!\n", frame_on_screen);
|
meta_bug ("No such frame window 0x%lx!\n", frame_on_screen);
|
||||||
|
|
||||||
meta_screen_set_cursor (window->screen, cursor);
|
meta_frame_set_screen_cursor (window->frame, cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2247,6 +2247,8 @@ xcursor_for_op (MetaDisplay *display,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cursor == META_CURSOR_DEFAULT)
|
||||||
|
return None;
|
||||||
return meta_display_create_x_cursor (display, cursor);
|
return meta_display_create_x_cursor (display, cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2305,7 +2307,8 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
#undef GRAB_MASK
|
#undef GRAB_MASK
|
||||||
|
|
||||||
XFreeCursor (display->xdisplay, cursor);
|
if (cursor != None)
|
||||||
|
XFreeCursor (display->xdisplay, cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
19
src/frame.c
19
src/frame.c
@ -54,6 +54,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
|||||||
frame->child_y = 0;
|
frame->child_y = 0;
|
||||||
frame->bottom_height = 0;
|
frame->bottom_height = 0;
|
||||||
frame->right_width = 0;
|
frame->right_width = 0;
|
||||||
|
frame->current_cursor = 0;
|
||||||
|
|
||||||
frame->mapped = FALSE;
|
frame->mapped = FALSE;
|
||||||
|
|
||||||
@ -351,3 +352,21 @@ meta_frame_queue_draw (MetaFrame *frame)
|
|||||||
meta_ui_queue_frame_draw (frame->window->screen->ui,
|
meta_ui_queue_frame_draw (frame->window->screen->ui,
|
||||||
frame->xwindow);
|
frame->xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void meta_frame_set_screen_cursor (MetaFrame *frame,
|
||||||
|
MetaCursor cursor)
|
||||||
|
{
|
||||||
|
Cursor xcursor;
|
||||||
|
if (cursor == frame->current_cursor)
|
||||||
|
return;
|
||||||
|
frame->current_cursor = cursor;
|
||||||
|
if (cursor == META_CURSOR_DEFAULT)
|
||||||
|
XUndefineCursor (frame->window->display->xdisplay, frame->xwindow);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xcursor = meta_display_create_x_cursor (frame->window->display, cursor);
|
||||||
|
XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor);
|
||||||
|
XFreeCursor (frame->window->display->xdisplay, xcursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,8 @@ struct _MetaFrame
|
|||||||
/* reparent window */
|
/* reparent window */
|
||||||
Window xwindow;
|
Window xwindow;
|
||||||
|
|
||||||
|
MetaCursor current_cursor;
|
||||||
|
|
||||||
/* This rect is trusted info from where we put the
|
/* This rect is trusted info from where we put the
|
||||||
* frame, not the result of ConfigureNotify
|
* frame, not the result of ConfigureNotify
|
||||||
*/
|
*/
|
||||||
@ -71,6 +73,8 @@ void meta_frame_sync_to_window (MetaFrame *frame,
|
|||||||
gboolean need_move,
|
gboolean need_move,
|
||||||
gboolean need_resize);
|
gboolean need_resize);
|
||||||
|
|
||||||
|
void meta_frame_set_screen_cursor (MetaFrame *frame,
|
||||||
|
MetaCursor cursor);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user