[gimp] app: set a normal mouse cursor on all overlay children windows
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: set a normal mouse cursor on all overlay children windows
- Date: Mon, 1 Mar 2010 22:46:25 +0000 (UTC)
commit dfc1671cb031ce5d5af611c8bcb52f4148518cee
Author: Michael Natterer <mitch gimp org>
Date: Mon Mar 1 23:45:16 2010 +0100
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).
app/widgets/gimpoverlaychild.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpoverlaychild.c b/app/widgets/gimpoverlaychild.c
index fafaba4..a430fed 100644
--- a/app/widgets/gimpoverlaychild.c
+++ b/app/widgets/gimpoverlaychild.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]