Window mapping/hang problem with SWT-GTK-DirectFB
- From: Rauch Sam-ra8883 <Sam Rauch motorola com>
- To: "'gtk-devel-list gnome org'" <gtk-devel-list gnome org>
- Subject: Window mapping/hang problem with SWT-GTK-DirectFB
- Date: Thu, 20 May 2004 23:03:25 -0700
Hello.
I am attempting to use SWT (3.0M7) on GTK (2.2.4) on DirectFB (0.9.21) and having some trouble with a window mapping issue. The problem could be fixed at any of the three layers, but I am looking for some advice on which is the right layer to fix it at - or someone to tell me I've completely misunderstood the situation ;)
Problem:
-SWT creates a "Shell" widget which is tied to a GtkWindow.
-SWT uses g_signal_connect() to connect to "map-event"s on the GtkWindow
-SWT realizes the window with gtk_window_realize() (which sets the GtkWindow event_mask without GDK_VISIBILITY_NOTIFY_MASK)
-SWT does not call gtk_widget_add_events() to add GDK_VISIBILITY_NOTIFY_MASK to the GdkWindow
-SWT calls gtk_window_show() to show the window and then waits to recieve a GDK_MAP event At this point SWT hangs because:
-The DirectFB-GDK binding code [gdkwindow-directfb.c:send_map_events()] shows/maps the window then walks the widget hiearchy to see if any widgets have an event_mask with GDK_VISIBILITY_NOTIFY_MASK set. Since none do, a GDK_MAP event is never generated.
As a point of reference, SWT on GTK on X11 works because X11 generates a MapNotify event when the window is mapped and GTK passes it on to the signal handler regardless of whether GDK_VISIBILITY_NOTIFY_MASK is set for the GtkWindow.
If I understand the problem correctly it could be fixed by any of:
1) SWT calling gtk_widget_add_events() on the GtkWindow for GDK_VISIBILITY_NOTIFY_MASK (in org.eclipse.swt.widgets.Shell:hookEvents() right after the signal connect)
2) GTK adding GDK_VISIBILITY_NOTIFY_MASK to every GtkWindow's event_mask (in gtkwindow.c:gtk_window_realize() in the "attributes.event_mask |=" statement outside the if block)
3) The DirectFB-GDK binding code sending GDK_MAP events to any window that gets mapped, regardless of the event_mask field. (in gdkwindow-directfb.c:send_map_events(), event_win would have to be set by some other means than the current gdk_directfb_other_event_window() call). This seems the most like the X11 behavior, but it doesn't feel right given the event_mask field.
I know that #2 works because that's what I've tried, but I am not sure if this is the right way to do it.
Any insight would be appreciated.
Regards,
Sam
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]