From 7fe53a99bbabb860b36e197ee119a864acbf67a9 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 21 Mar 2006 07:36:54 +0000 Subject: [PATCH] ]): Synthesize GDK_CONFIGURE events when the window position changes. 2006-03-21 Anders Carlsson * gdk/quartz/GdkQuartzWindow.c ([GdkQuartzWindow -windowDidMove:]): Synthesize GDK_CONFIGURE events when the window position changes. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ gdk/quartz/GdkQuartzWindow.c | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 47926b8cc4..ad69dc5457 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-21 Anders Carlsson + + * gdk/quartz/GdkQuartzWindow.c + ([GdkQuartzWindow -windowDidMove:]): Synthesize GDK_CONFIGURE events + when the window position changes. + 2006-03-20 Matthias Clasen * gtk/gtkdnd.c (gtk_drag_get_cursor): Remove an unused variable. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 47926b8cc4..ad69dc5457 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2006-03-21 Anders Carlsson + + * gdk/quartz/GdkQuartzWindow.c + ([GdkQuartzWindow -windowDidMove:]): Synthesize GDK_CONFIGURE events + when the window position changes. + 2006-03-20 Matthias Clasen * gtk/gtkdnd.c (gtk_drag_get_cursor): Remove an unused variable. diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c index 1ca8f2650f..14918743e4 100644 --- a/gdk/quartz/GdkQuartzWindow.c +++ b/gdk/quartz/GdkQuartzWindow.c @@ -62,6 +62,28 @@ _gdk_quartz_update_focus_window (window); } +-(void)windowDidMove:(NSNotification *)aNotification +{ + NSRect content_rect = [self contentRectForFrameRect:[self frame]]; + GdkWindow *window = [[self contentView] gdkWindow]; + GdkWindowObject *private = (GdkWindowObject *)window; + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl); + GdkEvent *event; + + private->x = content_rect.origin.x; + private->y = _gdk_quartz_get_inverted_screen_y (content_rect.origin.y) - impl->height; + + /* Synthesize a configure event */ + event = gdk_event_new (GDK_CONFIGURE); + event->configure.window = g_object_ref (window); + event->configure.x = private->x; + event->configure.y = private->y; + event->configure.width = impl->width; + event->configure.height = impl->height; + + _gdk_event_queue_append (gdk_display_get_default (), event); +} + -(void)windowDidResize:(NSNotification *)aNotification { NSRect content_rect = [self contentRectForFrameRect:[self frame]];