diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-information-panel.c | 14 | ||||
-rw-r--r-- | src/caja-sidebar-title.c | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c index 8542b527..086faaee 100644 --- a/src/caja-information-panel.c +++ b/src/caja-information-panel.c @@ -432,12 +432,24 @@ static InformationPanelPart hit_test (CajaInformationPanel *information_panel, int x, int y) { + GtkAllocation *allocation; + gboolean bg_hit; + if (caja_sidebar_title_hit_test_icon (information_panel->details->title, x, y)) { return ICON_PART; } - if (eel_point_in_widget (GTK_WIDGET (information_panel), x, y)) + allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation (GTK_WIDGET (information_panel), allocation); + + bg_hit = allocation != NULL + && x >= allocation->x && y >= allocation->y + && x < allocation->x + allocation->width + && y < allocation->y + allocation->height; + g_free (allocation); + + if (bg_hit) { return BACKGROUND_PART; } diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c index beb30359..e02eaa9d 100644 --- a/src/caja-sidebar-title.c +++ b/src/caja-sidebar-title.c @@ -738,9 +738,21 @@ caja_sidebar_title_size_allocate (GtkWidget *widget, gboolean caja_sidebar_title_hit_test_icon (CajaSidebarTitle *sidebar_title, int x, int y) { + GtkAllocation *allocation; + gboolean icon_hit; + g_return_val_if_fail (CAJA_IS_SIDEBAR_TITLE (sidebar_title), FALSE); - return eel_point_in_widget (sidebar_title->details->icon, x, y); + allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation (GTK_WIDGET (sidebar_title->details->icon), allocation); + g_return_val_if_fail (allocation != NULL, FALSE); + + icon_hit = x >= allocation->x && y >= allocation->y + && x < allocation->x + allocation->width + && y < allocation->y + allocation->height; + g_free (allocation); + + return icon_hit; } static GtkWidget * |