diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mouse/msd-locate-pointer.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins/mouse/msd-locate-pointer.c b/plugins/mouse/msd-locate-pointer.c index 8f44646..e304862 100644 --- a/plugins/mouse/msd-locate-pointer.c +++ b/plugins/mouse/msd-locate-pointer.c @@ -242,15 +242,15 @@ create_window (MsdLocatePointerData *data, GdkColormap *colormap; GdkVisual *visual; GdkWindowAttr attributes; + gint attributes_mask; colormap = gdk_screen_get_rgba_colormap (screen); visual = gdk_screen_get_rgba_visual (screen); - if (!colormap) - { - colormap = gdk_screen_get_rgb_colormap (screen); - visual = gdk_screen_get_rgb_visual (screen); - } + attributes_mask = GDK_WA_X | GDK_WA_Y; + + if (colormap) + attributes_mask = attributes_mask | GDK_WA_VISUAL | GDK_WA_COLORMAP; attributes.window_type = GDK_WINDOW_TEMP; attributes.wclass = GDK_INPUT_OUTPUT; @@ -262,7 +262,7 @@ create_window (MsdLocatePointerData *data, data->window = gdk_window_new (gdk_screen_get_root_window (screen), &attributes, - GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP); + attributes_mask); gdk_window_set_user_data (data->window, data->widget); } @@ -301,8 +301,7 @@ move_locate_pointer_window (MsdLocatePointerData *data, { gint cursor_x, cursor_y; GdkBitmap *mask; - GdkColor col; - GdkGC *gc; + cairo_t *cr; gdk_window_get_pointer (gdk_screen_get_root_window (screen), &cursor_x, &cursor_y, NULL); @@ -311,18 +310,18 @@ move_locate_pointer_window (MsdLocatePointerData *data, cursor_y - WINDOW_SIZE / 2, WINDOW_SIZE, WINDOW_SIZE); - col.pixel = 0; mask = gdk_pixmap_new (data->window, WINDOW_SIZE, WINDOW_SIZE, 1); - gc = gdk_gc_new (mask); - gdk_gc_set_foreground (gc, &col); - gdk_draw_rectangle (mask, gc, TRUE, 0, 0, WINDOW_SIZE, WINDOW_SIZE); + cr = gdk_cairo_create (mask); + cairo_set_source_rgb (cr, 0., 0., 0.); + cairo_rectangle (cr, 0., 0., WINDOW_SIZE, WINDOW_SIZE); + cairo_fill (cr); + cairo_destroy (cr); /* allow events to happen through the window */ gdk_window_input_shape_combine_mask (data->window, mask, 0, 0); g_object_unref (mask); - g_object_unref (gc); } void |