-rw-r--r-- | microkde/kdeui/klistview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 6859d36..154cd02 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp @@ -1911,5 +1911,13 @@ void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) { - // qDebug("KListView::emitContextMenu col"); - emit contextRequest( i, p, col ); - emit contextMenu (this, i, p); + QListViewItem* item = i; + int c = col; + // do not trust the values for QListViewItem* i and int col; + // qDebug("KListView::emitContextMenu col"); + if ( col == -1 ) { + QPoint pp = viewport()->mapFromGlobal(p); + item = itemAt( pp); + c = header()->sectionAt(pp.x() ); + } + emit contextRequest( item, p, c ); + emit contextMenu (this, item, p); } |