]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/notebook.cpp
Another RTL fix.
[wxWidgets.git] / src / gtk / notebook.cpp
index 2e144a6a0b72b18f9cd0d4b0ffadee663b76b58c..948917069c1fb453b3ef689951de3ed65ca77033 100644 (file)
@@ -192,8 +192,7 @@ gtk_notebook_key_press_callback( GtkWidget   *widget,
                                  GdkEventKey *gdk_event,
                                  wxNotebook  *notebook )
 {
-    if (g_isIdle)
-        wxapp_install_idle_handler();
+    // don't need to install idle handler, its done from "event" signal
 
     if (!notebook->m_hasVMT) return FALSE;
     if (g_blockEventsOnDrag) return FALSE;
@@ -221,7 +220,6 @@ gtk_notebook_key_press_callback( GtkWidget   *widget,
         // m_selection = page;
         gtk_notebook_set_current_page( GTK_NOTEBOOK(widget), page );
 
-        g_signal_stop_emission_by_name (widget, "key_press_event");
         return TRUE;
     }
 
@@ -249,7 +247,6 @@ gtk_notebook_key_press_callback( GtkWidget   *widget,
              client->SetFocus();
         }
 
-        g_signal_stop_emission_by_name (widget, "key_press_event");
         return TRUE;
     }
 
@@ -778,15 +775,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 
                 if ( pixmap && IsPointInsideWidget(pt, pixmap, x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONICON;
+                    *flags = wxBK_HITTEST_ONICON;
                 }
                 else if ( IsPointInsideWidget(pt, GTK_WIDGET(nb_page->m_label), x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONLABEL;
+                    *flags = wxBK_HITTEST_ONLABEL;
                 }
                 else
                 {
-                    *flags = wxNB_HITTEST_ONITEM;
+                    *flags = wxBK_HITTEST_ONITEM;
                 }
             }
 
@@ -795,7 +792,22 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
     }
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+    {
+        *flags = wxBK_HITTEST_NOWHERE;
+        wxWindowBase * page = GetCurrentPage();
+        if ( page )
+        {
+            // rect origin is in notebook's parent coordinates
+            wxRect rect = page->GetRect();
+
+            // adjust it to the notebook's coordinates
+            wxPoint pos = GetPosition();
+            rect.x -= pos.x;
+            rect.y -= pos.y;
+            if ( rect.Contains( pt ) )
+                *flags |= wxBK_HITTEST_ONPAGE;
+        }
+    }
 
     return wxNOT_FOUND;
 }
@@ -832,10 +844,12 @@ void wxNotebook::DoApplyWidgetStyle(GtkRcStyle *style)
         gtk_widget_modify_style(GTK_WIDGET(GetNotebookPage(i)->m_label), style);
 }
 
-bool wxNotebook::IsOwnGtkWindow( GdkWindow *window )
+GdkWindow *wxNotebook::GTKGetWindow(wxArrayGdkWindows& windows) const
 {
-    return ((m_widget->window == window) ||
-            GTK_NOTEBOOK(m_widget)->event_window == window);
+    windows.push_back(m_widget->window);
+    windows.push_back(GTK_NOTEBOOK(m_widget)->event_window);
+
+    return NULL;
 }
 
 // static