Commit 7deea61c authored by Richard Hult's avatar Richard Hult Committed by Richard Hult
Browse files

Add check for source being a window.

2006-04-16  Richard Hult  <richard@imendio.com>

	* 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.
parent 5dc0919e
2006-04-16 Richard Hult <richard@imendio.com>
* 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 <richard@imendio.com>
* gdk/quartz/gdkdrawable-quartz.c: Remove leading cairo/ in include.
......
2006-04-16 Richard Hult <richard@imendio.com>
* 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 <richard@imendio.com>
* gdk/quartz/gdkdrawable-quartz.c: Remove leading cairo/ in include.
......
......@@ -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)
{
......
......@@ -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;
/* First flip the y coordinate */
x_tmp = point.x;
y_tmp = impl->height - point.y;
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;
/* 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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment