summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorTim Janik <timj@gimp.org>1998-02-07 02:26:09 +0000
committerTim Janik <timj@src.gnome.org>1998-02-07 02:26:09 +0000
commitedad08adddde09d77aa817a1f12c18a0556d5e2e (patch)
tree0627e1296a568e68abcaa7cfa18b730540bc82ff /gdk
parent5b597c65c771d0131abc2463d726bc58628ba605 (diff)
downloadgtk+-edad08adddde09d77aa817a1f12c18a0556d5e2e.tar.gz
don't wipe out window_private's x and y coordinates if the configure
Sat Feb 7 02:29:01 1998 Tim Janik <timj@gimp.org> * gdk/gdk.c (gdk_event_translate): don't wipe out window_private's x and y coordinates if the configure notify is only about resizing, query the correct origin instead.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdk.c64
-rw-r--r--gdk/gdkwindow.c1
-rw-r--r--gdk/x11/gdkmain-x11.c64
-rw-r--r--gdk/x11/gdkwindow-x11.c1
4 files changed, 88 insertions, 42 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 5caa6cdd6a..668f7a38b4 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -2463,46 +2463,70 @@ gdk_event_translate (GdkEvent *event,
case ConfigureNotify:
/* Print debugging info.
*/
- while ((XPending(gdk_display) > 0) &&
- XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
- ConfigureNotify, xevent))
- /*XSync(gdk_display, 0)*/;
-
+ while ((XPending (gdk_display) > 0) &&
+ XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
+ ConfigureNotify, xevent))
+ /*XSync (gdk_display, 0)*/;
+
if (gdk_show_events)
- g_print ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d\n",
+ g_print ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d\n",
xevent->xconfigure.window - base_id,
- xevent->xconfigure.x, xevent->xconfigure.y,
- xevent->xconfigure.width, xevent->xconfigure.height);
-
+ xevent->xconfigure.x,
+ xevent->xconfigure.y,
+ xevent->xconfigure.width,
+ xevent->xconfigure.height,
+ xevent->xconfigure.border_width,
+ xevent->xconfigure.above - base_id,
+ xevent->xconfigure.override_redirect);
+
if (window_private)
{
if ((window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
-
- if ((window_private->window_type != GDK_WINDOW_CHILD) &&
- ((window_private->width != xevent->xconfigure.width) ||
- (window_private->height != xevent->xconfigure.height)))
+
+ if (window_private->window_type != GDK_WINDOW_CHILD)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
- event->configure.x = xevent->xconfigure.x;
- event->configure.y = xevent->xconfigure.y;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
-
- window_private->x = xevent->xconfigure.x;
- window_private->y = xevent->xconfigure.y;
+
+ if (!xevent->xconfigure.x &&
+ !xevent->xconfigure.y)
+ {
+ gint tx = 0;
+ gint ty = 0;
+ Window child_window = 0;
+
+ if (!XTranslateCoordinates (window_private->xdisplay,
+ window_private->xwindow,
+ gdk_root_window,
+ 0, 0,
+ &tx, &ty,
+ &child_window))
+ g_warning ("GdkWindow %ld doesn't share root windows display?",
+ window_private->xwindow - base_id);
+ event->configure.x = tx;
+ event->configure.y = ty;
+ }
+ else
+ {
+ event->configure.x = xevent->xconfigure.x;
+ event->configure.y = xevent->xconfigure.y;
+ }
+ window_private->x = event->configure.x;
+ window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
-
+
return_val = !window_private->destroyed;
}
}
break;
-
+
case PropertyNotify:
/* Print debugging info.
*/
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 9d6706b618..8cab5510e4 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -957,7 +957,6 @@ gdk_window_get_size (GdkWindow *window,
*height = window_private->height;
}
-
GdkVisual*
gdk_window_get_visual (GdkWindow *window)
{
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 5caa6cdd6a..668f7a38b4 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -2463,46 +2463,70 @@ gdk_event_translate (GdkEvent *event,
case ConfigureNotify:
/* Print debugging info.
*/
- while ((XPending(gdk_display) > 0) &&
- XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
- ConfigureNotify, xevent))
- /*XSync(gdk_display, 0)*/;
-
+ while ((XPending (gdk_display) > 0) &&
+ XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
+ ConfigureNotify, xevent))
+ /*XSync (gdk_display, 0)*/;
+
if (gdk_show_events)
- g_print ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d\n",
+ g_print ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d\n",
xevent->xconfigure.window - base_id,
- xevent->xconfigure.x, xevent->xconfigure.y,
- xevent->xconfigure.width, xevent->xconfigure.height);
-
+ xevent->xconfigure.x,
+ xevent->xconfigure.y,
+ xevent->xconfigure.width,
+ xevent->xconfigure.height,
+ xevent->xconfigure.border_width,
+ xevent->xconfigure.above - base_id,
+ xevent->xconfigure.override_redirect);
+
if (window_private)
{
if ((window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
-
- if ((window_private->window_type != GDK_WINDOW_CHILD) &&
- ((window_private->width != xevent->xconfigure.width) ||
- (window_private->height != xevent->xconfigure.height)))
+
+ if (window_private->window_type != GDK_WINDOW_CHILD)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
- event->configure.x = xevent->xconfigure.x;
- event->configure.y = xevent->xconfigure.y;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
-
- window_private->x = xevent->xconfigure.x;
- window_private->y = xevent->xconfigure.y;
+
+ if (!xevent->xconfigure.x &&
+ !xevent->xconfigure.y)
+ {
+ gint tx = 0;
+ gint ty = 0;
+ Window child_window = 0;
+
+ if (!XTranslateCoordinates (window_private->xdisplay,
+ window_private->xwindow,
+ gdk_root_window,
+ 0, 0,
+ &tx, &ty,
+ &child_window))
+ g_warning ("GdkWindow %ld doesn't share root windows display?",
+ window_private->xwindow - base_id);
+ event->configure.x = tx;
+ event->configure.y = ty;
+ }
+ else
+ {
+ event->configure.x = xevent->xconfigure.x;
+ event->configure.y = xevent->xconfigure.y;
+ }
+ window_private->x = event->configure.x;
+ window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
-
+
return_val = !window_private->destroyed;
}
}
break;
-
+
case PropertyNotify:
/* Print debugging info.
*/
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 9d6706b618..8cab5510e4 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -957,7 +957,6 @@ gdk_window_get_size (GdkWindow *window,
*height = window_private->height;
}
-
GdkVisual*
gdk_window_get_visual (GdkWindow *window)
{