OS.g_signal_connect_after (fixedHandle, OS.button_press_event, windowProc3, -BUTTON_PRESS_EVENT); OS.g_signal_connect_after (fixedHandle, OS.button_release_event, windowProc3, -BUTTON_RELEASE_EVENT); OS.g_signal_connect_after (fixedHandle, OS.motion_notify_event, windowProc3, -MOTION_NOTIFY_EVENT);
int  blockHandle = fixedHandle != 0 ? fixedHandle : eventHandle; OS.g_signal_connect_after (blockHandle, OS.button_press_event, windowProc3, -BUTTON_PRESS_EVENT); OS.g_signal_connect_after (blockHandle, OS.button_release_event, windowProc3, -BUTTON_RELEASE_EVENT); OS.g_signal_connect_after (blockHandle, OS.motion_notify_event, windowProc3, -MOTION_NOTIFY_EVENT);
void hookEvents () {	int /*long*/ windowProc2 = display.windowProc2;	int /*long*/ windowProc3 = display.windowProc3;		/* Connect the keyboard signals */	int /*long*/ focusHandle = focusHandle ();	int focusMask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK | OS.GDK_FOCUS_CHANGE_MASK;	OS.gtk_widget_add_events (focusHandle, focusMask);	OS.g_signal_connect (focusHandle, OS.popup_menu, windowProc2, POPUP_MENU);	OS.g_signal_connect (focusHandle, OS.show_help, windowProc3, SHOW_HELP);	OS.g_signal_connect (focusHandle, OS.key_press_event, windowProc3, KEY_PRESS_EVENT);	OS.g_signal_connect (focusHandle, OS.key_release_event, windowProc3, KEY_RELEASE_EVENT);	OS.g_signal_connect (focusHandle, OS.focus, windowProc3, FOCUS);	OS.g_signal_connect (focusHandle, OS.focus_in_event, windowProc3, FOCUS_IN_EVENT);	OS.g_signal_connect (focusHandle, OS.focus_out_event, windowProc3, FOCUS_OUT_EVENT);	/* Connect the mouse signals */	int /*long*/ eventHandle = eventHandle ();	int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK |		OS.GDK_BUTTON_RELEASE_MASK | OS.GDK_ENTER_NOTIFY_MASK |		OS.GDK_LEAVE_NOTIFY_MASK;	OS.gtk_widget_add_events (eventHandle, eventMask);	OS.g_signal_connect (eventHandle, OS.button_press_event, windowProc3, BUTTON_PRESS_EVENT);	OS.g_signal_connect (eventHandle, OS.button_release_event, windowProc3, BUTTON_RELEASE_EVENT);	OS.g_signal_connect (eventHandle, OS.motion_notify_event, windowProc3, MOTION_NOTIFY_EVENT);	OS.g_signal_connect (eventHandle, OS.enter_notify_event, windowProc3, ENTER_NOTIFY_EVENT);	OS.g_signal_connect (eventHandle, OS.leave_notify_event, windowProc3, LEAVE_NOTIFY_EVENT);	OS.g_signal_connect (eventHandle, OS.scroll_event, windowProc3, SCROLL_EVENT);		/*	* Feature in GTK.  Events such as mouse move are propagate up	* the widget hierarchy and are seen by the parent.  This is the	* correct GTK behavior but not correct for SWT.  The fix is to	* hook a signal after and stop the propagation using a negative	* event number to distinguish this case.	* 	* The signal is hooked to the fixedHandle to catch events sent to	* lightweight widgets.	*/	OS.g_signal_connect_after (fixedHandle, OS.button_press_event, windowProc3, -BUTTON_PRESS_EVENT);	OS.g_signal_connect_after (fixedHandle, OS.button_release_event, windowProc3, -BUTTON_RELEASE_EVENT);	OS.g_signal_connect_after (fixedHandle, OS.motion_notify_event, windowProc3, -MOTION_NOTIFY_EVENT);	/* Connect the event_after signal for both key and mouse */	OS.g_signal_connect (eventHandle, OS.event_after, windowProc3, EVENT_AFTER);	if (focusHandle != eventHandle) {		OS.g_signal_connect (focusHandle, OS.event_after, windowProc3, EVENT_AFTER);	}		/* Connect the paint signal */	int /*long*/ paintHandle = paintHandle ();	int paintMask = OS.GDK_EXPOSURE_MASK | OS.GDK_VISIBILITY_NOTIFY_MASK;	OS.gtk_widget_add_events (paintHandle, paintMask);	OS.g_signal_connect (paintHandle, OS.expose_event, windowProc3, -EXPOSE_EVENT);	OS.g_signal_connect (paintHandle, OS.visibility_notify_event, windowProc3, VISIBILITY_NOTIFY_EVENT);	OS.g_signal_connect_after (paintHandle, OS.expose_event, windowProc3, EXPOSE_EVENT);	/* Connect the Input Method signals */	OS.g_signal_connect_after (handle, OS.realize, windowProc2, REALIZE);	OS.g_signal_connect (handle, OS.unrealize, windowProc2, UNREALIZE);	int /*long*/ imHandle = imHandle ();	if (imHandle != 0) {		OS.g_signal_connect (imHandle, OS.commit, windowProc3, COMMIT);		OS.g_signal_connect (imHandle, OS.preedit_changed, windowProc2, PREEDIT_CHANGED);	}		int /*long*/ topHandle = topHandle ();	OS.g_signal_connect_after (topHandle, OS.map, windowProc2, MAP);}