]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/minifram.cpp
Fix crash in wxDC::GetMultiLineTextExtent() after last commit.
[wxWidgets.git] / src / gtk / minifram.cpp
index bd3261e2b13dfb14a4d2ca957abe8128c27a030a..0cf5dd8d24b2bcc0b7439667f00cd1e38592fca7 100644 (file)
@@ -81,7 +81,7 @@ static gboolean expose_event(GtkWidget* widget, GdkEventExpose* gdk_event, wxMin
 
     wxGTKCairoDC dc(cr);
 #else
 
     wxGTKCairoDC dc(cr);
 #else
-    if (!win->m_hasVMT || gdk_event->count > 0 ||
+    if (gdk_event->count > 0 ||
         gdk_event->window != gtk_widget_get_window(widget))
     {
         return false;
         gdk_event->window != gtk_widget_get_window(widget))
     {
         return false;
@@ -144,7 +144,7 @@ extern "C" {
 static gboolean
 gtk_window_button_press_callback(GtkWidget* widget, GdkEventButton* gdk_event, wxMiniFrame* win)
 {
 static gboolean
 gtk_window_button_press_callback(GtkWidget* widget, GdkEventButton* gdk_event, wxMiniFrame* win)
 {
-    if (!win->m_hasVMT || gdk_event->window != gtk_widget_get_window(widget))
+    if (gdk_event->window != gtk_widget_get_window(widget))
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
@@ -224,7 +224,7 @@ extern "C" {
 static gboolean
 gtk_window_button_release_callback(GtkWidget* widget, GdkEventButton* gdk_event, wxMiniFrame* win)
 {
 static gboolean
 gtk_window_button_release_callback(GtkWidget* widget, GdkEventButton* gdk_event, wxMiniFrame* win)
 {
-    if (!win->m_hasVMT || gdk_event->window != gtk_widget_get_window(widget))
+    if (gdk_event->window != gtk_widget_get_window(widget))
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
@@ -257,9 +257,8 @@ extern "C" {
 static gboolean
 gtk_window_leave_callback(GtkWidget *widget,
                           GdkEventCrossing* gdk_event,
 static gboolean
 gtk_window_leave_callback(GtkWidget *widget,
                           GdkEventCrossing* gdk_event,
-                          wxMiniFrame *win)
+                          wxMiniFrame*)
 {
 {
-    if (!win->m_hasVMT) return FALSE;
     if (g_blockEventsOnDrag) return FALSE;
     if (gdk_event->window != gtk_widget_get_window(widget))
         return false;
     if (g_blockEventsOnDrag) return FALSE;
     if (gdk_event->window != gtk_widget_get_window(widget))
         return false;
@@ -278,7 +277,7 @@ extern "C" {
 static gboolean
 gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
 {
 static gboolean
 gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
 {
-    if (!win->m_hasVMT || gdk_event->window != gtk_widget_get_window(widget))
+    if (gdk_event->window != gtk_widget_get_window(widget))
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
         return false;
     if (g_blockEventsOnDrag) return TRUE;
     if (g_blockEventsOnScroll) return TRUE;
@@ -340,6 +339,15 @@ static unsigned char close_bits[]={
 
 IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame,wxFrame)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame,wxFrame)
 
+wxMiniFrame::~wxMiniFrame()
+{
+    if (m_widget)
+    {
+        GtkWidget* eventbox = gtk_bin_get_child(GTK_BIN(m_widget));
+        GTKDisconnect(eventbox);
+    }
+}
+
 bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name )
 bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name )