mirror of https://github.com/GNOME/gimp.git
app: set a normal mouse cursor on all overlay children windows
so they don't show the parent's cursor (which is most likely inappropriate on the canvas).
This commit is contained in:
parent
f214b4f9b7
commit
dfc1671cb0
|
@ -130,6 +130,7 @@ gimp_overlay_child_realize (GimpOverlayBox *box,
|
|||
GimpOverlayChild *child)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GdkDisplay *display;
|
||||
GtkAllocation child_allocation;
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
|
@ -139,6 +140,8 @@ gimp_overlay_child_realize (GimpOverlayBox *box,
|
|||
|
||||
widget = GTK_WIDGET (box);
|
||||
|
||||
display = gtk_widget_get_display (widget);
|
||||
|
||||
gtk_widget_get_allocation (child->widget, &child_allocation);
|
||||
|
||||
if (gtk_widget_get_visible (child->widget))
|
||||
|
@ -159,8 +162,13 @@ gimp_overlay_child_realize (GimpOverlayBox *box,
|
|||
attributes.visual = gtk_widget_get_visual (widget);
|
||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||
attributes.event_mask = gtk_widget_get_events (widget);
|
||||
attributes.cursor = gdk_cursor_new_for_display (display, GDK_LEFT_PTR);
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
attributes_mask = (GDK_WA_X |
|
||||
GDK_WA_Y |
|
||||
GDK_WA_VISUAL |
|
||||
GDK_WA_COLORMAP |
|
||||
GDK_WA_CURSOR);
|
||||
|
||||
child->window = gdk_window_new (gtk_widget_get_root_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
|
@ -169,6 +177,8 @@ gimp_overlay_child_realize (GimpOverlayBox *box,
|
|||
gdk_offscreen_window_set_embedder (child->window,
|
||||
gtk_widget_get_window (widget));
|
||||
|
||||
gdk_cursor_unref (attributes.cursor);
|
||||
|
||||
g_signal_connect (child->window, "from-embedder",
|
||||
G_CALLBACK (gimp_overlay_child_from_embedder),
|
||||
child);
|
||||
|
|
Loading…
Reference in New Issue