diff --git a/ChangeLog b/ChangeLog index fb104a685c..c77072c7c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-04-16 Richard Hult + + * gdk/quartz/gdkdrawable-quartz.c: (gdk_quartz_draw_drawable): Add check + for source being a window. + + * gdk/quartz/gdkwindow-quartz.c: (_gdk_windowing_window_get_pointer): + Don't assert on window not being the root window. + 2006-04-16 Richard Hult * gdk/quartz/gdkdrawable-quartz.c: Remove leading cairo/ in include. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fb104a685c..c77072c7c0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2006-04-16 Richard Hult + + * gdk/quartz/gdkdrawable-quartz.c: (gdk_quartz_draw_drawable): Add check + for source being a window. + + * gdk/quartz/gdkwindow-quartz.c: (_gdk_windowing_window_get_pointer): + Don't assert on window not being the root window. + 2006-04-16 Richard Hult * gdk/quartz/gdkdrawable-quartz.c: Remove leading cairo/ in include. diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c index 50c181fa14..75c17b6796 100644 --- a/gdk/quartz/gdkdrawable-quartz.c +++ b/gdk/quartz/gdkdrawable-quartz.c @@ -275,15 +275,20 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable, { int src_depth = gdk_drawable_get_depth (src); int dest_depth = gdk_drawable_get_depth (drawable); - GdkDrawableImplQuartz *impl; GdkDrawableImplQuartz *src_impl; - - impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable); if (GDK_IS_DRAWABLE_IMPL_QUARTZ (src)) src_impl = GDK_DRAWABLE_IMPL_QUARTZ (src); - else + else if (GDK_IS_PIXMAP (src)) src_impl = GDK_DRAWABLE_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (src)->impl); + else if (GDK_IS_WINDOW (src)) + { + src_impl = GDK_DRAWABLE_IMPL_QUARTZ (GDK_WINDOW_OBJECT (src)->impl); + /* FIXME: Implement drawing a window. */ + return; + } + else + g_assert_not_reached (); if (src_depth == 1) { diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index e94ebfe7d8..536dc1678f 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -952,35 +952,30 @@ _gdk_windowing_window_get_pointer (GdkDisplay *display, gint *y, GdkModifierType *mask) { - if (window == _gdk_root) - { - g_error ("FIXME: support get_pointer with root window"); - } - else - { - GdkWindow *toplevel = gdk_window_get_toplevel (window); - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (toplevel)->impl); - GdkWindowObject *private = GDK_WINDOW_OBJECT (window); - NSWindow *nswindow = impl->toplevel; - NSPoint point = [nswindow mouseLocationOutsideOfEventStream]; - int x_tmp, y_tmp; + GdkWindow *toplevel = gdk_window_get_toplevel (window); + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (toplevel)->impl); + GdkWindowObject *private = GDK_WINDOW_OBJECT (window); + NSWindow *nswindow = impl->toplevel; + NSPoint point = [nswindow mouseLocationOutsideOfEventStream]; + int x_tmp, y_tmp; - /* First flip the y coordinate */ - x_tmp = point.x; - y_tmp = impl->height - point.y; + /* FIXME: Might need to special-case window being the root window. */ + + /* First flip the y coordinate */ + x_tmp = point.x; + y_tmp = impl->height - point.y; - while (private != GDK_WINDOW_OBJECT (toplevel)) { - x_tmp -= private->x; - y_tmp -= private->y; + while (private != GDK_WINDOW_OBJECT (toplevel)) { + x_tmp -= private->x; + y_tmp -= private->y; + + private = private->parent; + } - private = private->parent; - } - - if (x) - *x = x_tmp; - if (y) - *y = y_tmp; - } + if (x) + *x = x_tmp; + if (y) + *y = y_tmp; /* FIXME: Implement return value */ return NULL;