Fixed so it at least works with window managers other than Enlightenment,

Sat Nov 21 18:53:13 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
	Fixed so it at least works with window managers other
	than Enlightenment, though it probably needs to be
	removed altogether.
This commit is contained in:
Owen Taylor 1998-11-22 00:06:57 +00:00 committed by Owen Taylor
parent 06d68566df
commit d88375e9c3
10 changed files with 104 additions and 49 deletions

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -1,3 +1,10 @@
Sat Nov 21 18:53:13 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_get_deskrelative_origin):
Fixed so it at least works with window managers other
than Enlightenment, though it probably needs to be
removed altogether.
1998-11-21 Andrew T. Veliath <andrewtv@usa.net>
* gtk/gtkhandlebox.[ch]: Add shadow_type and

View File

@ -308,7 +308,7 @@ GdkWindowType gdk_window_get_type (GdkWindow *window);
gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
gint gdk_window_get_deskrelative_origin (GdkWindow *window,
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y);
void gdk_window_get_root_origin (GdkWindow *window,

View File

@ -1302,13 +1302,14 @@ gdk_window_get_origin (GdkWindow *window,
return return_val;
}
gint
gboolean
gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y)
{
GdkWindowPrivate *private;
gint return_val, num_children, format_return;
gboolean return_val = FALSE;
gint num_children, format_return;
Window win, *child, parent, root;
gint tx = 0;
gint ty = 0;
@ -1321,46 +1322,48 @@ gdk_window_get_deskrelative_origin (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = 0;
if (!private->destroyed)
{
if (!atom)
atom = XInternAtom(private->xdisplay, "ENLIGHTENMENT_DESKTOP", False);
win = private->xwindow;
while (XQueryTree(private->xdisplay, win, &root, &parent,
&child, (unsigned int *)&num_children))
{
if ((child) && (num_children > 0))
XFree(child);
win = parent;
if (!parent)
break;
else
win = parent;
if (win == root)
break;
data_return = NULL;
XGetWindowProperty(private->xdisplay, win, atom, 0, 0x7fffffff,
XGetWindowProperty(private->xdisplay, win, atom, 0, 0,
False, XA_CARDINAL, &type_return, &format_return,
&number_return, &bytes_after_return, &data_return);
if (data_return)
if (type_return == XA_CARDINAL)
{
if (data_return)
XFree(data_return);
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
win,
0, 0, &tx, &ty,
&root);
XFree(data_return);
break;
}
}
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
win,
0, 0, &tx, &ty,
&root);
if (x)
*x = tx;
if (y)
*y = ty;
}
if (!return_val)
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&root);
if (x)
*x = tx;
if (y)
*y = ty;
return return_val;
}

View File

@ -1302,13 +1302,14 @@ gdk_window_get_origin (GdkWindow *window,
return return_val;
}
gint
gboolean
gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y)
{
GdkWindowPrivate *private;
gint return_val, num_children, format_return;
gboolean return_val = FALSE;
gint num_children, format_return;
Window win, *child, parent, root;
gint tx = 0;
gint ty = 0;
@ -1321,46 +1322,48 @@ gdk_window_get_deskrelative_origin (GdkWindow *window,
private = (GdkWindowPrivate*) window;
return_val = 0;
if (!private->destroyed)
{
if (!atom)
atom = XInternAtom(private->xdisplay, "ENLIGHTENMENT_DESKTOP", False);
win = private->xwindow;
while (XQueryTree(private->xdisplay, win, &root, &parent,
&child, (unsigned int *)&num_children))
{
if ((child) && (num_children > 0))
XFree(child);
win = parent;
if (!parent)
break;
else
win = parent;
if (win == root)
break;
data_return = NULL;
XGetWindowProperty(private->xdisplay, win, atom, 0, 0x7fffffff,
XGetWindowProperty(private->xdisplay, win, atom, 0, 0,
False, XA_CARDINAL, &type_return, &format_return,
&number_return, &bytes_after_return, &data_return);
if (data_return)
if (type_return == XA_CARDINAL)
{
if (data_return)
XFree(data_return);
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
win,
0, 0, &tx, &ty,
&root);
XFree(data_return);
break;
}
}
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
win,
0, 0, &tx, &ty,
&root);
if (x)
*x = tx;
if (y)
*y = ty;
}
if (!return_val)
return_val = XTranslateCoordinates (private->xdisplay,
private->xwindow,
gdk_root_window,
0, 0, &tx, &ty,
&root);
if (x)
*x = tx;
if (y)
*y = ty;
return return_val;
}