summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_core/src/ui_utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index 270bf762c9..55f8f3d1fa 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -1411,7 +1411,7 @@ HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter)
tvis.itemex.stateMask = tvis.itemex.state;
tvis.itemex.lParam = saveOldData;
- tvis.hParent = GetParent(hInsertAfter);
+ tvis.hParent = (hInsertAfter == TVI_FIRST) ? NULL : GetParent(hInsertAfter);
tvis.hInsertAfter = hInsertAfter;
return InsertItem(&tvis);
}