I debug DialogEd for five hours and then Karsten
tells me that CaptureMouse is broken. Doh. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,7 +116,7 @@
|
|||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
extern wxList wxTopLevelWindows;
|
extern wxList wxTopLevelWindows;
|
||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
wxWindow *g_captureWindow = (wxWindow*)NULL;
|
bool g_capturing = FALSE;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "expose_event" (of m_wxwindow, not of m_widget)
|
// "expose_event" (of m_wxwindow, not of m_widget)
|
||||||
@@ -300,8 +300,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
@@ -374,6 +372,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -390,6 +390,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -407,8 +408,6 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -443,6 +442,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -459,6 +460,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -476,8 +478,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -504,6 +504,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -520,6 +522,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -609,8 +612,6 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
{
|
{
|
||||||
if (widget->window != gdk_event->window) return TRUE;
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -635,8 +636,6 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
{
|
{
|
||||||
if (widget->window != gdk_event->window) return TRUE;
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -1998,7 +1997,7 @@ void wxWindow::CaptureMouse(void)
|
|||||||
GDK_BUTTON_RELEASE_MASK |
|
GDK_BUTTON_RELEASE_MASK |
|
||||||
GDK_POINTER_MOTION_MASK),
|
GDK_POINTER_MOTION_MASK),
|
||||||
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
|
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
|
||||||
g_captureWindow = this;
|
g_capturing = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::ReleaseMouse(void)
|
void wxWindow::ReleaseMouse(void)
|
||||||
@@ -2006,7 +2005,7 @@ void wxWindow::ReleaseMouse(void)
|
|||||||
GtkWidget *connect_widget = GetConnectWidget();
|
GtkWidget *connect_widget = GetConnectWidget();
|
||||||
gtk_grab_remove( connect_widget );
|
gtk_grab_remove( connect_widget );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
||||||
g_captureWindow = (wxWindow*) NULL;;
|
g_capturing = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
|
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
|
||||||
|
@@ -116,7 +116,7 @@
|
|||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
extern wxList wxTopLevelWindows;
|
extern wxList wxTopLevelWindows;
|
||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
wxWindow *g_captureWindow = (wxWindow*)NULL;
|
bool g_capturing = FALSE;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// "expose_event" (of m_wxwindow, not of m_widget)
|
// "expose_event" (of m_wxwindow, not of m_widget)
|
||||||
@@ -300,8 +300,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (win->m_wxwindow)
|
if (win->m_wxwindow)
|
||||||
@@ -374,6 +372,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -390,6 +390,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -407,8 +408,6 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -443,6 +442,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -459,6 +460,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -476,8 +478,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
{
|
{
|
||||||
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -504,6 +504,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
|
|
||||||
|
if (!g_capturing)
|
||||||
|
{
|
||||||
wxNode *node = win->GetChildren()->First();
|
wxNode *node = win->GetChildren()->First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -520,6 +522,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
|
|
||||||
@@ -609,8 +612,6 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
{
|
{
|
||||||
if (widget->window != gdk_event->window) return TRUE;
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -635,8 +636,6 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
{
|
{
|
||||||
if (widget->window != gdk_event->window) return TRUE;
|
if (widget->window != gdk_event->window) return TRUE;
|
||||||
|
|
||||||
if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
|
|
||||||
|
|
||||||
if (g_blockEventsOnDrag) return TRUE;
|
if (g_blockEventsOnDrag) return TRUE;
|
||||||
|
|
||||||
if (!win->HasVMT()) return TRUE;
|
if (!win->HasVMT()) return TRUE;
|
||||||
@@ -1998,7 +1997,7 @@ void wxWindow::CaptureMouse(void)
|
|||||||
GDK_BUTTON_RELEASE_MASK |
|
GDK_BUTTON_RELEASE_MASK |
|
||||||
GDK_POINTER_MOTION_MASK),
|
GDK_POINTER_MOTION_MASK),
|
||||||
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
|
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
|
||||||
g_captureWindow = this;
|
g_capturing = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::ReleaseMouse(void)
|
void wxWindow::ReleaseMouse(void)
|
||||||
@@ -2006,7 +2005,7 @@ void wxWindow::ReleaseMouse(void)
|
|||||||
GtkWidget *connect_widget = GetConnectWidget();
|
GtkWidget *connect_widget = GetConnectWidget();
|
||||||
gtk_grab_remove( connect_widget );
|
gtk_grab_remove( connect_widget );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
||||||
g_captureWindow = (wxWindow*) NULL;;
|
g_capturing = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
|
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
|
||||||
|
@@ -379,8 +379,6 @@ void wxResourceEditorDialogHandler::ProcessItemEvent(wxControl *item, wxMouseEve
|
|||||||
{
|
{
|
||||||
wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
|
wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
|
||||||
|
|
||||||
if (dragItem) childHandler = (wxResourceEditorControlHandler *)dragItem->GetEventHandler();
|
|
||||||
|
|
||||||
long x, y;
|
long x, y;
|
||||||
event.Position(&x, &y);
|
event.Position(&x, &y);
|
||||||
int keys = 0;
|
int keys = 0;
|
||||||
|
Reference in New Issue
Block a user