#include "wx/settings.h"
#include "wx/log.h"
+#ifdef __WXDEBUG__
+ #include "wx/thread.h"
+#endif
+
#include <math.h>
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
-#include "gdk/gdkprivate.h"
-#include "gdk/gdkkeysyms.h"
-#include "wx/gtk/win_gtk.h"
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkprivate.h>
+#include <gdk/gdkkeysyms.h>
+#include <wx/gtk/win_gtk.h>
-#include "gdk/gdkx.h"
+#include <gdk/gdkx.h>
//-----------------------------------------------------------------------------
// documentation on internals
the last click here */
static guint32 gs_timeLastClick = 0;
+extern bool g_mainThreadLocked;
+
//-----------------------------------------------------------------------------
// debug
//-----------------------------------------------------------------------------
#ifdef __WXDEBUG__
+#define DEBUG_MAIN_THREAD if (wxThread::IsMain() && g_mainThreadLocked) printf("gui reentrance");
+
static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget),
GdkEvent *WXUNUSED(event),
const wxChar *WXUNUSED(name) )
static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (!win->m_hasVMT)
return;
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget),
GdkRectangle *rect, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_key_release_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static void gtk_window_vscroll_callback( GtkAdjustment *adjust, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static void gtk_window_hscroll_callback( GtkAdjustment *adjust, wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static void gtk_window_vscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
static void gtk_window_hscroll_change_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
GdkEventButton *WXUNUSED(gdk_event),
wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();
GdkEventButton *WXUNUSED(gdk_event),
wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
// don't test here as we can release the mouse while being over
// a different window than the slider
static gint
gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
{
+ DEBUG_MAIN_THREAD
+
if (g_isIdle)
wxapp_install_idle_handler();