gnome-settings-daemon r335 - in trunk: . plugins/mouse
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r335 - in trunk: . plugins/mouse
- Date: Thu, 8 May 2008 00:30:55 +0100 (BST)
Author: carlosg
Date: Wed May 7 23:30:55 2008
New Revision: 335
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=335&view=rev
Log:
2008-05-08 Carlos Garnacho <carlosg gnome org>
* plugins/mouse/gsd-locate-pointer.c (set_transparent_shape): new
function, sets a fully transparent shape to the whole window.
(timeline_finished_cb) (gsd_locate_pointer): set the window
transparent once the animation is finished, and before it's shown for
the first time. The shape will be changed afterwards while running the
animation. This fixes some artifacts shown when showing/moving the
window, bug #531861.
(locate_pointer_expose): Plug a leak.
Modified:
trunk/ChangeLog
trunk/plugins/mouse/gsd-locate-pointer.c
Modified: trunk/plugins/mouse/gsd-locate-pointer.c
==============================================================================
--- trunk/plugins/mouse/gsd-locate-pointer.c (original)
+++ trunk/plugins/mouse/gsd-locate-pointer.c Wed May 7 23:30:55 2008
@@ -139,6 +139,7 @@
cr = gdk_cairo_create (mask);
locate_pointer_paint (data, cr, FALSE);
gdk_window_shape_combine_mask (data->window, mask, 0, 0);
+ g_object_unref (mask);
}
cairo_destroy (cr);
@@ -167,14 +168,34 @@
}
static void
+set_transparent_shape (GdkWindow *window)
+{
+ GdkBitmap *mask;
+ cairo_t *cr;
+
+ mask = gdk_pixmap_new (data->window, WINDOW_SIZE, WINDOW_SIZE, 1);
+ cr = gdk_cairo_create (mask);
+
+ cairo_set_source_rgba (cr, 1., 1., 1., 0.);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_paint (cr);
+
+ gdk_window_shape_combine_mask (data->window, mask, 0, 0);
+ g_object_unref (mask);
+ cairo_destroy (cr);
+}
+
+static void
timeline_finished_cb (GsdTimeline *timeline,
gpointer user_data)
{
GsdLocatePointerData *data = (GsdLocatePointerData *) user_data;
- /* hide window and unset shape */
+ /* set transparent shape and hide window */
+ if (!gtk_widget_is_composited (data->widget))
+ set_transparent_shape (data->window);
+
gdk_window_hide (data->window);
- gdk_window_shape_combine_mask (data->window, NULL, 0, 0);
}
static void
@@ -286,6 +307,10 @@
}
data->progress = 0.;
+
+ if (!gtk_widget_is_composited (data->widget))
+ set_transparent_shape (data->window);
+
gdk_window_show (data->window);
move_locate_pointer_window (data, screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]