diff options
author | Carlos Eduardo Rodrigues DiĆ³genes <carlosd@src.gnome.org> | 2007-08-14 17:14:09 +0000 |
---|---|---|
committer | Carlos Eduardo Rodrigues DiĆ³genes <carlosd@src.gnome.org> | 2007-08-14 17:14:09 +0000 |
commit | 1bd922bcc3491ced50a4287f8724bee6a45ff88e (patch) | |
tree | 41fd37d82de9e8e5a5b70d43e27547bc764b637a /magnifier | |
parent | a6e9bfe200901d854ec44cf1ab36c63d8e791407 (diff) |
committing changes for bug #462890
svn path=/trunk/; revision=554
Diffstat (limited to 'magnifier')
-rw-r--r-- | magnifier/magnifier.c | 16 | ||||
-rw-r--r-- | magnifier/x11/gmag-graphical-server.c | 14 |
2 files changed, 27 insertions, 3 deletions
diff --git a/magnifier/magnifier.c b/magnifier/magnifier.c index 2f23720..5fb19e1 100644 --- a/magnifier/magnifier.c +++ b/magnifier/magnifier.c @@ -943,7 +943,20 @@ magnifier_set_property (BonoboPropertyBag *bag, gdk_display_get_screen ( magnifier->source_display, magnifier->source_screen_num)); - /* attach listeners for DAMAGE, "dirty region", XFIXES cursor changes */ + + /* remove the source_drawable, since in the new display the + * composite can be unavailable and the source_drawable is + * where the desktop screen is composed. If this is not + * freed it will be used even if the display doesn't use + * composite what will lead to wrong behavior and crashes. + * If composite is used in the new display this variable is + * re-created */ + if (magnifier->priv->source_drawable) { + g_object_unref (magnifier->priv->source_drawable); + magnifier->priv->source_drawable = NULL; + } + /* attach listeners for DAMAGE, "dirty region", XFIXES + * cursor changes */ magnifier_set_extension_listeners (magnifier, magnifier_get_root (magnifier)); magnifier_get_display_rect_bounds (magnifier, &magnifier->source_bounds, FALSE); magnifier_zoom_regions_restore (magnifier, zoom_region_params); @@ -1252,6 +1265,7 @@ impl_magnifier_create_zoom_region (PortableServer_Servant servant, zoom_region->priv->parent = magnifier; retval = BONOBO_OBJREF (zoom_region); + /* XXX: should check ev after each call, below */ CORBA_exception_init (ev); GNOME_Magnifier_ZoomRegion_setMagFactor (retval, zx, zy, ev); diff --git a/magnifier/x11/gmag-graphical-server.c b/magnifier/x11/gmag-graphical-server.c index a5864e3..ebfd444 100644 --- a/magnifier/x11/gmag-graphical-server.c +++ b/magnifier/x11/gmag-graphical-server.c @@ -31,6 +31,8 @@ #include "gmag-compositor.h" #endif /* HAVE_COMPOSIE */ +#include <string.h> + #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/extensions/Xfixes.h> @@ -461,13 +463,21 @@ gmag_gs_use_damage () * others. */ static gboolean -gmag_gs_use_compositor () +gmag_gs_use_compositor (Magnifier *magnifier) { if (!gmag_gs_use_damage ()) { return FALSE; } #ifdef HAVE_COMPOSITE gint major, event, error; + + /* if the source and target display are different we don't need the + * composite extension. This is the case when using the dummy driver or + * a dual head configuration */ + if (strcmp (magnifier->source_display_name, + magnifier->target_display_name) != 0) + return FALSE; + if (XQueryExtension (dpy, "Composite", &major, &event, &error) && !g_getenv ("MAGNIFIER_IGNORE_COMPOSITE")) return TRUE; @@ -513,7 +523,7 @@ gmag_gs_client_init (Magnifier *magnifier) g_io_channel_unref (ioc); use_damage = gmag_gs_use_damage (); - use_compositor = gmag_gs_use_compositor (); + use_compositor = gmag_gs_use_compositor (magnifier); fixes_event_base = gmag_cursor_init (magnifier, dpy); |